Your automations, device configs, and history took months to build. This guide shows how to push Home Assistant backups offsite with restic - encrypted, automated, and recoverable from anywhere.
HA OS stores backups in /backup/ on the host. On a Proxmox LXC or VM, SSH in and back up that directory.
#!/bin/bash
source /etc/restic/env
# HA stores backups here
restic backup /backup \
--tag homeassistant \
--exclude="*.tmp"
restic forget --keep-daily 7 --keep-weekly 4 --tag homeassistant --prune
#!/bin/bash
source /etc/restic/env
# Stop HA for a clean config backup (optional but recommended)
# docker stop homeassistant
restic backup /opt/homeassistant/config \
--tag ha-config \
--exclude="*/home-assistant.log" \
--exclude="*/.storage/lovelace*" # optional: skip UI cache
# docker start homeassistant
restic forget --keep-daily 14 --keep-weekly 8 --tag ha-config --prune
Wire the script to a systemd timer for nightly backup. See the systemd timer setup guide for complete unit files. The key setting is After=network-online.target so the backup waits for network before starting.
For a clean snapshot, trigger a HA backup via the API before running restic:
#!/bin/bash
HA_TOKEN="your-long-lived-access-token"
HA_URL="http://homeassistant.local:8123"
# Trigger backup
curl -s -X POST "$HA_URL/api/services/backup/create" \
-H "Authorization: Bearer $HA_TOKEN" \
-H "Content-Type: application/json"
# Wait for it to complete
sleep 60
# Now run restic
source /etc/restic/env
restic backup /backup --tag ha-auto
restic forget --keep-daily 7 --prune
Home Assistant typically runs on a Raspberry Pi, a mini PC, or an x86 server running HA OS. The SD card or local disk is a single point of failure - SD cards in particular have a high failure rate with constant write-heavy HA usage. Without an offsite copy, a failed SD card means reconfiguring everything from scratch: all your automations, integrations, entity customizations, and years of history.
The HA backup includes your entire configuration, all installed integrations, Lovelace dashboards, scripts, automations, blueprints, and optionally history data. Restoring from a good backup gets you back to exactly where you were in minutes rather than days of manual reconstruction.
HA OS and Supervised installations generate .tar backup files that can grow large if history data is included. For offsite backup via restic, a sensible retention policy keeps the last 7 daily and 4 weekly backups. With HA backup files typically ranging from 100 MB to several GB depending on history inclusion, 7 days of backups fits comfortably within the ServerCrate Starter plan.
To keep backup sizes manageable, exclude history from your HA backup (toggle off "Home Assistant" history in the backup settings) and rely on HA's native recorder database for recent history. The config-only backup is typically under 100 MB and is the most important data to preserve offsite.
Test your HA restore on a spare Pi or in a VM before you need it. The restore process in HA OS is: boot to onboarding, select Restore Backup, point it at your .tar file. If you have never done this, the first time you try it should not be during an actual failure. Schedule a test restore once every few months - it takes under 30 minutes and confirms your offsite backup is actually usable.
restic restore latest --target /tmp/restore --tag homeassistant to restore the backup files, then use the HA UI to restore from the .tar file.Offsite vault ready in seconds. No egress fees.
No egress fees, cancel anytime, 7-day money-back guarantee