Installing Home Assistant

November 20, 2024

Shout out to my good friend who asked if I had any suggestion on getting started with Home Assistant. He made me realize, that while I do have some experience, and have learned some good lessons in setting up my own smart home, I have not written down nearly enough of them to help the next person along their journey.

Resources

First of all, some links to some people who helped to jumpstart my Home Assistant learning.

Derek Seaman’s Tech Blog is a wealth of information for all things smart home, security, and somewhat oddly eyewear recently. (I’m here for it. The eyewear blog posts were truly eye-opening).

Lewis Barclay at Everything Smarthome also has a vast collection of helpful videos, and puts out a guide every time there is a major update to Home Assistant, which outlines each new feature, and what it can mean for your setup.

Also, a shout out to the official Home Assistant documentation, because it is truly excellent. This project is one that has a relatively low barrier to entry, but a very high ceiling. They do well at the balance of making information approachable for newcomers without taking away options for advanced users.

Honestly, follow the official guide from Home Assistant, it’s excellent!

Install Options and Why it Matters

There are a few different ways that you can run Home Assistant (or HA for short).

  • Docker Container
  • HAOS on dedicated hardware
  • Virtual Machine

You can also run in a VM or in Docker on a Mac, or Windows computer. The one catch is, the resulting service is not exactly the same, depending on how you installed it.

For instance, I started by running Umbrel on a raspberry pi. Umbrel had a template for Home Assistant, and I was able to run it that way in a “production” environment for several months with few issues. Umbrel basically just made a docker template, and let me deploy HA with a single click, which was great for me as I was just getting started. However, while learning the ropes of Home Assistant, I came across some plugins that I wanted to install. I could not figure out, for the life of me, why I could not just click the “add plugin” button and have it work. It turns out, plugins are only supported for Home Assistant OS, not for the docker container version.

Thankfully HA has some great backup and restore options, so I was able to copy over all of my settings from the docker install to a full HAOS install without any issues, and I could continue from there.

There are two types of people in the world, those that have never lost data, and those that have backups. Backup your Home Assistant

Another thing that can become important later is that it is far easier to add on Z-Wave and Zigbee support to HAOS when it is installed directly onto hardware, rather than running as a VM. You could still pass through your USB add-on radio to a virtual machine, but it is simpler to not need to worry about that. You do not necessarily need Z-Wave or Zigbee to start with, unless you have devices that require those networks.

Lastly, when running as an OS directly on hardware, HAOS makes some kernel level changes to make sure that it is as stable and compatible as it can be. It also allows you to access storage settings, which can enable you to setup SMB shares for backups and other fun tricks.

For all of these reasons I highly recommend installing Home Assistant directly onto a Raspberry Pi or mini PC. In my experience, this has been incredibly stable and reliable, and I have had fewer issues with this setup than I have had with other “ecosystems” of smart home devices, even though those are all supposed to work together.

Requirements

Home Assistant has their own install and requirements docs that you should double check. I am going to write here what I used personally.

  • Raspberry Pi 4GB
  • USB C Power Supply
  • Ethernet cable (more stable than wifi, but technically only required during install)
  • Computer with Micro SD card reader, and Raspberry Pi Imager installed
  • Micro SD Card

You could skip the SD card, and install to a USB Flash Drive instead. This would give you faster read and write speeds for your OS. However, I have found the SD card to be perfectly suitable in my use case.

Install

Step 1: Prepare

Download the Raspberry Pi Imager on a computer of your choice. Open Raspberry Pi Imager, and select the Device that matches what you are going to be using as your Home Assistant host. For me, that would be “Raspberry Pi 4”.

Select the OS you want to use. Go to “Other Specific Purpose OS”, then select “Home assistants and home automation”. You should see Home Assistant as an option in that list. You will want to select Home Assistant OS xx.x (RPi 4/400), not Home Assistant OS Installer for Yellow.

Insert the SD card into your computer in an SD card reader. Choose storage, and select the SD Card. When you are ready, select “Next”. Confirm that it is ok to erase all data on that storage.

It may ask if you want to apply personalization settings. Select no.

Wait for it to complete.

Step 2: Install on Hardware

Remove the Micro SD Card from the reader, and insert it into your pi. Make sure that the pi is connected to the network, and then plugin the power supply and turn on the pi.

It will be doing some setup and boot things in the background, just wait patiently. Within about 5 minutes, you should be able to connect to the web interface of HAOS by going to homeassistant.local:8123.

You may need to use homeassistant:8123 or http://x.x.x.x:8123 instead, where x.x.x.x is your Raspberry Pi IP Address.

There is also a status page on Port 4357, if you ever need to check how HAOS is doing.

You should now be all done with the install steps! You can setup your devices from the web page, and HAOS will scan your local network for devices that it knows it can support. You can also always add devices manually from HAOS settings. Finally, if you ever want to expand compatibility by adding a community add on, you can do so through the Home Assistant Community Add-on Store, which can be installed separately. Follow this guide if you want to install HACS

Step 3: Install App for Location Based Automations

This will let you trigger scenes and automations based on things like iPhone Focus State, and Arriving at or Leaving certain destinations. For iPhone specifically, install the Home Assistant App from the App Store

There is also an Android app, but I have no experience with it.

You will want to login to your home assistant server. Set your URL to homeassistant.local:8123.

This will only let your app work while you are connected to the same local network as the HAOS server. This can be remedied by completing Step 4.

Step 4: Setup for Remote Access

This step is not required, but it is very helpful. If you want to be able to see the state of your home while you are away, and don’t want to worry about whether or not you are on wifi in order to control your home, these steps are a must.

Personally, I like using Tailscale for this. You can also do a reverse Proxy, and forward outside connections but that requires more control over the local network.

First, sign up for an account with Tailscale, it’s free!

Note that whatever sign up method you use will be what you have to use forever. There is no way to setup one account with multiple login types at this point.

Once you have your tailscale account setup, you will need to install Tailscale on HAOS, and also on your client device, i.e. your phone.

In HAOS, go to Settings -> Add-Ons -> Add-on Store and select and install the Tailscale Community Add On. Once it is installed, you should be able to start it, and see that it is running from the Add-Ons Page. (The one in Settings, not the Store). You may also see in the sidebar that there is now a Tailscale tab. Opening that tab should show you options for logging into your tailnet.

You may need to login to the web page to approve HAOS to be added as a new device. Make a note of the Tailscale IPV4 address for this device. It should be something like 100.101.102.103, but it won’t be that exactly. Set your Raspberry Pi settings in the Tailscale Web Page. We want to set it to never expire. This prevents you from needing to login to Tailscale every few weeks on the server.

On your phone, you will want to complete pretty much the same steps. Get the Tailscale App, open it, and login to your tailnet. You may also need to approve this device in the web page.

Enable Tailscale to run on your phone. It will start as a VPN profile. Now, you should be able to see a list of clients in your Tailnet on your phone Tailscale app as long as it is running!

We are then going to go back to the Home Assistant app on the phone, and change the connection settings. We want to use our Tailnet IPV4 address instead of homeassistant.local:8123 like we did before.

Change it instead to http://100.101.102.103:8123, but using your Tailnet IPV4 address for the Raspberry Pi that we made note of before. You should be able to login to your Home Assistant web page even when not connected to the same local network.

This does mean that you need to be running the Tailscale VPN profile at all times on your phone to be able to access HAOS remotely. However, I have found that for my devices, leaving the VPN running at all times has negligible impact on battery life or network speed. Tailscale is smart enough to only route traffic to your Tailnet devices over the VPN, unless you have set it up to use exit nodes.

Fin

With all of these steps followed, you should now have HAOS running on a Raspberry Pi, and access by app even over a remote connection!

The next steps are to set up your devices, set up scenes and automations, Set up backups 🤨, etc.

Finally, be sure to check out this guide, which covers common mistakes for HA beginners. Following these recommendations will help you avoid pitfalls that become painful later, as you become more experienced with HA.


Profile picture

Written by Grant Brinkman, amateur coffee, tech, and film enthusiast.