The moment every Home Assistant user dreads: a corrupted SD card after a power blip, or an update that silently breaks a critical automation, and suddenly months of fine-tuning vanish. Local snapshots help, but if they live on the same piece of silicon, they’re one hardware failure away from joining your config in the digital afterlife. The antidote is boringly simple — automated backups to a NAS on your network, running over Samba, without monthly fees or cloud dependencies. With the Backup integration baked into recent Home Assistant releases and a few lines of YAML, you can push daily snapshots to a remote share and sleep better. This walk‑through covers everything from creating a share to a restore drill, so that when (not if) the SD card gives up, you’re back online in under an hour.
Why Off-NAS Backups Are Worth the Setup
Home Assistant’s default backup location — typically the local SSD or SD card — is a single point of failure. Hardware dies, theft happens, and a nearby lightning strike doesn’t care that your automations were pristine. Adding a remote NAS to the mix moves you closer to a solid 3‑2‑1 strategy: three copies of your data, on two different media, one off‑site (or at least off‑device). While a NAS in the same house isn’t truly off‑site, pulling backups off the Home Assistant hardware dramatically reduces your risk footprint. If the Pi fries, the NAS sitting in a closet probably survived.
The cloud alternative often comes with recurring bills. Nabu Casa Cloud Backup costs $6.50/month at the time of writing, while Google Drive Backup add‑ons rely on third‑party accounts that can break when API tokens expire or quotas shift. A Samba share, by contrast, is a one‑time setup that costs whatever the hardware does — often nothing if you repurpose an old PC or a Raspberry Pi. Privacy-wise, your data never leaves your LAN, so you’re not trusting a third party with every entity name and automation script. The real win, though, is automation. Once you’ve spent an hour or two wiring everything together, backups happen without you ever thinking about them again. That trade‑off is why this approach earns a permanent spot in a home lab.
What You’ll Need
Before diving into configs, gather the prerequisites. Everything here works with a reasonably recent Home Assistant OS or Supervised installation that includes the built‑in Backup integration (available since 2023.11, with network storage support improved in 2024.x releases). For the target device you’ll need a NAS or any always‑on machine that can run a Samba server. That covers dedicated units from Synology, QNAP, and TerraMaster, a Linux box, a Windows PC with SMB shares enabled, or even a Raspberry Pi with an external drive and Samba installed.
You’ll also need:
- Network connectivity between Home Assistant and the NAS. Both devices should have static IPs or reliable DHCP reservations so the mount doesn’t vanish after a router reboot.
- Credentials — a dedicated Samba user with read/write access to the backup share, never the admin account. This limits blast radius if credentials are ever exposed.
- Enough storage space on the NAS. A typical Home Assistant backup compresses to 150–400 MB depending on add‑ons and history. Plan for at least 5–10 GB to hold multiple retention cycles comfortably.
- A test plan — a spare SD card or a spare device where you’ll verify that a restore actually works. Testing turns a backup strategy from a hope into a guarantee.
Creating the Samba Share on Your NAS
Start by logging into your NAS management interface and creating a dedicated shared folder. Call it something like ha-backups so its purpose is obvious six months later. Disable the recycle bin if your NAS offers one — you’ll manage retention through Home Assistant, not the filesystem.
Next, create a dedicated user account for Home Assistant. Give it a strong password and restrict its permissions to only the new share. On a Synology, that means setting read/write on the ha-backups folder and nothing else. On a plain Linux box with Samba, the share definition in /etc/samba/smb.conf might look like this:
[ha-backups]
path = /srv/ha-backups
browseable = no
read only = no
valid users = habackup
force user = habackup
force group = habackup
After creating the user with sudo smbpasswd -a habackup, restart the Samba service. The key detail is using browseable = no so the share doesn’t appear in network discovery, keeping it low‑profile.
Write down three things: the NAS IP address (or hostname if mDNS works reliably on your network), the share name (ha-backups), and the credentials you just created. These go into Home Assistant next.
Adding the Network Storage to Home Assistant
In Home Assistant, head to Settings → System → Storage → Add Network Storage. Fill in the fields:
- Name: something friendly, like “NAS Backups”.
- Server: the IP address of your NAS, e.g.,
192.168.1.100. - Protocol: Samba / CIFS (that’s what you just set up).
- Share: the share name (
ha-backups). - Username and Password: the dedicated backup user credentials.
Leave the “Workgroup” field as the default unless your NAS is on a non‑standard workgroup. Hit Connect. Home Assistant will attempt to mount the share, and if it succeeds you’ll see a confirmation — and a new entry appears on the Storage page.
The mount is now available system‑wide, but the Backup integration still needs to be told to use it. Go to Settings → System → Backups, and under “Locations” you should see your NAS listed alongside the default local storage. Select the NAS as an additional location. The first backup to the share may take a bit longer while the mount initializes, but subsequent writes will be normal.
Scheduling Automated Backups
With the location added, open the Backup page and click Change backup settings. Set up a schedule that makes sense for how often your configuration changes. Daily backups strike a good balance for most homes — losing up to 24 hours of tweaks rarely causes heartache, and it keeps storage use predictable. If you rebuild automations constantly during weekends, a twice‑daily or even hourly backup may be worth a few extra megabytes.
Then define retention. Keeping the last 3–5 backups usually gives enough rollback depth without chewing through disk space. Home Assistant’s Backup integration supports both time‑based and count‑based retention. I find count‑based simpler: keep the last 5 backups, and delete older ones automatically. That way, you never have to SSH into the NAS to clean up stale files.
The integration also lets you toggle “backup on shutdown” and include or exclude large add‑ons. I’d include everything — omitting an add‑on that later proves critical during a restore is more painful than using an extra 100 MB of space.
Once saved, Home Assistant will run the first scheduled backup at the next trigger. You can also fire a manual backup immediately to verify everything lands on the NAS without error. Check the share from a separate computer; you should see a .tar file timestamped correctly.
Restore: Testing That Your Backups Actually Work
An untested backup is just an expensive assumption. Set aside an afternoon to prove you can restore your whole Home Assistant instance from the NAS onto a blank SD card. This isn’t about paranoia — it’s about knowing the exact steps when stress is high.
A simple drill: power off your production Home Assistant, swap in a blank SD card (or a test device), and flash a fresh Home Assistant OS image. During the initial setup, when you reach the “restore from backup” screen, select Network Storage as the source, enter the Samba share details again, and pick the most recent backup. The restore will pull the tarball and write it to the new storage.
If your Home Assistant version doesn’t offer the restore-from-network option in the UI, you can still retrieve the file: mount the share on a computer, copy the backup to the SD card, and use the Home Assistant CLI restore command (ha backups restore). The result is the same — a fully reconstituted instance.
After a successful restore, verify that all integrations load without errors, automations fire, and add‑ons start. One common hiccup is the network mount configuration. After restore, the mount path might need to be re‑added because the credentials aren’t stored inside the backup for security reasons. That’s a few clicks, but worth noting before you depend on the NAS backup during a real emergency.
Maintenance and Monitoring Tips
This setup isn’t set‑and‑forget, but the maintenance burden is low — I’d budget 10–15 minutes a month. Check that recent backups appear on the NAS, spot‑check a few file sizes to confirm they aren’t zero‑byte stubs, and ensure the NAS hasn’t run out of space. Home Assistant exposes a backup.state entity and last‑backup timestamps, so you can build a quick dashboard card or an automation that sends a notification if no successful backup occurred in the past 26 hours.
The NAS side deserves attention too. If the device requires firmware updates or experiences a drive failure, your backup pipeline is dead. Many NAS units can send email alerts for SMART errors or low capacity. Enable those — they’re free and might save you from discovering the problem only when you need a restore.
For the truly privacy‑minded, there’s no telemetry or cloud dependency in this chain. The backup tarballs sit on your own hardware, encrypted at rest only if your NAS supports volume encryption. If you need encryption, consider enabling it at the share level, but be aware that it adds a tiny performance penalty and complicates restoring from a cold start without the NAS’s key manager. Most home environments are fine without it, as long as physical access to the NAS is controlled.
Comparing Your Options
A quick look at how a local Samba‑based backup stacks up against the common alternatives, including the approximate ongoing cost and monthly upkeep.
| Option | Monthly Cost | Privacy | Maintenance (hrs/mo) | Off‑device? |
|---|---|---|---|---|
| Default local backups only | $0 | Full local control | 0 | No |
| Nabu Casa Cloud Backup | ~$6.50 | Data on their servers | <0.1 | Yes (off‑site) |
| Google Drive Backup add‑on | $0–$2 (storage) | Google sees metadata | 0.5–1 (token refresh) | Yes (off‑site) |
| Samba share to local NAS | $0 (hardware already owned) | Full local control | 0.25 | Yes (separate device) |
The Samba approach lands in a sweet spot for anyone who already owns a NAS or can repurpose old gear. There’s no monthly bill, no API token to renew, and no third party scanning your smart home data. The trade‑off is that it doesn’t provide true off‑site protection unless you replicate the NAS contents elsewhere or consider a fireproof safe, but as a first off‑device layer, it’s solid.
Wrapping Up
Automating Home Assistant backups to a Samba share turns a tedious chore into an invisible safety net. The upfront work — creating a share, adding network storage, configuring retention — pays back every time you recover from a failed update or a zapped SD card without breaking a sweat. Sticking to a local solution keeps costs at zero and your data where it belongs, while the modest monthly maintenance of checking capacity and verifying logs fits easily into a homelab routine. Hook up a simple notification automation, run a restore drill once, and you can file the whole thing under “done.” When the next hardware hiccup hits, you’ll be rebuilding over a cup of coffee instead of starting from scratch.