Skip to content
docs
DonateOperator Pass

Self-hostingGuides

Edit on GitHub

Backup and restore

A Fluxer backup is one file with everything your instance needs to start again somewhere else. It restores into any way of running Fluxer, which is also how you move an instance to another machine or from Docker to systemd.

The .tar.zst file has the database, uploads, search index and settings, and the passwords and keys Fluxer made on its first start.

Fluxer also backs up by itself before it starts a newer release on older data. That backup has the database, passwords and keys but not uploads, and Fluxer keeps the newest 3.

docker exec fluxer fluxerd backup --out - > fluxer-$(date +%F).tar.zst

With the compose file, the command is docker compose exec -T fluxer fluxerd backup --out - > fluxer-$(date +%F).tar.zst.

Fluxer shows a maintenance page while it copies uploads and the search index, and stays up the rest of the time. When a backup is already running, a second one stops with "another backup or restore of this instance is running".

Set these and Fluxer backs itself up into the backups folder of its data folder.

fluxer.env
FLUXER_BACKUP_SCHEDULE=daily
FLUXER_BACKUP_KEEP=7
FLUXER_BACKUP_HOUR=3
SettingHelm valueWhat it doesDefault
FLUXER_BACKUP_SCHEDULEbackup.scheduleHow often to back up, as daily, weekly or offoff
FLUXER_BACKUP_HOURbackup.hourThe hour it starts, from 0 to 233
FLUXER_BACKUP_KEEPbackup.keepHow many scheduled backups to keep before deleting the oldest7

The hour is in the machine's time zone, which is UTC in the container image.

With rexctl, rexctl backup schedule daily sets up the schedule.

With rexctl on Linux, a systemd timer or cron job runs the backup at about 03:00. On Docker Desktop, rexctl sets FLUXER_BACKUP_SCHEDULE and Fluxer backs itself up.

A backup on the same disk doesn't help when the disk fails. Copy each backup somewhere else, such as another machine, a NAS or object storage.

rsync -a /var/lib/docker/volumes/fluxer-data/_data/backups/ backup@storage.example.org:/srv/fluxer/
rclone copy fluxer-2026-12-01.tar.zst remote:fluxer-backups

The first line copies the scheduled backups out of the Docker volume. Under systemd they are in /var/lib/fluxer/backups, which only the fluxer account can read, so run the copy as root or as the fluxer account.

A backup has every password and key of your instance, unencrypted. Encrypt each copy before it leaves the machine, for example with age, or with a tool that encrypts on its own, such as restic or an rclone crypt remote.

age -r age1examplepublickey... -o fluxer-2026-12-01.tar.zst.age fluxer-2026-12-01.tar.zst

With rexctl, this command takes your newest backup, from its own backups and the ones Fluxer makes by itself inside its container, encrypts it for your age public key and copies it over SSH. rexctl restore --age-identity key.txt restores the .age file.

rexctl backup copy-to --age-recipient age1examplepublickey... backup@storage.example.org:/srv/fluxer

A restore runs in one of two situations. Usually Fluxer is stopped and you run fluxerd restore on its data, as below. After you go back to an older release, Fluxer is running but not ready, because the data is newer than the code, and you run fluxerd restore inside the running container, pod or service to go back a version. In both cases the backup must come from the same release of Fluxer or an earlier release.

docker stop fluxer
docker run --rm -i --env-file fluxer.env -v fluxer-data:/var/lib/fluxer \
"$(docker inspect -f '{{.Config.Image}}' fluxer)" restore - < fluxer-2026-12-01.tar.zst
docker start fluxer

The restore runs on the same image as the container. With the compose file, stop it with docker compose stop, run docker compose run --rm -T fluxer restore - < fluxer-2026-12-01.tar.zst, then start it again with docker compose up -d.

fluxerd restore --check checks a backup and whether it fits the instance, without changing anything or keeping a copy. In a container the file is on the machine, so pass it on standard input, with docker exec -i fluxer fluxerd restore --check - < fluxer-2026-12-01.tar.zst, docker compose exec -T fluxer fluxerd restore --check - < fluxer-2026-12-01.tar.zst with the compose file, or podman exec -i fluxer fluxerd restore --check - < fluxer-2026-12-01.tar.zst on Podman.

If the backup's settings file differs from yours and Fluxer can't write it, such as the fluxer.env you pass to Docker, the restore leaves yours alone and tells you the path where it saved the backup's copy of the settings file.

With your own PostgreSQL in FLUXER_POSTGRES_URL, a backup has no database, and with uploads in your own S3 store, it has no uploads. Back those up with your database's and your store's own tools, at the same time as Fluxer's backup. The search index, message queue, passwords and keys always stay on Fluxer's volume and in its backups. Fluxer gets its public certificate again after a restore.

Every few months, and after big changes, test the latest off-site copy on a spare machine.

  1. On a spare machine or VM with Docker, download fluxer.env as for a Docker install. Set FLUXER_DOMAIN to your real domain, FLUXER_EDGE_MODE=proxy and FLUXER_LIVEKIT_ENABLED=false. Don't point any DNS record at it.

  2. Copy the newest backup from where you keep copies, not from the instance itself.

    If you encrypted it, decrypt it first. With age, that is this command.

    age -d -i key.txt -o fluxer-2026-12-01.tar.zst fluxer-2026-12-01.tar.zst.age
  3. Restore it into a new volume with the docker run --rm -i ... restore - line from the Docker tab above, with the same image tag as your instance runs.

  4. Start Fluxer on a Docker network without internet access. The copy has your SMTP server and push setup, so this keeps it from sending email or notifications to your users, and from asking Let's Encrypt for a certificate.

    docker network create --internal fluxer-test
    docker run -d --name fluxer --env-file fluxer.env -v fluxer-data:/var/lib/fluxer \
    --network fluxer-test ghcr.io/fluxerapp/fluxer:<your tag>
    ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' fluxer)

    Wait until docker exec fluxer fluxerd health prints ready, then check the API with your domain in place of chat.example.com. The command fails if the API isn't working. To check your messages as well, sign in through an SSH tunnel to port 8080 at the container's IP address, which is in $ip.

    curl -fsS -H "Host: chat.example.com" "http://$ip:8080/api/v1/_health"
  5. Delete the test machine and its volume, since they have every password and key. On a machine you keep, remove the container, the volume and the network with docker stop fluxer, docker rm fluxer, docker volume rm fluxer-data and docker network rm fluxer-test.