Features05 Backups

A backup only counts if it comes back.

Back up a volume by hand or on a schedule, at a fixed time and on the machine it belongs to. Every backup is compressed, read back after writing, and checked again before it restores. Encrypt it with your own password, send it to an SFTP server, an S3 bucket or WebDAV, and let Postgres, MySQL/MariaDB or MongoDB make their own dump. Bring back only the files you need, or a whole compose project at once.

Would your backup come back?Read the comic: crates packed tight and checked, a padlock of your own, and a van that leaves the building →
Fig. — A nightly dump of a Postgres database to Backblaze B2, encrypted.

What you can do

Checked after writing

A volume becomes a .tar.zst with a small .json beside it: the volume, the machine, the size and a sha256. The app reads the whole file back before it counts; a half-written one goes away.

At a fixed time

Every day or every week, at 03:00 or whenever you pick, so it does not drift. A new schedule makes its first backup straight away, and Back up now makes one in between: in the background as a task, from the schedule or from its menu in Settings.

On its own machine

A schedule runs on the machine where you made it, also while the app shows another one. The same volume on two machines gets two schedules, and their backups never clear each other out.

Keep the newest

Keep 1 to 100 per schedule; the oldest go, with their .json. And the checkup lists every volume in use without a schedule as “Never backed up”.

When the volume is busy

Skip and try again every hour, or pause its containers for a few seconds. Three skips in a row and you get a notification, so backups never stop quietly.

Encrypted with your password

With age and one password for the whole app, at least twelve characters, kept in the encrypted store of your system. Without it a backup cannot come back, so the app says to keep it somewhere else too.

Off this computer

An SFTP server, an S3 bucket (AWS, Backblaze B2, Wasabi, MinIO), WebDAV (Nextcloud, a NAS) or a registry (Harbor, GitLab, GHCR), where each backup becomes a small artifact in a repository of your choice. Written and checked here first, then uploaded; the copy here goes away.

A server you confirmed

SFTP shows the fingerprint of the server and only logs in once you trust it. If the server has another key later, the app stops before logging in, and nothing goes out.

A dump of the database

For Postgres, MySQL/MariaDB and MongoDB: consistent without pausing, with the user and password the container already has. The app never sees them.

Commands before and after

The labels of offen/docker-volume-backup work: archive-pre before the pause, archive-post once the containers run again. If archive-pre fails, there is no backup.

Checked before it restores

The whole file, its sha256, the password and what is in it, before anything stops or changes. A typo in the password costs nothing.

Three ways back

Merge into the volume, empty it first so it holds exactly the backup, or restore into a new volume to look first. Before overwriting, a backup of what is there now.

Only what you need

Open a backup, walk through its folders or search by name, and tick the files and folders you want back, also from a backup file you pick yourself. The rest of the volume stays as it is.

A project as a whole

All volumes of a compose project from the same moment, with its compose files and .env, in one folder, and a dump of each database that runs behind them. By hand, or by itself every day or week at a fixed time, to a folder or as one file to SFTP, S3 or WebDAV, keeping the newest ones. Restore project lists the backups of its schedule, also those on a server, and brings the project back as a whole, its dumps through the running database, started in the order of depends_on. Its compose files and .env go to a folder, or back over the project itself, with the current ones kept aside.

A log of every attempt

Every attempt of a schedule, automatic or with Back up now, and every backup by hand, of a volume, a dump or a whole project: when, how long, which machine, where it went and how large it is, or why it failed or was skipped. The last 500 are kept, behind the Log button in Settings; one switch shows only the problems, and the log can be cleared.

Every backup on one page

A Backups page in the sidebar: every schedule of a volume or a project, on every machine, with where the backups go, how many there are, the last one and a status, the worst first. Open a row for the backups themselves: restore one, pick files from it or remove it, on the machine you are on.

A backup from its own page

New backup… in the menu of the Backups page, and under the text while there are none yet: pick a volume or a Compose project of the machine you are on, with a filter, and then the schedule itself: when, where to, how many are kept, encrypted or not. A volume that belongs to a project says so, and what already has a schedule is marked.

Databases

The database makes its own backup.

Copying the files of a database while it writes can give a backup it cannot read itself. For Postgres, MySQL/MariaDB and MongoDB a schedule can ask the database for a dump instead, with pg_dumpall, mysqldump or mariadb-dump, or mongodump. That is consistent without pausing, and it runs with the user and password the container already has, so the app never sees them. The dump goes into the same archive as any backup: checked after writing, encrypted with your password if you like, and uploaded like the rest. Restoring goes back through the running database, after a dump of what is there now; Postgres closes the other connections first, and errors the database reports while it carries on end up in the notification.

Fig. — A dump goes back through the running database, after a dump of what is there now.

Off this computer

A backup on the same disk goes when the disk goes.

So a schedule can send its backups elsewhere: an SFTP server, an S3 bucket or WebDAV, with the password or key in the encrypted store of your system. Each backup is written and checked here first, then uploaded so that a half upload never looks like a backup, and the containers are already running again by then. The app remembers what it uploaded, with its sha256: a file on the server it did not put there is marked “not from the app” and never picked for you, and one that was replaced does not restore. Plain http only goes to your own network, and then only encrypted.

Fig. — Three destinations, one password, and two schedules that leave the computer.

Encryption

Your password, and nobody else’s.

An encrypted backup is a .tar.zst.age: tar, compressed with zstd, encrypted with age. Open formats all the way down. The app keeps one password, never shows it again, and refuses to fall back to an unencrypted backup when it cannot read it. A wrong password shows at the first bytes of the file, before anything reaches the volume. Change the password and older backups keep the old one: restoring one asks for it once, and forgets it when the dialog closes.

Fig. — An older backup asks for its own password; nothing has stopped yet.

Restore

Checked first, then put back.

Restore reads the whole backup before it touches anything: to the very end, against the sha256 in its .json, with your password, and only files under data/. A backup without its .json, from a USB stick say, still has to end the way a tar ends. Only then does the app make a backup of what is there now (the newest three per volume, encrypted if you have a password), stop the containers that use the volume, and start them again afterwards. Merge, clean, or into a new volume next to the old one: that volume gets a label of its own, so if anything fails, only the volume the app made goes away.

Fig. — Merge, clean, or a new volume next to the old one, with a backup of what is there first.

Only what you need

Two photos back, not the whole volume.

When one folder went wrong, restoring the whole volume also takes back everything that changed since. So a restore can bring back only what you choose. The app reads the list of files from the backup, an encrypted one too, and you walk through its folders, search by name, and tick files or whole folders. They go back into the volume, merged, or into a new volume to look first, after a backup of what is there now. A database dump and an emptied volume always come back whole: a part of those would make no sense.

Fig. — Two photos from last night’s backup; the rest of the volume stays as it is.

A project as a whole

The database and the uploads from the same moment.

Back up a database and its uploads one after the other, and they can come back with an order whose photo is missing. A project backup pauses all the containers of the project together, backs up every named volume, and takes the compose files and the .env along, in one folder with a project.json that lists what is in it. It can run by itself too, every day or every week at a fixed time, like a volume schedule. Restoring stops the project, puts back the volumes you choose, creates a volume that is gone with its labels so compose sees it as its own, and starts the services in the order of depends_on: the database first.

All features

Try it on your own daemon.
Free and open source. Windows installer, Linux AppImage, or npx on any platform.
Download for Windows
$ npx docker-client-mx