Skip to main content
  1. Tutorials/

Configuring Automatic Backups in Home Assistant

Status In Progress
Difficulty Intermediate
Time ~30 min
Stack
Home Assistant Unraid SMB

Home Assistant stores everything: every automation, integration, dashboard, device, and years of sensor history. This tutorial walks through setting up automatic daily backups that store copies in two independent locations so a single failure cannot wipe everything out.

Executive Summary
#

The goal is a setup that requires no manual intervention. A backup runs every night, older ones are pruned automatically, and copies land on a local Unraid network share and Home Assistant Cloud simultaneously. If something goes wrong, you can restore in minutes.

Prerequisites
#

  • A running Home Assistant instance
  • An Unraid server on the same local network
  • A Home Assistant Cloud account (free trial or paid subscription)
  • A dedicated Unraid user account for Home Assistant to use

Implementation
#

Step 1: Create the Unraid Share
#

In the Unraid web interface, go to Shares and create a new share for backups.

Key settings:

SettingValue
Share namebackup
Primary storageArray
Allocation methodHigh-water

Under SMB Security Settings, set Security to Private and disable guest access. Create a dedicated Unraid user for Home Assistant and give that user Read/Write access to the backup share under SMB User Access.

Step 2: Connect Home Assistant to the Share
#

  1. Go to Settings > Backup
  2. Click Configure backup settings
  3. Scroll to Locations and click Manage network storage
  4. Click Add network storage and fill in the fields:
FieldValue
NameUnraid_Backup_Share
UsageBackup
ProtocolSamba/Windows (CIFS)
ServerIP address of your Unraid server
Remote sharebackup/Home Assistant
Usernameyour dedicated backup user
Passwordthat user’s password

Click Connect. The share will appear in the Locations list if the credentials and path are correct.

Step 3: Configure the Automatic Backup Schedule
#

Go to Settings > Backup > Configure backup settings and set the following under Automatic backups:

SettingValue
ScheduleDaily
TimeSystem optimal
Backup preference when updatingBackup before update
Retention3 backups

System optimal lets Home Assistant pick a time between 4:45 AM and 5:45 AM. Retention set to 3 keeps the three most recent backups and deletes older ones automatically.

Step 4: Set Storage Locations
#

Under Locations, enable the destinations for automatic backups:

  • This system can be disabled. Backing up to the same device you are protecting adds little safety.
  • Unraid_Backup_Share should be enabled as the primary backup target.
  • Home Assistant Cloud should be enabled as a second independent copy. Note that Cloud only retains the most recent backup and has a 5 GB maximum size.

Step 5: Download the Encryption Key
#

All Home Assistant backups are encrypted. Without the encryption key, a backup file is useless.

  1. Go to Settings > Backup > Configure backup settings
  2. Scroll to Encryption key
  3. Click Download emergency kit

Store this somewhere safe outside of Home Assistant, such as a password manager or a printed copy. If you ever change the encryption key, download a new emergency kit immediately.

Step 6: Verify the Setup
#

Trigger a manual backup to confirm everything is working before waiting for the overnight schedule.

  1. Go to Settings > Backup
  2. Click Create backup and choose Full backup
  3. Select both Unraid and Cloud as locations
  4. Click Create

Once complete, go to Settings > Backup and confirm the status shows Backed up with 2 locations. On the Unraid side, browse to the backup share and confirm a .tar file is present in the Home Assistant subfolder.

Lab Notes & Troubleshooting
#

Backup shows failed or no recent backup. Go to Settings > Notifications and look for a backup error. Common causes are the Unraid server being offline at the scheduled time, a credentials problem with the SMB share, or the backup exceeding the 5 GB Cloud limit.

Only stored in 1 location instead of 2. Check that the Unraid server was online during the backup window. Go to Backup settings > Locations and confirm both show as connected.

Cannot connect to the Unraid share. Confirm the backup share has SMB Export set to Yes, the dedicated user has Read/Write access, and the server IP has not changed. Consider setting a DHCP reservation for the Unraid server so its IP stays stable.

Restore fails with an encryption error. You need the encryption key that was active when the backup was created. Old backups require the old key. Keep emergency kit copies from before any key changes.

Backups are very large. History data grows over time and is included by default. Go to Backup data and consider disabling History or Media to reduce size.

Unraid share fills up. Manual backups are not pruned automatically. Check Settings > Backup > Show all backups and delete old manual backups if the share is filling up.

Summary
#

You now have automatic daily backups running to two independent locations with no manual intervention required. The Unraid share holds the last three full backups as the primary restore target, and Home Assistant Cloud holds the most recent backup as a secondary safety net. Store your encryption emergency kit somewhere safe outside of Home Assistant and test a restore before you need it.

Resources
#


Disclaimer: Content on this site is provided as-is with no guarantees of accuracy, completeness, or fitness for any particular purpose. Always test in a safe, non-production environment before applying anything documented here to systems you rely on. I am not responsible for data loss, damage, or security issues resulting from following these guides. Software and services change over time and steps that worked when this was written may not work in the future.