Homelab

3-2-1 homelab backups with restic, in practice

Three copies, two media, one offsite: a practical restic setup for Docker stacks, plus the restore test most people skip.

2026-10-24
Illustration: 3-2-1 homelab backups with restic, in practice
Original illustration by SafeToUpdate (CC BY 4.0).

Every “safe update” plan assumes you have a backup. restic is a fast, encrypted, deduplicating backup tool that’s well suited to homelabs.

The 3-2-1 rule

Set up a repository

restic repos can live on local disk, SFTP, or S3-compatible storage (see working with repositories).

export RESTIC_REPOSITORY=/mnt/nas/restic
export RESTIC_PASSWORD_FILE=/root/.restic-pass
restic init

Store the password somewhere besides the server. Without it the repository can’t be decrypted. Not by you, not by anyone.

Back up the right things

Back up Compose files, .env files, bind-mounted data, and database dumps (not the live DB files):

docker compose -f ~/stacks/immich/compose.yaml exec -T database \
  pg_dumpall -U postgres > ~/backups/immich-db.sql
restic backup ~/stacks ~/backups

Keep a sensible history

Use forget with --prune to apply a retention policy:

restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
restic check

Add the offsite copy

Run a second repository on S3-compatible storage (or a friend’s box over SFTP) with the same commands and a different RESTIC_REPOSITORY.

Test a restore

restic restore latest --target /tmp/restore-test

See restoring. Actually bring up a stack from the restored data once. Until you’ve done that, you don’t know the backup works.

Checklist

📬 The Weekend Patch Report

One email a week: what's safe to update, what will bite, and one practical tip for your homelab or printer.

Free, weekly, unsubscribe anytime.