Skip to content
Advertisements

Running Home Assistant on a Raspberry Pi in a Docker Container

I have been a fan of Home Assistant for some time now and have set things up a few times in the past but have always changed away from it for one reason or another. Home Assistant has tons of integrations and you can do things with it that commercially available home automation platforms like Wink and SmartThings really can only dream of. The more I think about Home Assistant to less reasons I have not to run it but the one thing that has always been a non-starter for me has been that I needed to dedicate a Raspberry Pi to it. Recently I have been spending a good amount of time playing around with Docker on one of my Raspberry Pi setups and happen to find a way to run Home Assistant inside of a Docker container on a Raspberry Pi running Raspbian.

When I first started looking into running Home Assistant inside of a Docker container I stumbled upon some instructions on the Home Assistant website which I quickly jumped head first into and ran the commands listed for a Linux system, since Raspbian was Linux based I blindly though that these instructions would work. Well they didn’t the documentation on running Home Assistant in a Docker container on the Home Assistant website does not apply to the Raspberry Pi (or any ARM based system). I struggled for a good hour plus trying to troubleshoot what was going on when all along I was trying to run a Docker Image that was not compatible with my Raspberry Pi. Now I am sure someone with a bit more knowledge than me would have figured this out sooner or even known that it would not work before trying to set things up but I did not see anything that said specifically that the image did not support ARM based systems and it was not until I spent a good amount of time on the Home Assistant Discord Chat Server that I was pointed in the direction of the Raspberry Pi 3 Home Assistant Repository on the Docker Hub. This is exactly what I needed and from there I was able to quickly get things up and running.

With the mistakes out of the way you can install Home Assistant on a Raspberry Pi inside of a Docker container in just a few simple steps. Follow along below if you are interested in getting this setup for yourself:

First what will you need?

To begin the installation process you will need a MicroSD Memory Card, and the ability to format and burn an image to that MicroSD Memory Card. I am sure most of you know how to do these steps already, but I will give my recommendations, for formatting I prefer to use SD Memory Card Formatter for Windows and to burn the image Etcher.

Memory Card Preparation:

  1. Insert MicroSD Memory Card into a computer
  2. Open SD Memory Card Formatter for Windows
  3. In SD Memory Card Formatter for Windows Select the Drive that corresponds to your Memory Card
  4. In SD Memory Card Formatter for Windows Click Format and wait for it to finish
  5. Download the Raspbian disk image from https://www.raspberrypi.org/downloads/raspbian/
  6. Open Etcher.
  7. In Etcher Select the previously Downloaded Image
  8. In Etcher Select the Drive that corresponds to your Memory Card
  9. In Etcher Click Flash and wait for Etcher to Finish

Raspberry Pi Setup:

  1. From the Raspbian Desktop launch Terminal
  2. From Terminal you need to install Docker using the follow command,
  1. From Terminal reboot your Raspberry Pi using,
  • sudo reboot
  1. From the Raspbian Desktop launch Terminal
  2. Visit the Raspberry Pi 3 Home Assistant Repository on the Docker Hub to determine the latest version available
  3. From Terminal run the following commands to download and run Docker Image,
  • sudo docker run -d –name=”home-assistant” –net=host -v /home/pi/home_assistant:/config -v /etc/localtime:/etc/localtime:ro –restart unless-stopped homeassistant/raspberrypi3-homeassistant:[insert latest version number]

That’s it that’s really all it takes to get Home Assistant up and Running inside of a Docker container on your Raspberry Pi 3. You can now access Home Assistant using a web browser from a device connected to the same network by navigating to http://ipaddressofpi:8123

Running Home Assistant inside of Docker on a Raspberry Pi allows me to use that same Raspberry Pi for many other things which I think will help for me to finally keep Home Assistant running.

Anyone running Home Assistant? Let me know your thoughts in the comments below.

Advertisements

Mike View All

I am passionate about the IoT and connected devices. Using connectivity to automate our lives will empower civilization to achieve greatness.

One thought on “Running Home Assistant on a Raspberry Pi in a Docker Container Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: