Skip to the content
OwnWing

DocsRun it

Backup and restore

An OwnWing install has two kinds of data, and they are backed up differently:

Where How
The apps’ own state: people and passkeys, catalogues, databases, secrets, certificates OWNWING_DATA ./ownwing backup
People’s files: photos, documents, everything in their drive OWNWING_USERS your own backup tool, as for any folder

./ownwing backup

./ownwing backup                  # into ./backups
./ownwing backup /mnt/backup      # or any folder

Each run makes a new folder, ownwing-<date>-<time>, readable only by you, with:

File What
env your .env
compose.extensions.yaml the extensions you added, if any
secrets.tar.gz every secret, including OwnWing ID’s signing key
id.tar.gz OwnWing ID: people, passkeys, apps, the audit log
sqlite/ Photos’ and Files’ databases, copied with SQLite’s own backup (safe while the apps run)
extensions.tar.gz the extensions’ own data, but the folders their manifest’s backup.skip names
extensions/<id>.dump.gz an extension’s database, dumped with its manifest’s backup.dump, when it has one
caddy.tar.gz Caddy’s certificates and the local CA (so devices that trust it keep working)
MANIFEST.txt when, which install, and the list of files

An extension whose database can’t be copied file by file while it runs (Postgres, say) says in its manifest how to dump it: backup names its compose service, a dump command that prints the dump, a restore command that reads it back, and the folders to skip (the database’s own files). Backup runs docker compose exec -T <service> sh -c "<dump>" and gzips what it prints (Build an OwnWing extension).

Not in it: thumbnails and other caches (the apps rebuild them), Photos’ models (download or rebuild them again), the images (rebuilt from the source) and people’s files.

The backup holds every secret: keep it as private as the server itself. It needs sqlite3 or python3 on the machine.

People’s files

Back up OWNWING_USERS with whatever you trust for big folders: snapshots on a Btrfs or ZFS NAS, restic, borg, rsync to another disk. If your filesystem snapshots the share (Btrfs, ZFS), show the snapshots to Files with FILES_SNAPSHOTS_DIR (configuration.md) and each folder’s details list its earlier days, one tap to bring a day back; without it, that feature is off. It includes Photos’ trash and kept originals (<users>/.ownwing/photos) and each extension’s per-person folder (<users>/<username>/<its folder>).

Keep a copy elsewhere

A backup on the same disk doesn’t survive that disk. Copy the backup folders (and people’s files) to another machine, an external drive or an encrypted cloud store, and test a restore now and then.

./ownwing restore

./ownwing restore backups/ownwing-2026-12-01-031500

It asks before it does anything (--yes after the folder skips the question), then:

  1. stops the stack;
  2. moves what is there now aside, to <data>/before-restore-<date> (secrets, OwnWing ID, the extensions’ data and each database it replaces);
  3. puts back the secrets, OwnWing ID, the databases, the extensions’ data and Caddy’s certificates; for an extension with a dump (and in the stack), it starts its backup.service and pipes the dump into its backup.restore command;
  4. derives OWNWING_ID_PUBLIC_KEY again from the restored signing key;
  5. runs ./ownwing up.

Once everything works, you can delete the before-restore-… folder.

It doesn’t restore .env or the list of extensions: compare them with the backup’s env and compose.extensions.yaml and copy what you need first.

Moving to a new machine

  1. On the old one: ./ownwing backup, and copy people’s files.
  2. On the new one: clone the repo, run ./ownwing init with the same domain and with folders where you put people’s files, then ./ownwing restore <the backup folder>.
  3. Point the names (DNS) at the new machine.

Because the secrets and Caddy’s CA come back too, devices that trusted the old install’s certificates trust the new one, and the apps keep accepting OwnWing ID’s tokens.

Edit this page on GitHub