Backup and restore
One command copies everything Skirl knows into one file, while the server keeps running. Keep that file somewhere other than the server. To go back to it, stop the server and restore it.
Making a backup#
On a machine with the program installed:
skirl backup --with-attachments /var/backups/skirl-2026-12-01.tar.gzBacked up the database (schema 13) and 3 attachment files to /var/backups/skirl-2026-12-01.tar.gz.
It holds the password hashes, the hashed tokens and the push keys: keep it as safe as the data directory.Without --with-attachments it copies only the database, into a file of its own (name it .db). The copy is right even while messages arrive: the database is copied in one go, before the files. The backup is readable only by the user who made it, and a file that exists already is never overwritten: give each backup a new name.
In Docker#
The image has no shell, so this takes three steps: make the backup inside the container's volume, copy it out to the folder you are in, then remove it from the volume.
docker exec skirl /skirl backup --data-dir /data --with-attachments /data/skirl-backup.tar.gzdocker cp skirl:/data/skirl-backup.tar.gz ./skirl-2026-12-01.tar.gzdocker run --rm --volumes-from skirl busybox:1.37 rm /data/skirl-backup.tar.gzThe last one starts a tiny container that only deletes that file. These work the same for a container started with Docker Compose by the install guide, which is also called skirl.
With systemd#
Run it as the service's user. Once, make a folder that user may write to:
sudo install -d -o skirl -g skirl -m 0700 /var/backups/skirlThen:
sudo -u skirl skirl backup --data-dir /var/lib/skirl --with-attachments /var/backups/skirl/skirl-2026-12-01.tar.gzEvery night#
With the systemd service, a file /etc/cron.d/skirl-backup holding this line makes one at a quarter past three every night, named by the date:
15 3 * * * skirl /usr/local/bin/skirl backup --data-dir /var/lib/skirl --with-attachments /var/backups/skirl/skirl-$(date +\%F).tar.gzEach night adds a file: remove old ones yourself, and copy them off the machine. In Docker, put the three commands above in a script and run that from cron instead.
What a backup holds#
- The whole database: people and their roles, tokens, topics and who may use them, the messages the topics still keep with what each person has read, the phones and browsers that get notifications, the delivery log, your templates, every setting, and the server's push keys. Everything in it, one by one: In the database.
- With
--with-attachments, also the files people sent with messages.
It holds passwords and tokens only as hashes, never as they were typed. Still, anyone who has the backup could try to guess weak passwords from their hashes, and with the push keys could send notifications to the phones and browsers in it. It also holds any webhook bodies a topic caught while someone was listening for a real message, and those can hold secrets. Keep it where only you can read it, as you would the server itself.
Without the attachments#
A backup of only the database brings back everything but the files. Their messages still show the file's name, and opening the file answers "page not found". Files are kept only for a while anyway (Keep files for, a week unless changed), so such a backup loses at most the files of that last stretch.
Without a backup#
If the data directory is lost and there is no backup, everything in it is gone: people, topics, messages and settings. A new server makes new push keys, so every phone and browser has to turn notifications on again.
Restoring#
The server must be stopped: restore refuses while one is using the data directory ("stop the server before restoring"). It puts the backup into an empty data directory; for one that has data, add --force, and it replaces the database, and from an archive the files too.
Before it touches anything, it checks the backup (SQLite's own check that the file is sound) and that it is from this version of Skirl or an older one.
Restored the database and 3 attachment files (schema 13) into /var/lib/skirl. Start the server on it: skirl serve --data-dir /var/lib/skirlRestoring in Docker#
Stop the container; its volume stays:
docker stop skirlOn Linux, the container's user (number 65532) must be able to read the backup. Give it the file:
sudo chown 65532:65532 skirl-2026-12-01.tar.gzThen, in the folder that holds the backup, restore it into the stopped container's volume with a one-off container, and start Skirl again. The command hands the container the file alone, not the folder, so it works in a folder only you may open, such as your home folder on Ubuntu:
docker run --rm --volumes-from skirl --entrypoint /skirl -v "$PWD/skirl-2026-12-01.tar.gz":/restore/skirl-2026-12-01.tar.gz:ro ghcr.io/homelabza/skirl:1 restore --force --data-dir /data /restore/skirl-2026-12-01.tar.gzdocker start skirlSkirl's tests follow these steps, and the backup steps in Docker above, on Linux as written.
Restoring with systemd#
sudo systemctl stop skirlsudo -u skirl skirl restore --force --data-dir /var/lib/skirl /var/backups/skirl/skirl-2026-12-01.tar.gzsudo systemctl start skirlThe service's user must be able to read the backup: one it made itself, it can. Give it one that came from elsewhere:
sudo chown skirl:skirl /var/backups/skirl/skirl-2026-12-01.tar.gzA backup from another version#
A backup from an older Skirl is fine: the server brings it up to date when it starts, after copying it (What happens to the database). One from a newer Skirl is refused ("a newer release of skirl has used it"): restore it with that version or a newer one.
The copies Skirl makes by itself before each upgrade (in backups/ in the data directory) are backups of the database too, and restore the same way: Going back.
Moving to another machine#
- On the new machine, install Skirl with the install guide up to the step that starts it. Do not create an admin there: everything comes from the backup.
- On the old machine, make a backup with
--with-attachments, and stop the old server straight after: what arrives there after the backup would be lost. - Copy the backup to the new machine, restore it there with
--forceas above, and start Skirl. - Point the server's name (
notify.example.com) at the new machine.
Keep the same address. Everything people have points at it: the app on their Home Screen, links in old notifications, and every script and tool that sends. The address, the people and every setting come with the backup; what you set in .env or the service (such as SKIRL_BASE_URL) does not, so set it again on the new machine.
Checking a backup#
To see that a backup is sound without touching the server, restore it into a new, empty folder: that runs the same checks, then shows what is in it.
skirl restore --data-dir /tmp/skirl-check /var/backups/skirl-2026-12-01.tar.gzskirl user list --data-dir /tmp/skirl-checkThen delete that folder. Do not start a server on it while the real one runs: it has the same push keys and devices, so it would send scheduled messages to the same phones too.
In Docker, the same check in a one-off container, from the folder that holds the backup (on Linux, after giving it to 65532 as for restoring); the copy goes with the container:
docker run --rm --entrypoint /skirl -v "$PWD/skirl-2026-12-01.tar.gz":/restore/skirl-2026-12-01.tar.gz:ro ghcr.io/homelabza/skirl:1 restore --data-dir /tmp/skirl-check /restore/skirl-2026-12-01.tar.gzA damaged file is refused with what is wrong, such as "is neither a Skirl database nor a skirl backup archive" or "failed SQLite's integrity check".
The data directory#
Everything Skirl keeps is in one folder, its data directory: /data in the Docker image (the container's volume), /var/lib/skirl with the systemd service, and ./data in the folder skirl serve was started in otherwise. What each file in it holds: The data directory.
Copying the folder while the server runs can miss the newest changes, which are still in skirl.db-wal beside the database: use skirl backup instead.