Absolute Beginners guide to installing HA on Intel NUC using Docker

You aren’t supposed to be adding a user. You are adding YOUR user to the docker group

1 Like

I did quite the same on a Ubuntu 16.04 virtual machine. Everyhting seems fine but I can’t add Home Assistant to my Home app on the iPhone. This seems related to the fact that Docker uses NAT and I have to open a port to let the Home app talk to Home Assistant.
My problem is I can’t find the file where the docker run commad is to append a new open port. Can you tell me where is this file, and if it’s not a file how do I modify the way the Home Assistant container is launched ?

Thanks for your help
V.

It doesn’t though.

This isn’t how it works.

If you installed hassio using the script there is literally nothing to do to open a port unless your host is running a firewall, in which case you wouldn’t access it from the local network anyway.

If you follow the official documentation for home assistant in docker or if you run the hassio script, your host network is already in place.

I quite exactly did the same as here, i.e. Home Assistant in docker but not on a NUC but in a VirtualBox Ubuntu 16.04. So I have two cascading host, Ubuntu and then my computer.

Correct me if I’m wrong, If you say that I have nothing to do it’s because containers are connected to bridg0 interface, but still, in my case this only avoid blockage between docker containers or between containers and Ubuntu as they’re all connected to the bridge0 interface, but it also create iptables NAT rules for going out the Ubuntu machine and I think this is what drops packets from Apple Home app to Home Assistant.
More communications between docker bridge0 interface and the Ubuntu interface connected to the host computer is dealt by iptables NAT rules which I think is what blocks communications between Apple Home app (on the LAN) and Home Assistant (in docker container)

LAN<—>Host computer<—>Ubuntu<—>Bridg0<–>Docker Containers

$ sudo iptables --list
sudo: unable to resolve host hassio
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy DROP)
target     prot opt source               destination
DOCKER-USER  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-1  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
DOCKER     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain DOCKER (2 references)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             172.17.0.2           tcp dpt:9000
ACCEPT     tcp  --  anywhere             172.30.33.0          tcp dpt:ssh

Chain DOCKER-ISOLATION-STAGE-1 (1 references)
target     prot opt source               destination
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
DOCKER-ISOLATION-STAGE-2  all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-ISOLATION-STAGE-2 (2 references)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere
RETURN     all  --  anywhere             anywhere

Chain DOCKER-USER (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere

(see :Four ways to connect a docker container to a local network :: blog.oddbit.com).

So, if it’s not a file please tell me how do I modify the options passed to the docker run command ? How can I add a port forward ?
And for which container would it be ? homeassistant or hassio_supervisor ? which one deals with dicovery so with communications with Homekit ?

Well, in the first post in this thread, there are several OPTIONS to install. Which one did you do? The hassio script?

Again, if you installed via the hassio install script, THERE IS NOTHING TO DO WITH MODIFYING YOUR RUN COMMAND FOR NETWORK ACCESS. PERIOD.

It doesn’t matter if it’s running in a VM. As long as your VM is bridged to your network, and gets an IP address on the same subnet, you’re DONE.

Discovery is handled by home assistant. Supervisor is for docker orchestration.

Again, if you are running hassio, your entire network stack of your docker host is already being presented, and there is nothing to change about this. --net=host is already running.

I followed https://www.juanmtech.com/set-up-hassio-in-docker-and-in-an-ubuntu-server/, in which I think the key command is
curl -sL "https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh" | bash -s

I must seem a bit deaf but as I’m seeing DROP rules in IPtables I think these rules must drop something, no ? As also I see forward rules, I thought these rules were mandatory for things to work.

As suggested in

I tried changing port number (51829) and I’d like to forward this port to see if it works.

OK. Let me try this again. Running hassio, means that the network mode is already set to HOST. There is no port forwarding required. I don’t know why that seems like a difficult concept.

Here was my mistake : I used vagrant to pull my ubuntu image and as vagrant is NATed by default and I didn’t find a way to bridged the Ubuntu virtual Ethernet with my host machine real Ethernet this Nat was droping some packets.
I redid the whole thing but this time with an Ubuntu server intall (virtual) CD.
No port to forward or to specify in any config file, just homekit: in confirguration.yaml.
It just works !

Thanks for your help and clarifying things.

Hi, I have a powerful NUC (i7, 32GB RAM etc.) which I use as my main always-on PC.
Can I run Ubuntu in Hyper-V and install containers in there to have an always-running HA solution?
This way I could continue using my NUC and benefit of the fact that it’s always on.

As an alternative I have a spare Intel Compute Stick (Atom powered) I can use instead?

When updating 105.0 today i noticed i had fallen behind on HA Supervisor versions. When I was running Hass.io on the RPi, Supervisor updates were automatic. Looking at the system log, I noticed the following:

20-02-05 21:58:35 WARNING (MainThread) [hassio.dbus.rauc] Host has no rauc support. OTA updates have been disabled.

Is lack of rauc support on Ubuntu the reason for the OTA (over-the-air) Supervisor updates not occurring? If so, what steps would be necessary to enable a rauc client or server on my NUC?

THANKS, that saves my day (what’s left of it)!

1 Like

You mention this a couple of times in this thread, but isn’t it so that you either choose standalone ha on docker (still able to use the nuc for other things) or install hassio as per the guide you are linking to (making your nuc a dedicated hass machine). You know, like @piyush describes in the guide…? Like he specifically says he does not want or recommend?

As far as I can see “hassio on docker” is not a supported option

No. They changed my link. (believe it or not, a lot of things can happen and change in over a year)

It doesn’t turn it into a dedicated HASS machine.

It’s not officially called “hassio on docker”, it is now referred to as “home assistant supervised”

So if I follow the top instructions on that page, downloading the nuc image, flashing to SD card with balena etcher, I can still use the NUC for other stuff than home assistant?

I was looking into the “home assistant supervised” option, but I’m having a hard time understanding what it actually is. The disclaimer is pretty discouraging though, even going as far as saying:

In most cases, it’s not the best choice to run the Supervisord on top of a Linux, if you not 100% sure what you do. It is not just a container inside Docker!

I definitely fall in the not-100%-sure-what-to-do category, but from this text I concluded that I can’t just run hassio in a container inside docker.

NO. Follow my link in my last comment. The link I provided in the older post was from over a year ago. The URL changed and now clicking it takes you to the WRONG section.

It’s “HASSIO” running on your normal every day Linux machine…that gives you all the functionality of HASSIO, or “Home Assistant” as they like to call it now, but you have the flexibility to run whatever you want on the host OS, which is just Linux.

Well, first of all, we will all get yelled at if we say “Hassio IN Docker”, for some reason, even though that’s what it is. You are running Home Assistant Core, with the SUPERVISOR in Docker, on your Linux machine. Imagine if you take the SDCard image for Home Assistant on the PI, and you had a way to “install” just that to a NUC running Linux.

1 Like

I have a smashed surface pro 3 i5/8gb/512ssd just wondering if it was possible to do this same type of setup as this? I believe they are similar hardware, I have a USB 3.0 to Ethernet adapter that works perfectly on it in Ubuntu too so it would be hardwired of course not WiFi.

Do you use this command: sudo usermod -aG docker $USER

I’ve finished my install following these instruction on my new NUC 10 with Ubuntu 20.04. I’ve assigned and reserved a static IP for the NUC. Hass is up and running and I can access the Hass UI from the NUC’s browser.

I’m now setting up access to the NUC from my Windows desktop. I can SSH into Ubuntu. What I cannot do is pull up the Hass UI on my Windows browser. I can pull up another Hass instance on a Rpi4 from my Windows browser.

Any ideas what might be preventing me from pulling up Hass on my Windows machine?

If anything, I’d put this as a con. Having only used Home Assistant Core on Raspberry Pi so far, this is probably the only thing I’m not looking forward to about moving to an Intel NUC.

Otherwise, I’m keen to begin working through the guide!

1 Like

Great guide! Thank you!

I did a setup on a VM today using it (waiting for my NUC to be delivered) as rehersal.
I had to grant extra right to be able to install docker portainer.

sudo usermod -aG docker $US
sudo chmod 666 /var/run/docker.sock