Backups
What a backup holds, how to take and restore one, and what the server does on its first start from a backup.
What to keep
A federation is the database and the volumes together. Apart they are useless:
| What | Why you cannot do without it |
|---|---|
| The PostgreSQL database | Everything except media bytes: profiles, chats, messages, settings. |
The federation volume | The Noise key (without it devices cannot connect) and the media files the database refers to. |
The caddy volume | Certificates and, with tls internal, Caddy's own certificate authority. |
| The state directory | stack.env with passwords, the federation ID, push keys, TURN and SFU secrets, Compose files. |
The APNs .p8 key | Not in the backup: keep it separately. |
A database started on another or empty media volume refuses to start with MediaVolumeMismatch.
Taking a backup
python3 tools/mvp-stack.py backup --backup /absolute/path/backup-2026-10-26The command stops the whole stack for a while so the PostgreSQL snapshot is consistent, archives every volume and the configuration with SHA-256 sums, and starts the stack again, even if archiving failed. The backup directory must be new.
The archive is not encrypted and not signed: it holds private keys and passwords. Keep it like passwords, encrypt it before it leaves the machine, and restore only your own backups.
The stack has no schedule: run the command from cron or a systemd timer at quiet hours. The downtime lasts while the volumes are archived and grows with the amount of media.
Restoring
On a machine without comon-mvp volumes, from the same repository version:
python3 tools/mvp-stack.py restore --state .local/restored --backup /absolute/path/backup-2026-10-26
python3 tools/mvp-stack.py up --state .local/restored
python3 tools/mvp-stack.py check --state .local/restoredrestore checks the sums, needs a new state directory and refuses when the volumes already
exist: it never overwrites live data. Do not delete a running stack's volumes to try a restore.
Keep the same domain and the same image versions.
To rehearse a restore on the same machine, add --project comon-mvp-restored to every command of the
restored stack and stop the original before starting the copy: two diverging instances of one
federation are not redundancy.
First start from a backup
A restored federation is older than what the apps, relays and the outside world have already seen.
So restore adds --restored-backup=<backup name> to the server, and before serving, the first
start:
- checks media: if files of messages and avatars are missing, the server does not start and
lists them in the log (
restore_missing_media). Restore the media volume taken together with the database, or start the server with--accept-missing-media; - renews push keys: nothing old goes out, and devices register again;
- starts history from a new generation: apps read their chats again instead of skipping what they saw before the loss, and keep for their people the sends made after the backup;
- holds outbound work: scheduled messages are not sent (their authors can edit or delete them),
bot webhooks are not called.
/readyshows"outbound": "held".
Later starts with the same name change nothing, so the option may stay.
Once you have checked that everything is fine, release outbound work (with the server stopped):
dc stop federation
dc run --rm --no-deps --entrypoint /app/bin/federation_admin federation \
--data=/data --postgres-conninfo-file=/run/secrets/postgres-conninfo restores
dc run --rm --no-deps --entrypoint /app/bin/federation_admin federation \
--data=/data --postgres-conninfo-file=/run/secrets/postgres-conninfo release-outbound
dc start federationdc is the function from operations.
If push was on, it is off after a restore: old revocations and preview keys need reconciling before devices are admitted again (push).
Checking after a restore
- A device already signed in connects and sees the earlier messages.
- Signing in from a second device works.
- A new message reaches both.