The 3-2-1 Backup Strategy for Your Home Server (Explained Simply)
One disk failure away from losing everything? Learn the 3-2-1 rule and set it up on your home server with restic, a local drive and cheap offsite storage.
On this page
- The rule: 3 copies, 2 media, 1 offsite
- What to back up (and what to skip)
- The tool: restic
- Copy 2: a local backup drive
- Copy 3: offsite, encrypted, automatic
- Automate it (or it won’t happen)
- Troubleshooting common backup errors
- The step everyone skips: test the restore
- The classic mistakes, so you skip them
- The weekend checklist
Here’s the most predictable disaster in home computing, and it isn’t a hack: it’s a perfectly healthy-looking SSD that dies on a Tuesday afternoon. Not with a bang — just a server that boots to a black screen, and a photo library, a Nextcloud install and three years of documents that exist in exactly one place.
If you take one thing from this entire site, take this: a home server without backups is a data-loss machine with a countdown timer. Everything else — Docker, Jellyfin, Immich — is replaceable in an evening. Your data isn’t.
The good news: the industry-standard answer is a simple rule you can implement this week for the price of a coffee or two per month. On my own server, I separate replaceable media (movies and TV on a 2 TB drive) from irreplaceable family photos and Docker configs — those critical folders are the ones that get real, multi-copy protection.
The rule: 3 copies, 2 media, 1 offsite
- 3 copies of your data: the live copy, plus two backups.
- 2 different media types: for example, your server’s internal drive and an external USB hard drive. (A NAS with separate drives counts; two partitions on the same disk do not.)
- 1 copy offsite: somewhere that survives fire, theft, flood or ransomware — typically encrypted cloud storage or a drive at a relative’s house.
That’s it. Those three requirements cover the realistic failure modes almost completely:
| Failure | Live copy | Local backup | Offsite backup |
|---|---|---|---|
| Disk dies | gone | saves you | saves you |
| Accidental delete | gone | saves you (versioned) | saves you |
| Ransomware | gone | maybe compromised | saves you |
| Fire / theft | gone | gone | saves you |
What to back up (and what to skip)
Critical — irreplaceable:
- Photo and video libraries (
immichupload folders, camera imports) - Documents and file sync data (your Nextcloud
datafolder) - Database dumps — databases must be exported, not copied raw: a running database’s files change mid-copy and a raw copy may fail to start on restore
- Configuration — your
docker-compose.ymlfiles,.envfiles (which hold your secrets), and app config folders. These take megabytes and save entire weekends.
Skip — re-creatable: movies and shows, container images, thumbnail caches, anything you can re-download. Keeping movies out of your offsite backup is the difference between a $3/month bill and a $30/month bill.
The tool: restic
Restic is the tool this guide is built around, and it earns the pick:
- Encrypted by default — the cloud provider can never read your data
- Deduplicated and incremental — the second backup of the same photo library uploads only new or changed blocks
- Versioned — the
forgetcommand prunes old snapshots on your schedule, not the vendor’s - Speaks S3, Backblaze B2, SFTP, and plain folders — one tool, local and offsite
Install it on your server:
sudo apt install -y resticCopy 2: a local backup drive
Plug in a USB drive (or mount your NAS). Create the repository — this is where encrypted snapshots live:
# One-time setup: create the repo and choose a strong passwordexport RESTIC_REPOSITORY=/mnt/backup-drive/resticexport RESTIC_PASSWORD='a-strong-passphrase-you-will-never-lose'
restic initWarning
If you lose the restic password, the data is gone — that is the point of encryption. Store the passphrase in your password manager (or generate a high-entropy passphrase) AND write a copy on paper somewhere safe before continuing.Export database dumps first (example for the Nextcloud PostgreSQL container from our guide):
mkdir -p ~/backups/dbdocker exec nextcloud-db pg_dump -U nextcloud nextcloud > ~/backups/db/nextcloud-$(date +%F).sqlThen run the first backup — this one copies everything and takes the longest:
restic backup \ ~/nextcloud/data \ ~/nextcloud/docker-compose.yml ~/nextcloud/.env \ ~/backups/db \ --exclude '*.tmp'On a ~150 GB photo and document library over USB 3.0, the initial snapshot typically takes 25–40 minutes. Run the exact same restic backup command immediately afterwards and it finishes in under 15 seconds, uploading 0 bytes of unchanged files because restic only writes new chunks.
Copy 3: offsite, encrypted, automatic
Create a Backblaze B2 account, make a private bucket, and generate an application key. Then initialize and push to the offsite repo:
export RESTIC_REPOSITORY=b2:your-bucket-name:/home-serverexport B2_ACCOUNT_ID=your-key-idexport B2_ACCOUNT_KEY=your-application-key
restic initrestic backup ~/nextcloud/data ~/backups/db --exclude '*.tmp'The same two commands you already know, pointed at a different repository. Restic chunks, compresses and encrypts everything locally before it leaves your house; B2 stores opaque blocks it cannot read.
Retention policy — don’t keep every snapshot forever. This keeps 7 daily, 4 weekly and 12 monthly snapshots, then prunes unreferenced data:
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --pruneAutomate it (or it won’t happen)
Manual backups stop happening in week three. A cron job makes it permanent. Create a small script and schedule it (use our crontab translator if you want to verify your schedule before saving):
nano ~/backup.sh#!/bin/bashset -euo pipefail
export RESTIC_PASSWORD="$(cat ~/.restic-password)"export B2_ACCOUNT_ID="your-key-id"export B2_ACCOUNT_KEY="your-application-key"
# 1. Dump databasesdocker exec nextcloud-db pg_dump -U nextcloud nextcloud > ~/backups/db/nextcloud-$(date +%F).sql
# 2. Local backuprestic -r /mnt/backup-drive/restic backup ~/nextcloud/data ~/backups/db ~/nextcloud/.env
# 3. Offsite backuprestic -r b2:your-bucket-name:/home-server backup ~/nextcloud/data ~/backups/db
# 4. Retentionrestic -r /mnt/backup-drive/restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prunerestic -r b2:your-bucket-name:/home-server forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --pruneLock down permissions with chmod 700 and 600 so other local users cannot read your B2 keys or restic passphrase:
chmod 700 ~/backup.shchmod 600 ~/.restic-password # readable only by your user
# Run it every night at 3:30 AMcrontab -e# add this line:# 30 3 * * * /home/YOURUSER/backup.sh >> /home/YOURUSER/backup.log 2>&1Know when it fails
Silent backup scripts fail silently for months. Point the script at a free uptime service like healthchecks.io — a singlecurl -fsS --retry 3 https://hc-ping.com/YOUR-UUID at the end of backup.sh — and you’ll get an alert if a nightly run doesn’t happen.Troubleshooting common backup errors
repository is already locked: happens if a previous backup was interrupted mid-run (for example, a power cut). Confirm noresticprocess is still running withps aux | grep restic, then runrestic unlock.- External USB drive didn’t mount after reboot: if
/mnt/backup-driveisn’t mounted, restic could write into the empty mount directory on your root SSD and fill it up. Addmountpoint -q /mnt/backup-drive || exit 1right before step 2 inbackup.shand mount the drive by UUID in/etc/fstabwithnofail. permission deniedon Docker appdata: containers often create files owned byrootor another UID. Run the backup script asroot(viasudo crontab -e) or ensure containerPUID/PGIDmatches your backup user.
The step everyone skips: test the restore
A backup you have never restored is a hypothesis. Prove it quarterly:
# List what you haverestic snapshots
# Restore the latest snapshot of one folder to a scratch directoryrestic restore latest --target /tmp/restore-test --include ~/nextcloud/data/Documents
# Open a file from /tmp/restore-test and confirm it's intactA quick restore of a ~200 MB folder over USB takes under 15 seconds and immediately verifies both your repository integrity and that you actually have the working password. Do not skip this check.
The classic mistakes, so you skip them
- RAID as a backup. RAID mirrors your mistakes in real time. Check our RAID calculator to see how redundancy affects capacity, then still keep separate backups.
- A sync service as a backup. Delete a file in Dropbox and the deletion syncs everywhere. That’s sync, not versioned backup (restic’s snapshots are).
- Both copies in the same room. Floods, surges and burglars don’t respect your local redundancy. That’s what B2 or an offsite drive is for.
- Never restoring. If it’s testing day and you’re tempted to skip it — that’s the day you need it most.
- One giant restic run of everything, no excludes. Movies don’t need cloud backups. Exclude aggressively; keep your repository lean and cheap.
The weekend checklist
- Plug in an external drive — create a local restic repo — first backup done
- Create a B2 bucket — offsite repo — offsite backup done
- Write
backup.shwith amountpointguard — add the cron line — verify tomorrow morning withrestic snapshots - Set retention policy — set up the healthcheck ping
- Test one restore, right now, before anything else happens
For roughly $3–5 a month offsite plus an external drive you probably already own, you buy complete peace of mind: even if your server catches fire tomorrow, your photos and configurations are back in an afternoon.
Frequently Asked Questions
Is RAID a backup?
No, and this misconception destroys more data than any virus. RAID protects against one specific failure: a disk dying. It does not protect against accidental deletion (the mistake is mirrored to every disk instantly), ransomware, fire, theft, power surges, or a crashed filesystem. RAID is availability; backups are survival. You can absolutely have both, but RAID alone has left plenty of people with nothing.
How much does offsite backup storage cost?
Backblaze B2 is the common choice and costs around $6 per terabyte per month. If your critical data — photos, documents, project files, configs — is under 500 GB, expect roughly $3 a month. Many providers, including B2, give you free egress up to a monthly cap, which covers occasional restores.
What should I actually back up from a home server?
The irreplaceable data: photo libraries, documents, the folders your containers use (bind mounts), database dumps, and your configuration — compose files, .env files, and app config folders. You usually don't need to back up container images or anything re-downloadable; losing those costs time, not memories.
Restic, rsync, Duplicati — which should I use?
rsync is great for a plain mirrored copy, and I still use it for quick local syncs, but it keeps no history by default: delete a file locally and the next sync deletes it in the mirror too. Restic stores versioned, encrypted, deduplicated snapshots and talks directly to cloud buckets — that is why this guide is built on it. Duplicati is friendlier via web UI, though restic has proven far more predictable on multi-hundred-gigabyte libraries.
How often should I test a restore?
Every quarter at minimum, and after any change to your backup setup. A backup that has never been restored is a hypothesis, not a backup. The test takes ten minutes: restore a random folder to a temp directory and open a file from it.