Backups and upgrades
Everything the Axiom server knows lives in one Docker volume. This page explains what to back up, a nightly backup job, how to restore, and how to upgrade the server, the companion tools and the gateway safely.
What to back up
Back up the server's data volume, mounted at /data in the axiom-server container. It holds:
- every account, with password hashes, two-factor secrets, teams and tool access;
- every shared investigation, including the search results in it;
- live sessions (
sessions.json— keyed by a hash of each token, never the token itself); - the audit log and its head record;
- the XSIAM settings and the organization's XSIAM key, if configured;
- single sign-on registrations, and the email settings with the mail server password and the sign-up requests, if configured;
- the server's own certificate and private key;
- published app releases.
Warning: Treat backups like the volume itself. Session tokens are stored only as hashes, which nothing can sign in with, but the password hashes, two-factor secrets, the TLS private key, the XSIAM key and the mail server password are all in there as plain text — and a backup taken before the server started hashing session tokens still holds raw tokens, so treat old backups as live credentials. Encrypt backups, restrict who can read them, and ship copies off the host.
The gateway's axiom-caddy-data volume holds its certificates and Let's Encrypt account. Caddy re-issues certificates if it's lost, so backing it up is optional.
Find the volume name
Compose names the volume after the project folder, for example axiomsearch-server_axiom-data. If the folder is moved or renamed, the server starts on a new, empty volume. Always look up the volume the running server actually uses:
docker inspect -f '{{range .Mounts}}{{if eq .Destination "/data"}}{{.Name}}{{end}}{{end}}' axiom-server
Never pass docker run -v a volume name you haven't checked: a name that doesn't exist is silently created empty, and backing that up nightly protects nothing.
A nightly backup job
You can back up while the server runs. Data files are replaced atomically and the audit log is only appended to, so a live copy is consistent.
The archive is a plaintext copy of everything in the volume — password hashes and two-factor secrets, the TLS private key, the XSIAM key and the mail password; session tokens appear only as hashes, though archives from before the hashing change still hold raw tokens — so it is encrypted as it is written, and only the encrypted file is kept or copied anywhere. One-time setup: put a long random passphrase in a root-only file, for example /etc/axiom-backup.passphrase (chmod 600), and keep a copy of the passphrase in the team's password manager — an encrypted backup whose only passphrase died with the host restores nothing. If age is installed you can use it instead of gpg (a key file instead of a passphrase, handled the same way).
Save this as a script, for example /usr/local/sbin/axiom-backup.sh, readable only by the administrator who runs it:
#!/bin/sh
set -eu
umask 077
VOL=$(docker inspect -f '{{range .Mounts}}{{if eq .Destination "/data"}}{{.Name}}{{end}}{{end}}' axiom-server)
[ -n "$VOL" ] || { echo "axiom-server has no /data volume" >&2; exit 1; }
OUT="/var/backups/axiom/axiom-$(date +%F).tar.gz.gpg"
docker run --rm -v "$VOL":/data:ro alpine tar czf - -C /data . |
gpg --batch --yes --symmetric --cipher-algo AES256 \
--passphrase-file /etc/axiom-backup.passphrase -o "$OUT"
chmod 600 "$OUT"
find /var/backups/axiom -name 'axiom-*.tar.gz.gpg' -mtime +30 -delete
Run it nightly from that user's crontab (the user must be in the docker group), sending output to a log so a failed run leaves a trace:
15 2 * * * /usr/local/sbin/axiom-backup.sh >> /var/backups/axiom/backup.log 2>&1
Keep the commands in the script rather than the crontab line: cron turns every unescaped % into a newline, which breaks $(date +%F). The find line keeps 30 days of archives. Ship only the encrypted .gpg files off the host, and delete any plaintext archives an older script left behind.
Check that a fresh archive decrypts and holds real data:
gpg --batch --passphrase-file /etc/axiom-backup.passphrase \
-d "/var/backups/axiom/axiom-$(date +%F).tar.gz.gpg" | tar tzf - | head
It should list ./users.json and ./investigations/.
Tip: Test a restore at least once a quarter, on a spare host or a scratch volume. A backup that has never been restored is a hope, not a backup.
Restoring
Restore into a stopped server. Note the volume name first (see above), because the lookup needs the running container. Decrypt the archive with the same passphrase file, replace the volume's contents, give the files back to the server's user (UID 1000), and remove the plaintext copy:
gpg --batch --passphrase-file /etc/axiom-backup.passphrase \
-d /var/backups/axiom/axiom-2026-10-19.tar.gz.gpg > /var/backups/axiom/axiom-restore.tar.gz
docker run --rm -v axiomsearch-server_axiom-data:/data -v /var/backups/axiom:/backup alpine \
sh -c 'rm -rf /data/* && tar xzf /backup/axiom-restore.tar.gz -C /data && chown -R 1000:1000 /data'
rm /var/backups/axiom/axiom-restore.tar.gz
- Stop the server with
docker compose downin the server folder. Don't add-v. - Run the commands above, with your volume name and archive.
- Start the server again with
docker compose up -d. - If the restored certificate differs from the one the server was just serving, restart the gateway too (
docker compose restartin thecaddyfolder), so it re-reads the exported copy it verifies against. See Gateway and certificates. - Run Verify integrity on the admin page (Security → Audit log) to confirm the audit log came back intact.
A restore brings back every session in the archive that hasn't expired, and the XSIAM key it held. To sign everyone out after a restore or a leaked backup, delete sessions.json while the server is stopped; deleting it while the server runs doesn't help, because the server rewrites it from memory. If the XSIAM key in a leaked backup is still valid, revoke it in the Cortex console and enter a new one.
The archive includes the server's private key, so a restored server keeps its certificate fingerprint and analysts in IP-only deployments don't need to re-pin.
Never casually: docker compose down -v
Warning: docker compose down -v in the server folder deletes the data volume: every account, every shared case and the audit log. It also discards the server's certificate, so a new one with a new fingerprint is generated on the next start and analysts in IP-only deployments must re-pin. Use plain docker compose down to stop the server.
Upgrading the server
Upgrade the server first, then the companions, then the gateway, the same order as a fresh deployment. Sessions are saved in the volume, so upgrading signs nobody out.
- Update the server source folder to the new version. If you use git,
git pullmust end in "Fast-forward" or "Already up to date"; if it stops because of local changes, nothing was updated, and building would just rebuild the old version. - Rebuild and restart the server with
docker compose up -d --build. The--buildmatters, because the code is baked into the image. - Update the companions from the
companionsfolder withdocker compose pull, thendocker compose up -d. - If the gateway's files changed, recreate it from the
caddyfolder withdocker compose up -d --force-recreate. To pick up a newer Caddy image, rundocker compose pullthere first. - Check the result:
docker psshould show 8480 onaxiom-gatewayand no ports onaxiom-server, andcurl https://axiom.example.com:8480/api/health(no-k) should return"status":"ok".
The build compiles Go from source and can take a few minutes on a small host. See Troubleshooting if it runs out of memory.
Upgrade the desktop app and the server together. Shared cases are stored in the app's own format, and an older server can drop fields a newer app sends. Publish the matching app build to analysts through App releases.