Self-hosting
Update, back up and restore
Keep the server current and your data safe.
Update
git pull
make up
When the server starts, it applies any new database migration. Before it does, it saves a copy of the database named pre-migrate-v<N>-<time>.db in the data volume. That copy is your way back if an update goes wrong.
Back up
A backup service saves a snapshot of the database every night and mirrors the images to a folder. Point that folder at another disk or a network share, so a copy lives off the machine.
- 01Mount the disk or network share on the machine, and make sure Docker is allowed to use that path.
- 02Set
SHOP_BACKUP_DIRindeploy/.env, for example/Volumes/backups/shop. - 03Start the stack again, then run a backup now to check it works.
make up make backup
Backups run at 03:30 by default and snapshots are kept for 30 days; the newest three are always kept. If the folder is not available, the next run fails and the app shows NAS backup is out of date in Settings.
Restore
You need the repo and your backup folder.
- 01Stop the stack.
docker compose -f deploy/docker-compose.yml down - 02Restore the latest snapshot. This checks the snapshot, replaces the database and copies back any missing images.
docker compose -f deploy/docker-compose.yml run --rm --no-deps backup restore -yes -snapshot latest - 03Start again and check.
make up curl localhost:8080/healthz
Phones and tokens keep working after a restore, because they are stored in the database.
To go back after a failed update, use the pre-migrate copy instead. The steps are in the restore guide.