How to Set Up Home Assistant on a Raspberry Pi

  • Post author:WunderTech
  • Post published:December 23, 2021
  • Post last modified:October 30, 2023
  • Post category:Raspberry Pi
  • Reading time:7 mins read

Share what you're reading!

Today we are going to take a look at how to set up Home Assistant on a Raspberry Pi using Docker. 

My reason for using Home Assistant with Docker is because the natural progression for a lot of people is to start off using a Raspberry Pi and then migrate to some sort of a home server as they begin to utilize more services.

This approach will allow you to take your Home Assistant configuration and easily migrate it to a home server or NAS at a later time if you’re looking for a little extra processing power.

This also gives you the opportunity to use your Raspberry Pi for multiple things. I have created multiple Raspberry Pi tutorials that utilize Docker to implement different services.

Using this approach, your Raspberry Pi will be more of a “home server” as you’ll be running multiple services on it. It will also give you the flexibility of expanding in the future if you’d like.

1. How to Set Up Home Assistant on a Raspberry Pi

1. In order to set this up, I will be using Portainer as I find it significantly easier to manage my containers. If you don’t have Docker and Portainer set up on your Raspberry Pi, please follow my instructions here.

You can also use a simple Docker run command, but I find it easier to utilize Portainer for the maintenance/upkeep of containers which is why I’ll be utilizing this approach in this tutorial.

2. Launch and log in to Portainer. Select Volumes then Add Volume.

How to Set Up Home Assistant on a Raspberry Pi - creating a volume for home assistant

3. Give the volume the name Home-Assistant then select Create the volume.

creating the volume for home awssistant

4. Select Containers then Add Container.

creating the container for home assistant

5. Give the container a Name, then enter the image below. Make sure you select the Raspberry Pi 3 or 4 image depending on what Raspberry Pi device you’ll be using.

Raspberry Pi 4:

Raspberry Pi 3:

6. Select publish a new network port and map the host port 8123 to the container port 8123. If you’re using this port for something else (unlikely), please select a different host port number. 

modifying the ports in portainer

7. Select Volumes then map additional volume. Select the volume we created earlier and map it to the /config location.

mounting the volumes in portainer

8. Change the restart policy to Always.

setting the container to restart automatically

9. In the Runtime & Resources section, enable Privileged Mode.

adding privileged mode

10. In the Environment Variables section, create an environment variable named TZ for your time zone.

adding timezone environment variable

11. You can now Deploy the container.

12. Give the container a few minutes to create, then navigate to the IP address of your Raspberry Pi and port 8123.


13. Create an account.

setting a name and password for home assistant

14. Select your location and the unit type you’d like to use, then select Next. If you’d like to share anonymous information, you can at the next step.

selecting the location of home assistant

15. Home Assistant will automatically find devices on your local network. You can now set up any other integrations that you’d like!

16. Home Assistant will now be set up and configured, so you can modify it however you’d like!

2. Conclusion – How to Set Up Home Assistant on a Raspberry Pi

This tutorial showed how to set up Home Assistant on a Raspberry Pi using Docker. Home Assistant can be set up on the Raspberry Pi OS, but managing it this way is a lot better in my opinion as you’re able to run multiple services. Running Docker on a Raspberry Pi gives you the ability to run one, or multiple different containers rather than having to devote a single Raspberry Pi to certain services.

Thank you for reading the tutorial on how to set up Home Assistant on a Raspberry Pi! If you have any questions on how to set up Home Assistant on a Raspberry Pi, please leave them in the comments!