Skip to content

Backup and restore

Tusile has no one-click backup button. You use standard tools: a Postgres dump for the database, an archive of the data volume, and a copy of the uploaded files (a Docker volume or an S3 bucket). Take all of them at the same point in time when you can, so attachment paths in the database still match the files.

What Where it lives Why it matters
Database the postgres service, volume community-pgdata Channels, messages, roles, invites, members and settings. A logical dump (pg_dump) is enough for backup and migration.
Data volume community-data, mounted at /app/data (DATA_DIR) The install ID, an unused Offgrid owner claim token and, on an Offgrid server, community_key. A few small files; back them up every time.
Uploads (local storage) community-uploads, mounted at /app/uploads Every attachment, emoji and icon, with the default STORAGE_BACKEND=local.
Uploads (S3) your bucket With STORAGE_BACKEND=s3, the bucket is the source of truth. Use your provider’s versioning, replication or export tools.
Config .env, Caddyfile, livekit.prod.yaml .env holds the server token and the LiveKit keys, so store it as carefully as the dumps.

Named volumes are prefixed with the Compose project name, which comes from COMPOSE_PROJECT_NAME in .env. The setup script writes it for new installs as community-<hash> (community-offgrid-<hash> for Offgrid), so the volumes are community-<hash>_community-pgdata, community-<hash>_community-uploads and community-<hash>_community-data.

Installs from before 30 July 2026 have no COMPOSE_PROJECT_NAME line, and Compose falls back to community-${SERVER_TOKEN}, so their volumes look like community-<token>_community-pgdata. That fallback is kept on purpose: adding the line to an existing .env would orphan your database and uploads. Leave it alone.

List the exact names with:

Terminal window
docker volume ls

Run every docker compose command from the same folder and .env you use in production, so the project name matches. The commands below use the bundle’s Postgres user and database, both tusile_community; use your own values if you changed them.

From the folder with your docker-compose.yml, with the stack running.

Custom format, restored with pg_restore (recommended):

Terminal window
docker compose exec -T postgres pg_dump -U tusile_community -d tusile_community -Fc > tusile_community.dump

Plain SQL, restored with psql:

Terminal window
docker compose exec -T postgres pg_dump -U tusile_community -d tusile_community --clean --if-exists > tusile_community.sql

Store dump files securely: they contain your community’s data. On Windows, PowerShell’s > works with -T on docker compose exec; Git Bash or WSL work too.

Replace PROJECT with your project name from docker volume ls:

Terminal window
docker run --rm -v PROJECT_community-data:/data -v "$(pwd):/backup" alpine tar czf /backup/data.tgz -C /data .
docker run --rm -v PROJECT_community-uploads:/data -v "$(pwd):/backup" alpine tar czf /backup/uploads.tgz -C /data .

On Windows without a Unix shell, find the mountpoint with docker volume inspect and archive that folder with your own tool, or run the commands from WSL or Git Bash.

  1. Set up the new host or folder with the same configuration as before. Copying the old .env is simplest. A Cloud server re-registers as the same community from SERVER_TOKEN and COMMUNITY_PUBLIC_URL. On Offgrid keep OFFGRID_MODE=true; the identity comes from the data volume you restore below.

  2. Start Postgres only, so nothing writes to the database during the restore:

    Terminal window
    docker compose up -d postgres
  3. Restore the database.

    Custom-format dump:

    Terminal window
    docker compose cp tusile_community.dump postgres:/tmp/tusile_community.dump
    docker compose exec postgres pg_restore --clean --if-exists -U tusile_community -d tusile_community /tmp/tusile_community.dump

    Plain SQL:

    Terminal window
    docker compose exec -T postgres psql -U tusile_community -d tusile_community < tusile_community.sql
  4. Restore the data and uploads volumes (empty them first if the stack already ran on this host):

    Terminal window
    docker run --rm -v PROJECT_community-data:/data -v "$(pwd):/backup" alpine sh -c "cd /data && tar xzf /backup/data.tgz"
    docker run --rm -v PROJECT_community-uploads:/data -v "$(pwd):/backup" alpine sh -c "cd /data && tar xzf /backup/uploads.tgz"
  5. Start the full stack:

    Terminal window
    docker compose up -d

    The community server runs migrations on startup. With a restored database they are no-ops or small incremental steps.

Moving to a newer server version or a new Postgres major version is covered in Upgrades.