How to run home assistant supervisor in a docker container

Hi,

I am new to home assistant. And what I want is to run home assistant supervisor as a docker container. Is there a way to do so ? I have gone through official documentation and for supervisor installation what they have provided is

and also few pre-requisites are also mentioned:

But these steps are mentioned to run HA supervisor on a full fledged os. But I want to run it inside a container.

Any help regarding this would be appreciated…

1 Like

Hi, I did it with this manual:

Install Home Assistant (Supervised) on Debian

Basically the supervisor is a docker container. So you want to run the supervisor and the other containers inside an own docker container?
If so, pull an image of like debian or ubuntu, create a container of it and inside of it execute the install script.
But i have to ask why you want this? Running a bunch of docker containers inside a docker container would be redundant

Thanks for the reply @pedolsky
The link that you shared is something that will help install supervisor and other containers on host os. But I want to run supervisor and the other containers inside a docker container.

That’s why I posted the link above.

Would you pleas explain your reasons?

Hi @tenn0

Exactly what I want “supervisor and the other containers inside a docker container”. I tried that but for this I need to run docker engine inside the container as well. For this I tried to load local docker engine inside docker container by running the container as
docker run -it -v /var/run/docker.sock:/var/run/docker.sock homeassisttesting:latest

For the question that you asked “Why do I want to do this ?”. It is a requirement. The place where I want to run home assistant supervisor, I do not have access to host OS and I can only test this by loading this as an image on it. That is why I want to bundle the entire supervisor and other containers in my own container.

need to know more about your server before can give you some advice

Hi @KingRichard

You can consider the server as raspberry Pi. We create a tar package of our image and then do a “docker load” onto the raspberry pi and then run containers on it.

OK… RPI4 right?

you can try my script

You have to install docker in your docker container first. You basically have a VM of your linux installation, so you need to install all dependencies of HA supervised.
But wouldnt be a real VM be easier?

Hi @tenn0
As I told earlier, I do not have any option to do anything on the server(Raspberry Pi). I can just load the image on it. I can’t create a VM on it.

2 Likes

Did you find a resolution? I’m searching for the same - someone must have made a container for it, if not I will give it a shot so stay tuned.

2 Likes

Have you succeed with this?

I keep coming back from time to time to HA to see if the installation process improved over the years. HA documentation is very strict to claim that it should be used exclusively to HA. The HA would definitely reach a broader audience by creating a neatly one-container HA supervised for a couple of the most used Linux distros. Raspberry PI’s are really expensive in developing countries. The user may want to install it in their actual laptop to control the house, or, in some cases, home servers are shared across other services like nextcloud (for which security is no joke). A mess of an installation (how many containers?) raises security concerns in these shared situations.

2 Likes

You don’t need the Supervisor features, especially if you’re planning to run HA on a server with other services already running on it. You might as well run HA Container at that point especially if you’re already using Docker.

3 Likes

How do you run add-ons without the Home Assistant Supervisor?

4 Likes

By installing whatever other software you want on the host yourself in other containers (or packages if available with your OS’s package manager). Add-ons are just Docker containers with magic that allows them to be installed and managed by the Supervisor. Virtually every add-on exists as a standalone container.

3 Likes

I don’t get why the supervisor has to run on the host OS directly. A dockerized version of the assistant could easily control the host’s docker daemon.

1 Like

The Supervisor is a Docker container.

2 Likes

Hi, it’s a bit hard to understand it but I think I got it now :slight_smile:

Like Tediore wrote: The Supervisor is a Docker container
You want install a VM within a VM and in case of containers it’s the same. This can work but it’s a very bad solution. So for me it’s understandable now. :slight_smile:

I think I am not the only one that uses the Pi for more things like PiHole or something else. PiHole was installed directly but I deployed it as a Container because I can do more things with the Pi simultaniously. I don’t want a Pi dedicated for HA now. Also the Pis got very expensive actually.

Let’s see. If I will do more with HA I will buy another one.

Again: I recommend to not start a container in a container. Containers should be started paralelly and not within each other.

Use a dedicated Pi or if possible start the Add-Ons as container paralelly to the HA container.

2 Likes