Your self-hosted stack is not a hobby anymore the day your partner's photo library, your parents' email archive, or the invoice database for your side business lives on it. That's the moment the question stops being "do I have backups?" and becomes "which of my services would actually survive a disk failure tonight?"
I learned that the hard way. A 4 TB drive in my Proxmox box started throwing SMART errors on a Sunday morning, and I realized my "backup strategy" was a rsync cron job that had been silently failing for eleven weeks because the destination USB drive had remounted read-only. Eleven weeks. Nothing in my setup told me. I found out because I happened to run dmesg for an unrelated reason. That's not a backup strategy; that's a lottery ticket with extra steps.
So here's what I actually run now for backup strategies for self-hosted services — per service, with real commands, real retention numbers, and the mistakes that cost me weekends.
Key Takeaways
- Back up per service, not per category. Docker volumes, SQLite files and Postgres dumps need different handling.
- Follow 3-2-1, but interpret it practically: one local copy, one off-box copy, one that leaves your house.
- Databases must be dumped, not copied. A raw
.dbcopy of a live SQLite file is a coin flip. - Set a concrete RPO per service: config daily, databases every 6-12 hours, media weekly is usually fine.
- Test restores on a schedule, not when you need them. An untested backup is a hypothesis.
- Alerting matters more than tooling. A backup that fails silently is worse than no backup, because you trust it.
Why most self-hosted backup strategies break down in practice
The failure mode is almost never "I forgot to install a backup tool." Restic, Borg, Duplicati, Kopia — they all work. The failure is that people treat their whole homelab as one blob and point a single job at /opt or /srv, then discover at restore time that half of it was inconsistent.
The three classes of data you actually have
Config and compose files change rarely and are tiny. Application data changes constantly. Databases and queues are the nasty middle child: they're stateful, they hold open file handles, and copying them live gives you a snapshot the app didn't agree to.
- Configuration:
docker-compose.yml,.env, reverse-proxy configs, TLS certs, cron files. Back up daily. Total size is usually under 50 MB. - Application data: photo libraries, document stores, media. Weekly is often enough. Size in the hundreds of GB.
- Databases and queues: Postgres, MariaDB, SQLite, Redis dumps. Every 6-12 hours for anything transactional, and always via a logical dump.
The fragile hardware problem
If your services run on a Raspberry Pi with a microSD card, you have a distinct risk profile: SD cards wear out, and there's no RAID on a single card slot. I've had two cards die in four years of running Pi-hosted services. Both times the backup saved me; neither time did the card give more than a day of warning. Move your data volume to an SSD over USB if you can, and treat the card as disposable boot media.
What a practical 3-2-1 looks like on real hardware
The classic rule — three copies, two media types, one off-site — still holds. The trick is making it cheap enough that you actually do it.
| Layer | Where | What | Retention |
|---|---|---|---|
| Local | Second disk in the same box | Restic repo, all services | 7 daily, 4 weekly |
| Off-box | NAS or another machine on LAN | Restic repo, all services | 30 daily, 12 monthly |
| Off-site | Object storage (S3-compatible, Backblaze B2, Wasabi) | Restic repo, encrypted | 12 monthly |
Real talk: the off-site layer is the one people skip, and it's the one that matters most. Fire, theft, ransomware on the LAN — a second local copy doesn't save you. Object storage costs are usually trivial for homelab volumes; a few hundred GB of incremental, deduplicated restic data typically runs a few euros a month.
Why restic kept winning for me
I tried Borg first, then Duplicati, then landed on Restic and stayed. Borg is excellent but the remote-repo setup is fiddly if you don't have SSH access to the target. Duplicati has a pleasant web UI but I hit repeated database corruption on large jobs and gave up after the second time it forced me to rebuild a repo. Restic is a single binary, deduplicates, encrypts by default, and supports nearly any backend.
A minimal daily job looks like this:
restic backup \
--exclude-caches \
--exclude '/var/lib/docker/overlay2' \
--files-from /etc/backup-paths.txt \
--tag daily
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune Add restic check --read-data-subset=5% weekly and pipe failures to your alerting. That's the piece I got wrong for years: no alerting. A backup that fails silently isn't a backup, it's a false sense of security. My rsync job failed for eleven weeks and I never knew. Restic plus a healthcheck ping has not failed silently since.
Per-service playbook: how to back up the things you actually run
This is where generic guides stop and the real work starts. Every service below is something I run or have run, with the exact approach that works.
Docker volumes: stop pretending they're files
Bind mounts and named volumes are just directories on the host, so restic handles them fine — if the container isn't writing mid-copy. For anything stateful, stop the container, copy, start it again. For stateless things like a reverse proxy, don't bother; just back up the config.
docker compose stop app
restic backup /srv/app/data --tag app-snapshot
docker compose start app Never back up /var/lib/docker/overlay2. It's redundant with your images and it'll blow up your repo size.
Self-hosted email backup: dump the database, not the raw maildir
If you run Mailcow or a similar stack, the mail itself lives on disk but the metadata (users, aliases, sieve rules, quotas) lives in MariaDB. Back up both:
docker exec mailcowdockerized-mariadb-1 \
mysqldump --single-transaction --all-databases \
| restic backup --stdin --stdin-filename mailcow.sql Then rsync or restic the vmail volume separately. Restoring email without the database means recreating every mailbox by hand. I know because I did exactly that once, for two accounts, and it took an entire evening.
Self-hosted iPhone backup: the one people forget
If you're running something like Immich or a Nextcloud instance to hold phone photos, remember the phone itself may be the only copy of recent shots. Immich's own backup covers the library, but the database holds the face-recognition and album metadata — and losing that means re-running the ML job, which on a modest box takes hours. Dump Postgres on a schedule, and verify the photo volume is included in your restic paths. Same logic for Vaultwarden: back up db.sqlite3 and rsa_key.* together, or you restore a vault nobody can decrypt.
Home Assistant and n8n
Home Assistant has a built-in snapshot feature — use it, but don't rely on it alone. Snapshot the /config volume with restic too, and include the SQLite recorder database via a .dump if you care about history. For n8n, the workflow definitions and credentials are in Postgres or SQLite; a plain file copy while it's running risks an inconsistent state.
What is a realistic retention policy?
Seven daily, four weekly, twelve monthly covers most homelab needs. That's enough to roll back a bad update from last week and enough to recover a file you deleted three months ago. Anything older than a year is almost never worth the storage.
The only test that matters: can you restore?
An untested backup is a hypothesis. Mine failed the test the first time I tried a full restore — the restic repo was fine, but I had never recorded the encryption password anywhere outside the machine being restored. One disk failure and my backup would have been an encrypted brick.
So now: password in a password manager, plus a printed copy in a drawer. Once a quarter I restore one service end-to-end to a spare VM, and I time it. My Home Assistant restore takes about 12 minutes; the photo library takes a few hours. Knowing that number is what lets you sleep.
What to do this weekend
Pick one service — the one whose loss would actually hurt — and back it up to a machine that isn't the one it runs on. Then restore it somewhere else and confirm it works. That single loop, run honestly once, teaches you more than any tooling comparison. Everything else is scaling the same idea across the rest of your stack, with alerting bolted on so the next silent failure finds you before it finds your data.