Skip to content
DocsSelf-hosting

Backups and restore

Back up your server before you move it to another machine, change your Docker setup, or do anything you might need to undo.

On this page

What's in a backup

Your data lives in a database and several Docker volumes. Back them up together, along with your install directory:

WhatContains
DatabaseBots, conversations, memory, run history, plugin accounts, and private skills
computer_home volumeBrowser profiles, website sign-ins, model provider sign-ins, and software bots installed in their home folder
computer_local volumeSoftware bots installed system-wide in /usr/local, and the list of apt packages the computer reinstalls when it starts, with their cached downloads
agent_data volumeSkills, routines, bot profiles, and model settings
workspace volumeFiles in /workspace
assets volumeAttachments
box_store volumeSnapshots of the bots' computer files
Install directorySettings and generated secrets

Backups include sign-ins to websites and services. Store them somewhere private.

The database backup that openteam update makes is for rolling back a failed update. It isn't a full backup.

Update backups

Before each update, openteam update saves a copy of the database in the backups folder of your install directory, named postgres-<old version>-before-<new version>-<time>-<UUID>.sql. If the new version doesn't start, the updater restores the copy it just made and restarts the previous version.

  • Database only. Update backups don't include the Docker volumes (workspace files, browser sign-ins, attachments, software bots installed) and don't roll them back. The updater restores the previous .env and compose.yaml itself, from copies it holds during the update. Use Make a backup for everything else.
  • The three newest are kept. After each successful update, older update backups are deleted. To keep a different number, set OPENTEAM_BACKUP_RETENTION_COUNT in the install directory's .env; 0 turns deletion off. To keep a particular dump, copy it somewhere else.
  • Private. The copies include plugin sign-ins and saved keys. Only your user can read them.

Make a backup

These commands work in Bash or zsh on macOS and Linux. On a Windows host, adapt them for PowerShell; the install directory is %LOCALAPPDATA%\OpenTeam. They assume the default Compose project name, openteam; if you installed with --project-name, use your name in oc() and in the volume names (<name>_openteam_<volume>). They pause your bots while the backup runs, so let active work finish first.

Terminal
D=~/.openteam
OUT=~/openteam-backup-$(date -u +%Y%m%dT%H%M%SZ)
mkdir -p "$OUT"
oc() { docker compose --project-name openteam --project-directory "$D" -f "$D/compose.yaml" "$@"; }

# Stop the bots, but keep the database running
oc stop server worker computer

# Back up the database
oc exec -T postgres pg_dump -U openteam -d openteam --format=custom > "$OUT/postgres.dump"

# Back up the volumes
for v in computer_home computer_local agent_data assets workspace box_store; do
  docker run --rm -v "openteam_openteam_$v:/source:ro" -v "$OUT:/backup" alpine:3.22 \
    tar -czf "/backup/openteam_$v.tar.gz" -C /source .
done

# Back up the install directory, including Tailscale HTTPS route ownership if present
cp "$D/.env" "$D/compose.yaml" "$D/installation.json" "$OUT/"
[ -f "$D/tailscale-routes.json" ] && cp "$D/tailscale-routes.json" "$OUT/"

openteam start

If you installed OpenTeam somewhere else, set D to that directory: $OPENTEAM_HOME if you set it, $XDG_CONFIG_HOME/openteam if you set XDG_CONFIG_HOME, or the path you passed to --dir (then also run openteam start --dir "$D"). Keep backups outside the install directory.

If you use automatic HTTPS, your certificates aren't included. On a new machine, the proxy requests new ones once your domain points there.

Restore a backup

Restoring replaces all the data in the target server. To move to a new machine, first install OpenTeam there.

Terminal
D=~/.openteam
OUT=~/openteam-backup-20260101T000000Z   # the backup to restore
oc() { docker compose --project-name openteam --project-directory "$D" -f "$D/compose.yaml" "$@"; }

# Stop the server and remove its current database
oc down
docker volume rm openteam_openteam_postgres

# Put back the install directory, then restore the database
cp "$OUT/.env" "$OUT/compose.yaml" "$OUT/installation.json" "$D/"
[ -f "$OUT/tailscale-routes.json" ] && cp "$OUT/tailscale-routes.json" "$D/"
oc up -d --wait postgres
oc exec -T postgres pg_restore -U openteam -d openteam < "$OUT/postgres.dump"

# Restore the volumes
for v in computer_home computer_local agent_data assets workspace box_store; do
  docker run --rm -v "openteam_openteam_$v:/target" -v "$OUT:/backup:ro" alpine:3.22 \
    sh -c "find /target -mindepth 1 -delete && tar -xzf /backup/openteam_$v.tar.gz -C /target"
done

openteam start

The restore recreates the database so that it uses the password saved in your backup's .env. Then run openteam status and open a bot to check that its conversations, memory, and files are back.

On a new machine, the restored settings still use the old machine's address. Run openteam setup --advanced and enter the new address. If you use a domain name, you can point it at the new machine instead. Then update the server URL in your apps, and the callback URL for any plugin that uses one, such as Google or Slack.

Changing Docker setups

Docker volumes belong to the Docker engine that created them. If you switch Docker contexts, reinstall Docker Desktop, or move to a different engine, your data doesn't come with you. Back up first, then restore on the new engine before removing the old one.

Restarting the server or the host keeps your data. Only deleting the Docker volumes or running openteam uninstall --purge removes it.