Homelab Backup & Restore: A Guide to Keeping Your Data Safe
A complete homelab backup and restore guide covering the 3-2-1 strategy, Proxmox VM and LXC backups, Docker volumes, and verified restores.
Backup is the last thing on the list and the part most often skipped by people just starting out with a homelab. Over time, a server holds more and more content: photos, documents, configuration, application data. If a disk fails or you misconfigure something, all of it disappears in seconds.
This part covers how to create backups that can actually be restored, not just copying files to a single location.
The 3-2-1 Strategy
The rule most widely used by administrators is 3-2-1:
- 3 copies of the data
- 2 on different media
- 1 at a physically separate location
An example of how to apply it: the original data on the server, a backup on a NAS at home, and one more copy on an external hard drive or in cloud storage.
A beginner homelab can start with 2-1-1 (two copies, one separate location) and scale up gradually. What matters is not the number, but the discipline of the schedule.
What Needs to Be Backed Up
Before setting up tools, make a list of the assets whose value cannot be replaced:
| Asset | Example | Backup method |
|---|---|---|
| Personal files | Photos, documents, project code | Rsync/Borg/Restic to NAS |
| Database | PostgreSQL, MySQL | Dump SQL then back up the dump file |
| Container state | Docker volume | Volume snapshot / vzdump |
| VMs & LXC | Proxmox container | vzdump |
| Configuration | Nginx, Cloudflare Tunnel, systemd | Rsync /etc + config folder in Git |
Backing Up Docker Volumes
Docker containers store data in volumes. Copying the container folder is not enough because its structure differs depending on the image.
The simplest way: stop the container first, then copy the volume.
# List volumes
docker volume ls
# Back up a single volume to a host folder
docker run --rm -v namavolume:/data -v /srv/backup:/backup alpine \
tar czf /backup/namavolume-$(date +%Y%m%d).tar.gz /data
For services whose data lives in a database, backing up via a dump is safer than copying the database files directly.
# Back up a PostgreSQL database running in a container
docker exec -t postgres pg_dump -U user dbname -F c -f /tmp/db.dump
# Pull the dump file out of the container
docker cp postgres:/tmp/db.dump /srv/backup/db-$(date +%Y%m%d).dump
Backing Up VMs and LXC Containers in Proxmox
If your homelab runs on Proxmox, the built-in tool called vzdump handles VM and LXC backups. The vzdump format supports stop mode (cool and most consistent) and snapshot mode (the server keeps running during the backup).
# Back up all containers/VMs to the backup storage
vzdump 101,102,103 --storage backup --mode snapshot \
--compress zstd --notes-template "Monthly backup"
# Back up a single container only
vzdump 103 --storage backup --mode snapshot --compress zstd
You can also schedule it through the web UI: Datacenter > Backup, then add a Backup Job with a specific time schedule. Choose retention so old backups are deleted automatically, for example keeping 7 daily and 4 weekly.
Backing Up Configuration with Restic
For backing up files and folders to a NAS or a cloud service, Restic is a solid choice: encrypted, deduplicated, and with plenty of backends (local, SFTP, S3, B2).
# Initialize the repository
restic -r /mnt/nas/restic init
# Back up important folders
restic -r /mnt/nas/restic backup \
/etc \
/srv \
--exclude '*.log' \
--tag server1
# Check existing snapshots
restic -r /mnt/nas/restic snapshots
# Restore a specific snapshot
restic -r /mnt/nas/restic restore latest --target /restore
The Restic key must be stored outside the server. Write down the passphrase somewhere that will not be lost if the server dies.
Automating Backup Schedules
Humans forget. Schedule backups with cron or a systemd timer so they run without needing to be remembered.
# /etc/cron.d/backup-homelab
# Restic backup every day at 02:00
0 2 * * * root /usr/local/bin/backup-daily.sh >> /var/log/backup.log 2>&1
The contents of backup-daily.sh:
#!/bin/bash
set -euo pipefail
restic -r /mnt/nas/restic backup \
--tag home \
--exclude-caches \
/srv /opt /etc/nginx
After that, give it the exec bit: chmod +x /usr/local/bin/backup-daily.sh.
Verification: Backups Must Be Restorable
A backup that is never tested is the same as having no backup at all. Do a restore test at least once every month or two.
A cheap way to test: restore to a separate folder and compare checksums, or run a test container from the backup volume.
# Compare checksums between the original files and the restored files
find /srv -type f -exec sha256sum {} + > /tmp/asli.sha256
find /restore -type f -exec sha256sum {} + > /tmp/restore.sha256
# Diff the two lists; the output should be empty
diff /tmp/asli.sha256 /tmp/restore.sha256
If the contents differ, something is wrong in the backup process. Fix it before you have to deal with the event that requires it.
Set Up Alerts When Backups Fail
A backup that fails silently is worse than no backup at all. Backup management can integrate with a monitoring dashboard, or at minimum send a notification to a chat app:
#!/bin/bash
if restic -r /mnt/nas/restic backup /srv; then
curl -fsS -X POST "https://ntfy.sh/homelab-alert" \
-H "Title: Backup OK" -d "Backup succeeded $(date)"
else
curl -fsS -X POST "https://ntfy.sh/homelab-alert" \
-H "Title: Backup FAILED" -d "Check the log: $(date)"
fi
That way, failures are immediately visible, rather than only being discovered once the data is already gone.
What to Avoid
- Only one storage location. If that disk is lost too, the backup will not help.
- Skipping restore verification. The files exist but are corrupt in many places, which is the same thing.
- Backing up to the cloud without encryption. Your personal data sits as-is on someone else’s server.
- A manual schedule with no reminders. Consistency matters more than sophisticated tools.
Summary
The right order of work: inventory your data, choose 2-3 storage locations, schedule automatic backups, and test restores regularly. Tools can come later; the habit has to come first.
In the next part we move into another direction for a production-ready homelab: monitoring server health with Grafana and Prometheus, so that issues such as a full disk are detected before they disrupt a service. Continue to Part 10: Monitoring Servers with Grafana & Prometheus.
Related Articles
Proxmox VE: Virtualization for the Homelab
Install and use Proxmox VE in a homelab: create VMs and LXC containers, configure storage, snapshots, integrated backups, and why one server should be virtualized.
HomelabServer Monitoring with Grafana & Prometheus
A homelab monitoring guide with Grafana and Prometheus. Install node_exporter, scrape metrics, build dashboards, and set alerts so problems surface early.
HomelabSelf-Hosted Analytics with Umami: A Privacy-Friendly Google Analytics Alternative
A complete guide to setting up self-hosted Umami analytics as a Google Analytics alternative that is privacy-friendly, fast, and keeps your data entirely yours.
Your ideas deserve to be read by thousands of people.
ByteNesia is built for everyone. If you have experience, tutorials, or opinions about technology, write and share them here. Your name will be credited as a contributor.
Write anything: tool reviews, homelab tutorials, security tips, or your tech stories.