Install Home Assistant OS on a Pi (or VM)
Flash Home Assistant OS to a Raspberry Pi 4/5 or VM, attach a Zigbee dongle, configure add-ons, and set up automated off-device backups.
Before you start
- ▸Raspberry Pi 4 or 5 with power supply, or a KVM/Proxmox host with at least 2 GB RAM free
- ▸A 32 GB+ microSD card or USB SSD for Pi installs
- ▸A desktop Linux machine with rpi-imager or dd available for flashing
- ▸Network switch with a spare Ethernet port and access to your router's DHCP table
Home Assistant OS (HAOS) is the recommended way to run Home Assistant if you want the full ecosystem: one-click add-ons, supervised updates, snapshots, and hardware integration without wrestling dependencies. This guide covers flashing HAOS to a Raspberry Pi 4/5, deploying it inside a virtual machine, connecting it to your network, installing add-ons, attaching a USB Zigbee dongle, and setting up automated backups. Along the way you'll understand where HAOS fits versus the Container and Supervised install methods so you can pick the right one for your situation.
Installation Methods: HAOS vs Container vs Supervised
Home Assistant ships in four flavours. Two matter most in practice:
- Home Assistant OS (HAOS) — a minimal, purpose-built Linux OS that runs the Home Assistant stack plus a supervisor daemon that manages add-ons and OS updates. You flash an image; nothing else runs on that machine. This is the right choice for a dedicated Pi or a dedicated VM.
- Home Assistant Container — the core application only, inside a Docker container you manage yourself. No add-on store, no supervisor. Good when you already run Docker on a general-purpose server and don't need add-ons.
- Home Assistant Supervised — runs the supervisor (and therefore the add-on store) on top of a vanilla Debian install. Officially supported only on Debian stable with specific system requirements; any deviation is unsupported. Complex to maintain correctly.
- Home Assistant Core — bare Python environment. For developers only.
For a dedicated Pi or VM, choose HAOS. The rest of this guide assumes that choice.
Hardware and Prerequisites
- Raspberry Pi 4 (2 GB RAM minimum, 4 GB recommended) or Pi 5; or a VM host running KVM/QEMU, VMware, VirtualBox, or Proxmox.
- A microSD card (32 GB+) or USB SSD (recommended for longevity on Pi).
- A desktop machine to flash the image and a network switch with a spare Ethernet port.
- Optional: a USB Zigbee coordinator such as the SONOFF Zigbee 3.0 USB Dongle Plus (CC2652P) or Electrolama zzh.
Step 1 — Download the HAOS Image
Go to github.com/home-assistant/operating-system/releases and grab the latest stable image for your target. For a Pi 4 you want the .img.xz labelled haos_rpi4-64; for a Pi 5 use haos_rpi5-64. For a generic x86-64 VM, download haos_ova-*.qcow2.xz (QEMU/Proxmox) or haos_ova-*.vmdk.zip (VMware/VirtualBox).
Step 2 — Flash to Pi Storage (Physical Hardware Path)
The Raspberry Pi Imager handles decompression automatically. Install it if you haven't:
# Debian/Ubuntu
sudo apt install rpi-imager
# Fedora
sudo dnf install rpi-imager
# Arch
sudo pacman -S rpi-imager
Launch rpi-imager, choose Use custom image, select the downloaded .img.xz, pick your SD card or USB SSD as the target, and write. Alternatively, use xz and dd directly — but verify the device path first with lsblk:
xz -d haos_rpi4-64-*.img.xz
lsblk # confirm your target, e.g. /dev/sdb — NEVER use a system disk
sudo dd if=haos_rpi4-64-*.img of=/dev/sdX bs=4M status=progress conv=fsync
Eject, insert into the Pi, connect Ethernet, and power on. Skip Wi-Fi for first boot if possible — wired is more reliable during initial setup.
Step 3 — Import into a VM (Virtual Machine Path)
Proxmox
# On the Proxmox host — extract and create a VM
xz -d haos_ova-*.qcow2.xz
qm create 200 --name homeassistant --memory 2048 --cores 2 \
--net0 virtio,bridge=vmbr0 --bios ovmf --machine q35
qm importdisk 200 haos_ova-*.qcow2 local-lvm
qm set 200 --scsihw virtio-scsi-pci --scsi0 local-lvm:vm-200-disk-0 \
--boot order=scsi0 --efidisk0 local-lvm:0,efitype=4m
Start VM 200 from the Proxmox web UI. Assign at least 2 vCPUs and 2 GB RAM; 4 GB RAM is better for a busy install.
QEMU/KVM (standalone)
xz -d haos_ova-*.qcow2.xz
sudo virt-install \
--name homeassistant \
--memory 2048 --vcpus 2 \
--disk path=haos_ova-*.qcow2,format=qcow2,bus=virtio \
--import --os-variant=generic \
--network bridge=virbr0,model=virtio \
--noautoconsole
Step 4 — Initial Web Setup
After two to three minutes (first boot is slow — HAOS expands the root partition), open a browser on the same network:
http://homeassistant.local:8123
# or use the IP directly if mDNS isn't working:
http://192.168.x.x:8123
Find the IP via your router's DHCP table or, on the Pi, by connecting a keyboard and monitor — the console prints the assigned address. Follow the onboarding wizard: create your owner account, set your home location, and let it auto-discover devices on your LAN.
Step 5 — Static IP and Network Hardening
Give HAOS a static IP so integrations and external DNS don't break after a DHCP renewal. In the HA web UI go to Settings → System → Network. Set a static IPv4 address, gateway, and at least one DNS server (e.g. 9.9.9.9). Alternatively, assign a DHCP reservation in your router by MAC address — either approach works.
If you expose port 8123 externally, run it behind a reverse proxy with TLS (the NGINX Home Assistant SSL proxy add-on handles this) or use the official Nabu Casa cloud tunnel — never expose the plain HTTP port to the internet.
Step 6 — Install Add-ons
HAOS add-ons are supervised containers managed by the HA supervisor. Navigate to Settings → Add-ons → Add-on Store. Recommended starting add-ons:
- Mosquitto broker — local MQTT server for Zigbee2MQTT and other integrations.
- Zigbee2MQTT — translates Zigbee radio traffic to MQTT. Install from the community add-on repository (add
https://github.com/zigbee2mqtt/hassio-zigbee2mqttin Add-on Store → ⋮ → Repositories). - File editor or VS Code Server — edit
configuration.yamlin-browser. - Samba share — mount the HA config directory from a Windows/Linux desktop for bulk edits.
Each add-on runs in an isolated container. Configuration lives in /addon_configs/<slug>/ and persists across HA updates.
Step 7 — Attach a USB Zigbee Dongle
Plug in the dongle before configuring Zigbee2MQTT so HAOS can see it. On Proxmox or KVM you need to pass the USB device through to the VM:
# Proxmox — find the dongle's USB vendor:product
lsusb | grep -i sonoff
# example output: Bus 001 Device 004: ID 10c4:ea60 Silicon Labs CP210x
# Add USB passthrough (replace XX with your VM ID)
qm set 200 --usb0 host=10c4:ea60
On a physical Pi the dongle is visible immediately. In HA, go to Settings → System → Hardware — the dongle appears as /dev/ttyUSB0 or /dev/ttyACM0. Note the path.
Open the Zigbee2MQTT add-on, edit its configuration to set the correct serial port, and start it:
# Zigbee2MQTT add-on configuration (YAML, set via the add-on config UI)
serial:
port: /dev/ttyUSB0
mqtt:
server: mqtt://core-mosquitto
user: mqtt_user
password: your_password
Enable permit join in the Zigbee2MQTT web panel, then hold the pairing button on each Zigbee device. Devices appear automatically as MQTT entities in HA.
Step 8 — Automated Backups
HAOS has a built-in backup engine. A full backup includes config, add-on data, and the HA database. Backups are stored in /backup/ inside HAOS. Configure automatic backups under Settings → System → Backups → Automatic backups — pick daily or weekly and set a retention count.
Keeping backups only on the Pi itself is risky. Copy them off automatically with one of these add-ons:
- Samba Backup — pushes backups to a Samba/NFS share on your NAS.
- Google Drive Backup (community) — mirrors every snapshot to Google Drive.
- rclone — flexible; supports S3, Backblaze B2, Nextcloud, and dozens of other targets.
Restore is equally simple: upload a .tar backup file via Settings → System → Backups → ⋮ → Upload backup, then choose full or partial restore.
Verification
After setup, run through this checklist:
- Browse to
http://<static-ip>:8123— HA dashboard loads. - Settings → System → Updates — no pending OS or supervisor updates after a fresh install is normal; check again in a week.
- Settings → System → Hardware — Zigbee dongle listed under USB devices.
- Zigbee2MQTT add-on log shows
Coordinator firmware versionandConnected to MQTT server. - Trigger a manual backup and confirm the
.tarfile appears in Settings → System → Backups.
Troubleshooting
Can't reach homeassistant.local:8123
mDNS (Avahi/Bonjour) is blocked on some networks or VLANs. Use the IP address directly. On Proxmox, open a console to VM 200 — HAOS prints its IP on the console after boot.
Pi reboots or freezes randomly
Underpowered USB supply is the most common cause on Pi 4/5. Use the official 27 W USB-C PSU. If booting from SD card, consider switching to a USB SSD — SD cards wear out quickly under constant database writes.
Zigbee dongle not found in HAOS on a VM
USB passthrough must be configured at the hypervisor level before HAOS boots with the dongle attached. On Proxmox, add the USB device then issue qm reboot 200. Confirm with qm config 200 | grep usb.
Add-on store is empty or won't load
The supervisor needs internet access to pull the add-on repository index. Check DNS (Settings → System → Network) and that outbound HTTPS is not blocked by a firewall rule. Restarting the supervisor via Developer Tools → Supervisor → Restart supervisor clears stale cache.
Frequently asked questions
- Can I run other services alongside HAOS on the same machine?
- Not directly — HAOS is a locked-down OS with no package manager. Run additional services as HA add-ons, or use a VM host like Proxmox so HAOS sits in one VM and other workloads run in separate VMs or LXC containers.
- What is the difference between a full backup and a partial backup?
- A full backup captures the HA core, all add-on configs and data, and the home-assistant_v2.db database. A partial backup lets you select individual add-ons or just the core config — useful for quick config snapshots without the large database file.
- Does the Zigbee2MQTT add-on replace the built-in ZHA integration?
- Yes, they do the same job via different paths. ZHA is built into HA and needs no add-on or MQTT broker. Zigbee2MQTT is a separate daemon and is preferred when you want to share the coordinator with other MQTT consumers or need device quirks that ZHA doesn't yet support. Don't run both against the same dongle.
- Is it safe to update HAOS automatically?
- HAOS, supervisor, and HA core updates are separate. HA core updates occasionally introduce breaking changes — read the release notes. Taking a full backup immediately before any update is strongly advised, and HAOS prompts you to do exactly that.
- How much storage does HAOS use over time?
- The base image is under 1 GB, but the recorder database grows continuously with entity history. The default configuration purges data older than 10 days. A busy install with many entities can consume several gigabytes per month; a 64 GB SSD gives comfortable headroom.
Related guides
Configure Prometheus Alertmanager
Configure Prometheus Alertmanager with routing trees, receivers, inhibition rules, grouping, Go templates, and PagerDuty/Slack on-call integrations.
Build an Intranet Server on Linux
Set up a complete small-office intranet on one Linux box: Nginx web server, dnsmasq local DNS, Samba file sharing, and a Wiki.js team wiki.
Build an nftables Firewall Script
Build a complete nftables firewall from scratch: tables, chains, sets, default-deny input policy, service allowlisting, and persistent systemd configuration.
Caddy as a Reverse Proxy
Set up Caddy as a reverse proxy with automatic HTTPS, load balancing, WebSocket passthrough, reusable snippets, and header control — no certbot required.