Operate
Back up and restore
Back up your .env secrets, Postgres database, and SeaweedFS uploads, and restore dimmi onto a fresh server.
A complete dimmi backup has three pieces: /opt/dimmi/.env, a Postgres dump, and the uploaded files volume. Store all three off the server.
What to back up
Section titled “What to back up”| Asset | Source | Suggested schedule |
|---|---|---|
| Config and secrets | /opt/dimmi/.env |
Once, and after every dimmictl set |
| Database | pg_dump of dimmi |
Daily, and before every upgrade |
| Uploaded files | Docker volume dimmi_seaweedfs |
Daily |
Keep /opt/dimmi/.env safe: it holds DIMMI_APP__KEY (required to decrypt database secrets) plus your database and storage passwords. Valkey stores only cache, rate limits, and realtime messages, so it does not need backups.
Create a database dump:
docker compose -f /opt/dimmi/compose.yaml exec -T postgres \ pg_dump -U postgres -Fc dimmi > dimmi-$(date +%F).dumpArchive uploaded files:
tar -czf dimmi-files-$(date +%F).tar.gz \ -C /var/lib/docker/volumes/dimmi_seaweedfs/_data .Restore onto a fresh server
Section titled “Restore onto a fresh server”-
Copy your backed-up
.envto/opt/dimmi/.envon the new server. -
Run the installer pinned to the exact release from your old
/opt/dimmi/VERSION(prefixed withv, likev1.2.3). It preserves your.envso Postgres and SeaweedFS initialize with your existing passwords andDIMMI_APP__KEY:Terminal window curl -fsSL https://github.com/dimmihq/dimmi/releases/download/<version>/install.sh \| bash -s -- --version <version> --domain support.example.com --email ops@example.com -
Stop the stack and restore the file archive:
Terminal window docker compose -f /opt/dimmi/compose.yaml stoptar -xzf dimmi-files-<date>.tar.gz -C /var/lib/docker/volumes/dimmi_seaweedfs/_data -
Start Postgres alone and restore the database dump:
Terminal window docker compose -f /opt/dimmi/compose.yaml start postgresdocker compose -f /opt/dimmi/compose.yaml exec -T postgres \pg_restore -U postgres -d dimmi --clean < dimmi-<date>.dump -
Bring the full stack back online:
Terminal window dimmictl start