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.

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 (immich upload folders, camera imports)
  • Documents and file sync data (your Nextcloud data folder)
  • 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.yml files, .env files (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 forget command 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:

Terminal window
sudo apt install -y restic

Copy 2: a local backup drive

Plug in a USB drive (or mount your NAS). Create the repository — this is where encrypted snapshots live:

Terminal window
# One-time setup: create the repo and choose a strong password
export RESTIC_REPOSITORY=/mnt/backup-drive/restic
export RESTIC_PASSWORD='a-strong-passphrase-you-will-never-lose'
restic init

Warning

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):

Terminal window
mkdir -p ~/backups/db
docker exec nextcloud-db pg_dump -U nextcloud nextcloud > ~/backups/db/nextcloud-$(date +%F).sql

Then run the first backup — this one copies everything and takes the longest:

Terminal window
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:

Terminal window
export RESTIC_REPOSITORY=b2:your-bucket-name:/home-server
export B2_ACCOUNT_ID=your-key-id
export B2_ACCOUNT_KEY=your-application-key
restic init
restic 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:

Terminal window
restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune

Automate 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):

Terminal window
nano ~/backup.sh
#!/bin/bash
set -euo pipefail
export RESTIC_PASSWORD="$(cat ~/.restic-password)"
export B2_ACCOUNT_ID="your-key-id"
export B2_ACCOUNT_KEY="your-application-key"
# 1. Dump databases
docker exec nextcloud-db pg_dump -U nextcloud nextcloud > ~/backups/db/nextcloud-$(date +%F).sql
# 2. Local backup
restic -r /mnt/backup-drive/restic backup ~/nextcloud/data ~/backups/db ~/nextcloud/.env
# 3. Offsite backup
restic -r b2:your-bucket-name:/home-server backup ~/nextcloud/data ~/backups/db
# 4. Retention
restic -r /mnt/backup-drive/restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune
restic -r b2:your-bucket-name:/home-server forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune

Lock down permissions with chmod 700 and 600 so other local users cannot read your B2 keys or restic passphrase:

Terminal window
chmod 700 ~/backup.sh
chmod 600 ~/.restic-password # readable only by your user
# Run it every night at 3:30 AM
crontab -e
# add this line:
# 30 3 * * * /home/YOURUSER/backup.sh >> /home/YOURUSER/backup.log 2>&1

Know when it fails

Silent backup scripts fail silently for months. Point the script at a free uptime service like healthchecks.io — a single curl -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 no restic process is still running with ps aux | grep restic, then run restic unlock.
  • External USB drive didn’t mount after reboot: if /mnt/backup-drive isn’t mounted, restic could write into the empty mount directory on your root SSD and fill it up. Add mountpoint -q /mnt/backup-drive || exit 1 right before step 2 in backup.sh and mount the drive by UUID in /etc/fstab with nofail.
  • permission denied on Docker appdata: containers often create files owned by root or another UID. Run the backup script as root (via sudo crontab -e) or ensure container PUID/PGID matches your backup user.

The step everyone skips: test the restore

A backup you have never restored is a hypothesis. Prove it quarterly:

Terminal window
# List what you have
restic snapshots
# Restore the latest snapshot of one folder to a scratch directory
restic restore latest --target /tmp/restore-test --include ~/nextcloud/data/Documents
# Open a file from /tmp/restore-test and confirm it's intact

A 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

  1. Plug in an external drive — create a local restic repo — first backup done
  2. Create a B2 bucket — offsite repo — offsite backup done
  3. Write backup.sh with a mountpoint guard — add the cron line — verify tomorrow morning with restic snapshots
  4. Set retention policy — set up the healthcheck ping
  5. 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.

Portrait of Guillermo

Written by Guillermo

IT Student & Home Server Enthusiast

Building private clouds to break free from Big Tech. I document everything I learn about home servers and self-hosting on MyHomeServerGuide.

More about the author