-
-
Notifications
You must be signed in to change notification settings - Fork 0
Backup & Restore
This page covers the supported backup and restore operations for Docker Compose installs. For installation, reverse proxy, phone sync, and production setup, use the Self-Hosting Guide.
| Need | Supported path |
|---|---|
| Routine app backup | Admin panel backup schedule or manual export |
| Fresh-instance restore | Setup wizard restore from a Tribu backup archive |
| Operator-level PostgreSQL backup | Docker Compose commands on this page |
| Operator-level PostgreSQL restore drill | Docker Compose commands on this page, preferably on a fresh test stack |
Legacy repository-local helper scripts are no longer part of the supported operator surface. Use the Admin panel, setup wizard, or the Compose commands below so the runbook stays visible and reviewable.
- Docker with Compose v2 is installed and running.
- Tribu uses the standard Compose setup or an equivalent stack.
- The backend can write to
/backupswhen using the built-in Admin backup flow. - You know where your
.env, Compose file, reverse proxy config, and TLS material are stored. - You can run
docker composein the directory that contains your Tribu Compose file.
| Included in Tribu backup | Not included |
|---|---|
| PostgreSQL database dump |
.env secrets |
| backup metadata | reverse proxy config |
| family data stored in the database | TLS certificates |
| calendars, contacts, birthdays, tasks, shopping, rewards, gifts, recipes, meal plans, settings | host-level files outside the database and backup volume |
| OIDC settings stored in the database | external storage configuration |
Valkey is not backed up because it stores cache data only.
Admins can manage backups from the Admin panel.
Open Admin > Backups and choose a schedule:
| Preset | When |
|---|---|
| Off | No automatic backups |
| Daily | Every day at 03:00 |
| Weekly | Every Sunday at 03:00 |
| Monthly | 1st of each month at 03:00 |
Set retention to control how many backups are kept. Older backups are deleted automatically.
Click Create backup to trigger a backup immediately. The archive appears in the list and can be downloaded.
The archive is named like tribu-backup-YYYY-MM-DD-HHMMSS.tar.gz and contains:
-
database.dump: PostgreSQL dump in custom format -
metadata.json: backup version, Alembic revision, PostgreSQL version, timestamp
By default backups are stored in a Docker volume. For a NAS or external drive, bind mount a host path to /backups on the backend service:
backend:
volumes:
- /mnt/nas/backups/tribu:/backupsMake sure the backend container can write to that path.
Use this when you want a plain PostgreSQL dump from the Compose stack. Run the commands in the directory that contains docker-compose.yml.
Create a timestamped backup directory:
mkdir -p backups
BACKUP_FILE="backups/tribu-db-$(date +%Y-%m-%d-%H%M%S).dump"Create the dump:
docker compose exec -T postgres \
pg_dump -U tribu -d tribu -Fc \
> "$BACKUP_FILE"Optionally record the current migration revision next to the dump:
docker compose exec -T postgres \
psql -U tribu -d tribu -t -A \
-c "SELECT version_num FROM alembic_version LIMIT 1" \
> "${BACKUP_FILE%.dump}.alembic.txt"Check that the file exists and is non-empty:
ls -lh "$BACKUP_FILE"Store the dump somewhere other than the same disk when possible. Treat the dump as sensitive household data.
Use this for normal Tribu backup archives created by the Admin panel.
- Start a fresh Tribu stack with a new database volume.
- Configure
.envmanually. Secrets are not included in the backup. - Set
SETUP_RESTORE_TOKENin.envif you want to protect restore upload during first setup. - Open the setup wizard and choose Restore from backup.
- Upload the
tribu-backup-*.tar.gzarchive. - Sign in and verify the household data and integrations.
Use this for a PostgreSQL dump created with the Compose backup commands above. Test this on a fresh stack before relying on it for an outage.
Set the backup file you want to restore:
BACKUP_FILE="backups/tribu-db-2026-02-24-143022.dump"Stop app traffic and keep PostgreSQL running:
docker compose stop backend frontend
docker compose up -d postgresDrop and recreate the application database:
docker compose exec -T postgres \
psql -U tribu -d postgres \
-c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'tribu' AND pid <> pg_backend_pid();"
docker compose exec -T postgres dropdb -U tribu --if-exists tribu
docker compose exec -T postgres createdb -U tribu -O tribu tribuRestore the dump:
docker compose exec -T postgres \
pg_restore -U tribu -d tribu --no-owner --no-privileges \
< "$BACKUP_FILE"Start Tribu again. The backend runs pending migrations on startup:
docker compose up -dDo not wait for a real outage to test restore.
- Start a fresh Tribu stack with a new database volume.
- Restore a recent backup.
- Sign in and verify:
- family exists
- calendar, tasks, shopping, contacts, rewards, gifts, recipes, meal plans, and settings are present
- migrations completed
- reverse proxy and phone sync still use the expected public URL
- Confirm
.env, Compose overrides, reverse proxy config, TLS certificates, and external mount configuration are covered by your normal server backup.
- Changing
JWT_SECRETinvalidates existing sessions and tokens. - OIDC client secrets stored in the database are part of the database backup. Treat backup archives and dumps as sensitive.
- Keep
.env, Compose overrides, reverse proxy config, TLS certificates, and external mount configuration in your normal server backup. - Store backups somewhere other than the same disk when possible.
- Test restore after major upgrades.
- Check
docker compose logs backendfor Admin panel backups. - Check
docker compose logs postgresfor Compose-level dumps. - Confirm the backend can write to
/backupswhen using Admin panel backups. - Check free disk space.
- If using a NAS mount, check mount permissions and availability.
- Confirm the archive or dump comes from the expected Tribu instance.
- Use a fresh database volume for restore drills.
- Confirm the target version can run pending migrations.
- For Admin panel backup archives, restore through the setup wizard.
- For raw PostgreSQL dumps, use the Compose restore commands on this page.
- Confirm
JWT_SECRETis set. - If you changed
JWT_SECRET, existing sessions and tokens are invalid and users need to log in again. - Check OIDC settings if SSO is enabled.