What to keep
A backup has two parts:
- The database. It keeps workflows, runs, users and credentials.
- The
.envfile. It keepsZERODOT_SECRET_KEYandBETTER_AUTH_SECRET. Without the sameZERODOT_SECRET_KEY, nobody can open the saved credentials.
Also keep the blob folder if you use one (files and large node outputs). Docker mode keeps blobs in the volume blob-data. Native mode keeps them in /var/lib/NAME/blobs. An S3 bucket has its own backups.
The Valkey queue holds jobs that wait or run now. You do not need to back it up.
Automatic backups
The install script can back up the database and .env each day or each week:
sudo bash install.sh zerodot.example.com --backup daily
The backups go to /var/backups/NAME (macOS: ~/NAME-backups). The script keeps the newest 14. To change this, use --backup-dir PATH and --backup-keep N. To make a backup now, run zerodot backup (see zerodot CLI), or run sudo /usr/local/sbin/NAME-backup (macOS: ~/.zerodot/NAME-backup.sh). See Backups and automatic updates.
The automatic backup does not include the blobs. Back them up as shown below.
Back up the database
When install.sh sets up the install with Zerodot's Postgres, run zerodot backup. See zerodot CLI.
Docker mode, Postgres container:
cd /var/www/zerodot
docker compose exec -T postgres pg_dump -U zerodot zerodot | gzip > zerodot-$(date +%F).sql.gz
Docker mode, Postgres on the server or managed:
cd /var/www/zerodot
pg_dump "$(grep '^DATABASE_URL=' .env | cut -d= -f2- | sed 's/host.docker.internal/127.0.0.1/')" | gzip > zerodot-$(date +%F).sql.gz
Native mode:
sudo runuser -u postgres -- pg_dump zerodot | gzip > zerodot-$(date +%F).sql.gz
Use the database name of your instance. For the instance zerodot-staging, the name is zerodot_staging.
Back up the blobs (Docker mode):
cd /var/www/zerodot
docker compose run --rm --no-deps -T --entrypoint tar web czf - -C /blobs . > blobs-$(date +%F).tar.gz
Back up the blobs (native mode):
sudo tar czf blobs-$(date +%F).tar.gz -C /var/lib/zerodot/blobs .
Keep the backups on another server.
Restore on a new server
When install.sh sets up the install with Zerodot's Postgres, copy your secrets and run zerodot restore. See zerodot CLI. Or follow these steps by hand:
Install Zerodot on the new server with the same mode.
Stop the app.
Docker mode:
cd /var/www/zerodot docker compose stop web api workerNative mode:
sudo systemctl stop zerodot-web zerodot-api zerodot-workerCopy
ZERODOT_SECRET_KEYandBETTER_AUTH_SECRETfrom the old.envto the new.env. Do not change the other values: the new database password is in the new.env.Load the database dump. Docker mode:
docker compose exec -T postgres psql -U zerodot -d zerodot -c 'drop schema public cascade; create schema public;' gunzip -c zerodot-2026-01-01.sql.gz | docker compose exec -T postgres psql -U zerodot -d zerodotNative mode:
sudo runuser -u postgres -- psql -d zerodot -c 'drop schema public cascade; create schema public authorization zerodot;' gunzip -c zerodot-2026-01-01.sql.gz | sudo runuser -u postgres -- psql -d zerodotStart the app.
Docker mode:
docker compose up -dNative mode:
sudo systemctl start zerodot-web zerodot-api zerodot-worker
The
drop schemacommand deletes all data in the new database. Run it only on the new server.
Move the database from the container to the server
The installer does not move data between a container and the server. Do these steps by hand.
Dump the database from the container:
cd /var/www/zerodot docker compose exec -T postgres pg_dump --no-owner --no-acl -U zerodot zerodot > zerodot.sql--no-ownerand--no-aclleave out the owner and the grants of the container user. The new user then owns all tables.Stop the app:
docker compose stop web api workerMake a user and a database on the server. Use a name that is not used:
sudo -u postgres createuser -P zerodot_app sudo -u postgres createdb -O zerodot_app zerodot_appcreateuser -Pasks for a password.Load the dump as the new user:
psql -h 127.0.0.1 -U zerodot_app zerodot_app < zerodot.sqlOn Fedora and RHEL, a TCP login can fail with
ident. Add apg_hba.confline for the user first. See Databases.Open
.zerodot-installin the install folder. ChangePG_MODE=dockertoPG_MODE=host.Run the script with the new database:
sudo DATABASE_URL='postgres://zerodot_app:<password>@127.0.0.1:5432/zerodot_app' \ bash scripts/install.sh --updateThe script changes
127.0.0.1tohost.docker.internal. It asks to let the containers reach Postgres. See Postgres and Valkey on the server.The script stops the old Postgres container of the install. It keeps the volume
postgres-data, and writes the change to/var/log/zerodot-install.log.
The volume postgres-data stays. Delete it only when you are sure that you do not need it.
To move Valkey, you do not move data. Change RD_MODE=docker to RD_MODE=host in .zerodot-install. Run the script with VALKEY_URL. The script stops the old Valkey container. Jobs that wait in the old queue are lost. Do it when no runs are active.
Move the database from the server to the container
Dump the database on the server with
pg_dump --no-owner --no-acl.Change
PG_MODE=hosttoPG_MODE=dockerin.zerodot-install.Remove the
DATABASE_URLline from.env.Run the script with
--update. It starts the Postgres container and the app.Stop the app:
cd /var/www/zerodot docker compose stop web api workerEmpty the new database, then load the dump:
docker compose exec -T postgres psql -U zerodot -d zerodot -c 'drop schema public cascade; create schema public;' docker compose exec -T postgres psql -U zerodot -d zerodot < zerodot.sqlStart the app:
docker compose up -d