Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.
With your newfound knowledge of Home Assistant and the necessary hardware, it's time to put it into action. This comprehensive guide will walk you through the process of setting it up using the powerful Raspberry Pi 4 Model B. To get started, you'll need the following:
I do not recommend older models than the Raspberry Pi 4 Model B (highly recommended) or Raspberry Pi 3 Model B+. You will also need a power supply, and I recommend using only the official one.
Why I don't recommend using the Raspberry Pi Imager to install Home Assistant
Installing the Home Assistant OS on a Raspberry Pi has never been easier, thanks to the Raspberry Pi Imager. This official software from the Raspberry Pi Foundation not only allows you to install Raspberry Pi OS, but also other operating systems without the need for any additional configuration or downloads. However, there is one potential downside to using the Raspberry Pi Imager: the Home Assistant OS image you'll be installing may be out of date.
While you can easily update Home Assistant Core, the Home Assistant Supervisor, and Home Assistant Operating System from the UI, I recommend a clean installation using the latest release. At the time of writing, the latest image in the Raspberry Pi Imager Repository is Home Assistant Operating System 7.6, while the latest release is version 8.1. To put those numbers into context, the Raspberry Pi Imager is two full releases behind.
Flashing Home Assistant Operating System to a microSD card using balenaEtcher
The recommended way of installing the Home Assistant Operating System, which includes the Supervisor and Home Assistant Core, is by using balenaEtcher. You can install this application on your Windows, macOS, or Linux device, and additionally, there is a portable version available to download too. Once installed, you can copy the URL of the latest release from GitHub.
If you are using a Raspberry Pi 4 Model B that would currently be haos_rpi4-64-8.1.img.xz. The filename can be deciphered in the following manner:
Part in filename
Home Assistant Operating System
Raspberry Pi 4
Home Assistant Operating System 8.1
It is recommended to use the 64-Bit versions of Home Assistant Operating System for both the Raspberry Pi 4 Model B and Raspberry Pi 3 Model B+. As such, you would copy the following URL for the Raspberry Pi 4:
With the URL to the latest Home Assistant Operating System release copied, you can launch balenaEtcher and select the option titled 'Flash from URL'.
Enter the URL you previously copied in the pop-up that appears. You don't have to bother with any authentication.
Back in balenaEtcher's main window, you will now be able to select a target. Make sure you select the correct microSD card and don't overwrite any secondary external hard-drives. In my experience, balenaEtcher does a good job of hiding anything you want to avoid using for this operation.
Starting the Raspberry Pi running Home Assistant for the first time
With the microSD card successfully flashed, you can remove it from your computer and insert it into the Raspberry Pi. Connect your Raspberry Pi to your network using an Ethernet cable. Wait for a few minutes, then open a browser on your computer and navigate to http://homeassistant.local:8123/. Don't fret if your browser displays an error message. If your router doesn't support mDNS, you will need to look up the Raspberry Pi's IP address.
Finding the IP of the Raspberry Pi running Home Assistant using your DHCP server
There are multiple ways of finding the IP address of any device connected to your network. The first is to log in to your DHCP server, which will most likely be your router/modem. To access it, follow these steps on Windows:
Open the Command Prompt by pressing the ⊞ Windows + R keys and entering cmd into the prompt.
Enter the command ipconfig and hit the ↵ Return key.
Look for the 'Default Gateway'. In most cases, its IP will be 192.168.0.1 or 192.168.1.1.
Enter the IP into a browser to access your router/modem's interface.
The steps are similar on macOS and Linux devices; however, the command is slightly different: Open the Terminal and execute the command ifconfig -a.
Somewhere in the web interface, you will find a list of all the devices that the DHCP server has assigned an IP address. This location of this list is dependent on who made the device. What you are looking for here is a device describing itself as 'homeassistant'. Once found, you can enter the IP, followed by :8123 in your browser. In my case, it is http://192.168.1.77:8123.
Finding the IP of the Raspberry Pi running Home Assistant using an application
Alternatively, there are also apps that will help you find the IP address of devices on your network. Advanced IP Scanner is such an application, and it can be installed for free on Windows. Once you have it running, start a scan by entering the IP range your computer is in.
As I know from running the ipconfig command that my computer has the IP address 192.168.1.30, I will enter 192.168.1.1-254. You might need to adjust the third number depending on your range. In a minute or so, the application will have discovered the devices, including the Raspberry Pi running Home Assistant. As I am unable to test any macOS applications, I will refer you to the website AlternativeTo, to find similar applications.
Setting up Home Assistant
Now that you know how to access Home Assistant, you can do so. Depending on how long the Raspberry Pi has already been running, you will be greeted by an image telling you to wait. You don't have to do anything at this time, besides waiting. The setup will continue automatically once Home Assistant is prepared.
Once complete, you are prompted to add your name, username, and password. Make sure you don't forget your password or, even better, store it in a password manager. I can highly recommend Bitwarden, which I use daily and have no affiliation to.
You are then prompted to add some basic data such as your time zone, elevation, unit system, and currency. You can also have Home Assistant fill in this information by clicking the button labelled 'detect'. This will make a one-time request to an external service, though, and you won't be able to use it if you have the Raspberry Pi blocked from the internet. You can find your elevation using a barometer or one of the many websites that will do this using a mapping service.
If you have any devices that Home Assistant can automatically discover, they will appear in the next step. However, you can add these just as easily in a later step, so I will be skipping them for now.
And with that, the setup is complete. You now have access to your Home Assistant Dashboard.
Frequently asked questions
Below are answers to questions I frequently read or receive personally. If there is anything else you would like answered, you can either contact me directly or, even better, leave a comment for everyone to see.
How do I power off Home Assistant Operating System safely?
You might be thinking about giving your Raspberry Pi a permanent home now that you have installed and configured Home Assistant. It isn't advised to unplug a Raspberry Pi while it is running, as that might reduce the microSD card's lifespan. To power off the Home Assistant Operating System, enter the developer tools, select the tab title services, and execute the 'poweroff the host system' service.
Can I attach a monitor to a Raspberry Pi running Home Assistant Operating System?
You can, but you won't be able to do anything useful with it. The Home Assistant Operating System running on a Raspberry Pi running does have a graphical interface. You will not see your Home Assistant Dashboard, nor is there any way of displaying it.
1 thought on “How to install Home Assistant on a Raspberry Pi”
Excellent and well-written guide. Thank you