Last updated September 2026. Some links on this page may be affiliate links, which means RPi4U may earn a small commission at no extra cost to you.
By the end of this guide your Raspberry Pi 5 will be a dedicated smart home hub running Home Assistant. It pulls lights, plugs, sensors, thermostats and speakers from many different brands into one dashboard, and it runs your automations locally, so they keep working when your internet is down.
You will flash Home Assistant OS, finish the setup in your browser, add your first devices, set up a Zigbee radio and turn on automatic backups. There is also an optional step for moving to an NVMe SSD, which holds up better than an SD card over years of constant writes.
At a glance
| Difficulty | Intermediate |
| Time | About 1 hour (plus device pairing) |
| Works on | Pi 5 · Pi 4 (2GB+) |
| Parts cost (approx, US) | About $142 for Pi 5 4GB ($110), 27W power supply ($12), case ($10) and microSD card (~$10). NVMe SSD and M.2 HAT+ optional. |
What you need
- Raspberry Pi 5 (4GB is plenty) or a Raspberry Pi 4 with at least 2GB of RAM
- Official Raspberry Pi 27W USB-C power supply (phone chargers and computer USB ports often can’t deliver enough power)
- A case, ideally one with airflow or a fan, since the Pi will run 24/7
- A microSD card of at least 32GB, preferably one marked A2 for better random read and write speed
- An Ethernet cable and a free port on your router (required for the first install)
- A computer with an SD card reader to run Raspberry Pi Imager
- Optional: Raspberry Pi M.2 HAT+ and an NVMe SSD larger than your SD card
- Optional: a USB Zigbee adapter and a USB extension cable
Why Home Assistant OS instead of Raspberry Pi OS
Home Assistant can run as a Docker container on top of Raspberry Pi OS, but that version leaves out the add-on store and the built-in tools that manage the system for you. Home Assistant OS (HAOS) is a small operating system built only to run Home Assistant. It updates itself from the web interface, handles backups and supports add-ons such as file editors and MQTT brokers with one click. For a box that should just work in a closet, it is the simplest choice. The trade-off is that the Pi becomes a dedicated appliance, not a general-purpose computer.
Step 1: Flash Home Assistant OS
- Download and install Raspberry Pi Imager on your computer.
- Open Imager. If it asks for your device first, choose your Pi model.
- Select OS, then Other specific-purpose OS, then the home automation category, then Home Assistant.
- Pick the Home Assistant OS build for your board (RPi 5 or RPi 4). The builds are not interchangeable.
- Insert the microSD card and select it as the storage. Everything on it will be erased.
- Select Next, then Write, and wait for writing and verification to finish.
- Select Finish and eject the card.
Step 2: First boot
- Put the microSD card in the Pi.
- Connect the Ethernet cable to your router. Your computer must be on the same network, and the network needs internet access.
- Plug in the power supply. You don’t need a monitor or keyboard.
- On your computer, open
http://homeassistant.local:8123. Current versions also answer on plainhttp://homeassistant.local, so try that if the first address doesn’t load.
On a Pi 4 or Pi 5 the page should appear within a minute or two. You will then see a Preparing Home Assistant screen while it downloads the latest version. Let it run, even if it takes several minutes. Unplugging the Pi at this point is the most common way to end up with a broken install.
Step 3: Onboarding
- Choose Create my smart home. (If you are moving from another Home Assistant system, choose Restore from backup instead.)
- Enter your name, a username and a strong password. This is the owner account, so save the password in a password manager.
- Set your home location on the map and select Next. Home Assistant uses it for your time zone, units, currency and sunrise or sunset triggers.
- Choose which anonymous usage data, if any, you want to share.
- Select Finish to open your default dashboard.
Step 4: Add discovered devices and integrations
Home Assistant scans your network for supported devices such as smart TVs, printers, Chromecasts, Sonos speakers and Hue bridges. An integration is the connector for one brand or service.
- Go to Settings > Devices & services.
- Look for the Discovered section and select Add on anything you want to use. Follow the prompts, such as pressing the button on a Hue bridge.
- For anything that wasn’t found, select Add integration in the bottom-right corner, search for the brand and follow the steps.
- Assign new devices to an area (Kitchen, Bedroom) when asked. It makes dashboards and automations easier later.
Step 5: Set up Zigbee with ZHA
Many cheap sensors, bulbs and buttons use Zigbee, a low-power wireless network that needs its own radio. ZHA (Zigbee Home Automation) is the built-in integration that drives a USB Zigbee adapter, so you don’t need a vendor hub.
- Plug the Zigbee adapter into a USB extension cable and connect it to one of the Pi’s black USB 2.0 ports. Keep the adapter away from the blue USB 3.0 ports, SSDs and the Pi itself. USB 3.0 gives off noise in the same 2.4 GHz band, and it can badly hurt Zigbee range.
- The adapter often appears under Discovered. If it doesn’t, go to Settings > Devices & services > Add integration and choose Zigbee Home Automation.
- Follow the prompts to create a new network.
- To pair something, go to Settings > Connectivity > Zigbee and select Add device. Then put the device in pairing mode, usually by resetting it as its manual describes.
- When it appears, give it a clear name and an area.
Pair mains-powered devices like smart plugs and bulbs first. They act as repeaters and extend the mesh for battery sensors added later.
Step 6: Turn on automatic backups
- Go to Settings > System > Backups and select Set up backups.
- Download the emergency kit and store it somewhere safe, away from the Pi. It holds the encryption key, and you can’t restore your backups without it.
- Pick a schedule (daily is a good default) and how many copies to keep.
- Add at least one location that isn’t the Pi itself, such as a network share on a NAS or a supported cloud service. A backup that sits only on a dead SD card won’t help you.
To restore onto a new card or a new Pi, flash HAOS again and choose the restore option on the first onboarding screen.
Optional: Move to an NVMe SSD
SD cards wear out under the steady database writes Home Assistant makes. On a Pi 5 you can add an NVMe SSD with the M.2 HAT+. The Home Assistant team suggests that you keep booting from the SD card and use the data disk feature to put most of the system on the SSD.
- Shut down Home Assistant from the Settings > System page, wait a minute, then unplug the Pi.
- Fit the M.2 HAT+ and SSD by following the instructions that come with the HAT.
- Power on, then go to Settings > System > Storage and select Move data disk.
- Choose the SSD and select Move. Everything on the SSD is erased, and it must be larger than the SD card. The move can take a while.
You can also skip the SD card completely: flash HAOS onto the SSD (using a USB NVMe adapter on your computer) and remove the card. A Pi 5 boots from NVMe when no SD card is present, but it needs bootloader firmware from December 6, 2023 or later. If yours is older, update it from Raspberry Pi OS first, as the M.2 HAT+ documentation explains. This setup works for many people, but it is not the route Home Assistant recommends.
Troubleshooting
- homeassistant.local won’t load: some networks and devices don’t resolve
.localnames. Find the Pi’s IP address in your router’s device list and openhttp://<IP address>:8123. - Still nothing after 5 minutes: check that the Ethernet link lights are on, then flash the card again. Make sure you picked the image for the right Pi model.
- Random reboots or a frozen interface: this usually points to power. Use the official 27W supply, especially with an SSD or USB devices attached.
- Zigbee devices drop off or won’t pair: lengthen the USB extension cable, move the adapter away from USB 3.0 ports and the SSD, and add a few powered Zigbee devices as repeaters.
- Move data disk doesn’t list your SSD: the SSD must be larger than the SD card. Also reseat the ribbon cable between the HAT and the Pi, then reboot.
Where to go next
- Want ad blocking for the whole house on a second Pi? Follow our Pi-hole tutorial.
- Not sure which board fits your next project? Try the Which Pi? picker.
- Comparing models and RAM sizes before you buy? Read our Raspberry Pi buying guide.
Sources: Home Assistant: Raspberry Pi installation, Home Assistant: Onboarding, Home Assistant: Adding integrations, Home Assistant: ZHA integration, Home Assistant: Backups, Home Assistant: Common tasks (data disk), Home Assistant OS 12 release notes, Raspberry Pi: M.2 HAT+ documentation