Skip to main content

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

DataLocationMethod
PostgreSQL databaseDocker volume (atrium-pgdata)pg_dump
Environment file~/atrium/.envFile copy
TLS certificatesTraefik'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

VariableDescription
BACKUP_S3_ENDPOINTS3-compatible endpoint (e.g., Hetzner Object Storage).
BACKUP_S3_BUCKETBucket name.
BACKUP_S3_ACCESS_KEYAccess key.
BACKUP_S3_SECRET_KEYSecret key.
BACKUP_SCHEDULECron expression for backup frequency. Default: daily at 03:00 UTC.
BACKUP_RETENTION_DAYSNumber 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:

  1. Stop the application containers (keep PostgreSQL running):

    docker compose stop backend frontend
  2. 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;"
  3. Restore the dump:

    gunzip -c atrium_backup_20260415_030000.sql.gz | docker compose exec -T postgres psql -U atrium atrium
  4. Restart the stack:

    docker compose up -d
  5. 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:

  1. Create a backup.
  2. Spin up a test instance (different server or different Docker Compose project name).
  3. Restore the backup.
  4. Verify data integrity.

This ensures your backup pipeline works end-to-end and that the dump format is valid.