Backups
In a self-hosted deployment, you are responsible for backups. Atrium stores all data in PostgreSQL — backing up the database is sufficient to restore the entire system.
What to back up
| Data | Location | Method |
|---|---|---|
| PostgreSQL database | Docker volume (atrium-pgdata) | pg_dump |
| Environment file | ~/atrium/.env | File copy |
| TLS certificates | Traefik's ACME storage (/certs/acme.json) | File copy (optional — Let's Encrypt re-issues on demand) |
The database contains everything: tenants, sites, users, visits, visitor profiles, document templates, signed document archives, signature data, vouchers, audit logs, and credentials.
Container images don't need to be backed up — they're pulled from the container registry on deployment.
Automated backup
The Docker Compose stack includes a backup container that runs pg_dump on a schedule and uploads the dump to S3-compatible object storage.
Configuration
| Variable | Description |
|---|---|
BACKUP_S3_ENDPOINT | S3-compatible endpoint (e.g., Hetzner Object Storage). |
BACKUP_S3_BUCKET | Bucket name. |
BACKUP_S3_ACCESS_KEY | Access key. |
BACKUP_S3_SECRET_KEY | Secret key. |
BACKUP_SCHEDULE | Cron expression for backup frequency. Default: daily at 03:00 UTC. |
BACKUP_RETENTION_DAYS | Number of days to retain backups. Default: 30. |
Manual backup
To create a backup manually:
docker compose exec -T postgres pg_dump -U atrium atrium | gzip > atrium_backup_$(date +%Y%m%d_%H%M%S).sql.gz
Store the file securely off-server.
Restore procedure
To restore from a backup:
-
Stop the application containers (keep PostgreSQL running):
docker compose stop backend frontend -
Drop and recreate the database:
docker compose exec -T postgres psql -U atrium -c "DROP DATABASE atrium;"
docker compose exec -T postgres psql -U atrium -c "CREATE DATABASE atrium;" -
Restore the dump:
gunzip -c atrium_backup_20260415_030000.sql.gz | docker compose exec -T postgres psql -U atrium atrium -
Restart the stack:
docker compose up -d -
Verify: Log in and check that your data is intact.
Testing your backups
Backups that haven't been tested are not backups. Periodically verify your restore procedure:
- Create a backup.
- Spin up a test instance (different server or different Docker Compose project name).
- Restore the backup.
- Verify data integrity.
This ensures your backup pipeline works end-to-end and that the dump format is valid.