Your Home Assistant configuration represents months or years of work — automations, integrations, dashboard layouts, scripts, and custom code. Losing it to a failed SD card or corrupted update is devastating. This guide covers the right backup strategy for Home Assistant, with both local and off-site options.
The Three Backup Scenarios You Need to Survive
- SD card / SSD failure: Hardware dies, need to restore to new hardware
- Bad update: A Home Assistant update breaks something, need to roll back
- Accidental deletion: Deleted an automation or integration by mistake
Your backup strategy should handle all three.
Built-in Home Assistant Backups
Home Assistant OS includes a backup system. Go to Settings → System → Backups. Each backup is a .tar file containing your entire configuration, including add-on data.
Click “Create Backup” before any major change — a new Home Assistant update, a significant configuration change, or adding a new integration. Configure automatic daily backups via a Home Assistant automation that calls backup.create on a schedule.
Where to Store Backups
Backups stored only on your Home Assistant host are useless if the hardware fails. You need at least two locations.
Option 1: Network Share (NAS)
If you have a NAS, configure Home Assistant to automatically copy backups to the NAS via the SMB/Samba integration or a Shell Command automation using rsync.
Option 2: USB Drive
Plug a USB drive into your Home Assistant host and configure the Samba add-on to expose backups. Manually copy backups to the drive periodically, or automate it with a Shell Command.
Option 3: Cloud Storage (Privacy-Conscious)
Use rclone (available as a Home Assistant add-on) to sync backups to an encrypted cloud storage provider. Backblaze B2 offers 10GB free. Encrypt before uploading if your backup contains sensitive automation data.
The Backup Automation
alias: "Daily Home Assistant Backup"
trigger:
- platform: time
at: "03:00:00"
action:
- service: backup.create
data:
name: "Daily - {{ now().strftime('%Y-%m-%d') }}"
Testing Your Backups
A backup you have never tested is just a hope. Every few months, test your restore process on a spare SD card or in a VM. Go to Settings → Backups → select a backup → Restore. Verify your automations and configurations are intact.
Git for Configuration Version Control
Advanced users: use the Git Pull add-on or Studio Code Server git integration to version-control your configuration.yaml and related files in a private GitHub repository. This gives you a full history of every configuration change.
Applying the 3-2-1 rule to Home Assistant
The standard backup rule — 3 copies, on 2 different media, with 1 off-site — maps directly onto a Home Assistant setup: (1) the live configuration on your SD card/SSD, (2) a local backup on a separate USB drive or NAS, and (3) an off-site copy that survives a fire, theft, or lightning strike taking out the whole house. Most guides stop at step 2; step 3 is the one that actually saves you in a real disaster.
Automating the off-site copy
The Home Assistant Google Drive Backup or Nextcloud add-ons can push your automatic backups to cloud storage on a schedule, with the files encrypted before upload — you’re using the cloud purely as remote storage for an encrypted blob, not handing over your smart home data in the open. Set it to run weekly and you’ll always have a recent off-site copy without thinking about it.
What never belongs in Git
If you’re version-controlling configuration.yaml as the guide above suggests, keep secrets.yaml (API keys, Wi-Fi passwords, Tailscale keys) explicitly out of the repository via .gitignore — even in a private repo. A leaked private repo shouldn’t mean a leaked house. Back up secrets.yaml separately, encrypted, alongside your regular Home Assistant backups instead.
Managing backup file size over time
A full Home Assistant backup typically runs a few hundred MB to a few GB, depending mostly on your recorder database and any local media. Left unmanaged, automatic daily backups fill a drive within weeks. Set a retention policy (Settings → Backups) to keep a rolling window — 7 daily plus 4 weekly is a reasonable default — and periodically confirm the pruning is actually running, since a silently-failing cleanup job is how people discover their backup drive was full for a month.
Free guide — no signup
Trying to cut the cloud out of your smart home? This is the whole map in one place.