Home assistant w/ docker, share experience

Hi everyone,
I’m currently using Home Assistant in VirtualBox on a Linux server, but I’m experiencing a lot of issues due to unexpected crashes. The virtual machine stays up, but it’s completely inaccessible and unresponsive.

It might be caused by some integrations that are crashing Home Assistant, but I’m not sure. I’d like to switch to a Docker installation, also because when I restart the server, the service sometimes doesn’t start automatically and I have to manually access the server to launch it. With Docker, services usually start up automatically, which is a big plus.

Is it more complicated to handle DNS and other configurations with Docker?
Does it cause more problems when using Cloudflare for remote access?
Are there any major downsides to switching?

Thanks!

Are you familiar with docker, and with Linux administration in general?

You cannot use addons with a docker installation.

Linux in general yes, docker I know the basic.
Zero addons at all?

Addons are only supported in HAOS and Supervised install. Supervised brings its own lot of complications, so I wouldn’t recommend it.

And how do you do without addons?

Individual docker containers. Addons are just special case containers. You would get the docker version of whatever addon you’re looking for. So ensuing they’re available would be part of your planning

So I need to install addons as docker container and somehow connect it with HASS?
It seems pretty complicated :frowning:

Yep. Its a different animal.

You should also look at different virtualization platforms besides virtualbox in your search.

ok, then I think I remove some stuff from my installation and try to move it to a different vm.
Finally I will go with yellow or green if nothing works

If you move platform consider an x64 powered minipc instead of a pi, yellow or green. Pi lost the price performance battle a long time ago. You get way more compute for your money.

Good luck

2 Likes

I already have a nuc with ryzen 5 xD

1 Like

It’s not really that complicated.

most add-ons/docker containers provide extra functionality outside of HA that HA then ties into to leverage that functionality.

take for example zwavejs.

all the add-on does is create a zwave server that you configure access to within HA. the docker container does exactly the same thing and you will have to tell HA to use it the same way you would the add-on. there might be an extra step or two but it’s usually nothing too much more complicated than running an add-on.

the only difference is that with add-ons there is a dedicated method in HA to install them on your server (not necessarily to connect them to HA tho), configure them and update them as needed. in regular docker you’ll need to do that outside of HA yourself. But again it’s not that difficult.

Do you mind to pinpoint some tutorial/guide that you used?
Im trying right now, and the creation and boot is super fast :slight_smile: but I have some devices that rely on MQTT mosquito, HA skills and other addons
Thanks

it depends on the add-on you need to reproduce but I always start with the documentation on docker hub or whatever repo you get the image from.

1 Like

Once it’s working, move to docker-compose as it makes the setup repeatable.

I run HA, zwavejsui, MQTT and MariaDB as containers.

I started with the HA container running in host networking mode. Later on I setup a docker network and put all the containers on this. This way I could spin up multiple HA system. Eventually I moved HA back to the host network as there were too many things that would not work well (Sonos, iphonedetect)

Docker-compose allows you to describe your containers, folders, devices and dependencies in a config file. This makes it super easy to rip down and stand back up.

Yesterday I did install docker compose and test it out… Really helpful.
Never heard about a docker network, gpt said that is like a network where you can have all your containers and refer to it with a name instead of ip. The downside of this is that some integration need a real network stuff in order to work (in my case I have a lot of integrations of different brand).
So the hosting networking mode is just the typical/standard network? Boot the docker with port:port/tcp right?
I have zigbee, mqtt, esphome, some cinese stuff, meross, ikea (zigbee), other cinese stuff. Not too many protocol though

HA basically requires Host networking, if only for auto-discovery to work.
That binds HA to the physical network card.

It is not the “port:port/tcp” stuff, which is bridge mode.

Ok so --network=host is the way and not the bridge one correctly?