[SOLVED] Fresh install on NUC with Docker, can't connect to 8123

So, after a lot of searching around why I can’t connect to HA on my NUC, I just reinstalled the NUC from scratch. Steps:

  • Install Ubuntu
  • Enable SSH
  • Install Docker
  • Install Docker-Compose
  • Install Portainer
  • Install Home Assistant using instructions found here for container

Nothing else.

Trying to connect to http://NUC-IP:8123, no answer. Any idea what could be wrong? As this is a fresh install on the NUC, I would narrow it down to a network configuration issue? But I do have another instance of Home Assistant running on a Raspberry Pi without problems…

1 Like

hello
is your hassio container up?
is it in network_mode: host ?
or if is in a nother network ,do you have open the ports: - 8123 in your container/compose-file?

1 Like

From what ip source addres are you coming? What ip adress has you device you are trying to go to HA?

1 Like

Hi guys, thanks for your answers. I should have been more precise :upside_down_face:

This is actually my second attempt to get HA running in a Docker container on a NUC. Previous attempt, the NUC was already running PiHole and Portainer, each in a container, and also some stuff like a VNC server on the host. As I fiddled with the network settings of the host to configure PiHole, I decided to do a fresh install without PiHole nor VNC, just to rule out some problem that could be coming from there.

Basically, after installing HA in a container as described here, I can’t access it on port 8123. Of course, I can publish it manually using

ports: 
  -8123:8123

and this will work. But my understanding is you need to use

network_mode: host

in order to have auto discovery working. And also that you can’t have both ports and network_mode at the same time.

But then, when I check in portainer, there are no published ports for this container…
I don’t know what I am missing here?

And yes, the NUC is otherwise accessible. I can SSH into it and Portainer is accessible on port 9000.

SOLVED ! I found the solution in this reddit. Not sure if this is Ubuntu specific, but adding the following rule to the firewall solves the problem:

ufw allow from 192.168.178.0/24 to any port 8123

(of course with the right IP range for your network).

I’m not an Ubuntu, Docker or firewall guru, so I am wondering why this is needed when using network_mode: host, but not when exposing the port using ports:?

Anyway, this seems to work !

1 Like

when you are in network_mode host, you don’t have to publish ports.you are under the same ip than the host, with ports from the host
when you are in ‘bridge_mode’ you will have a container’s ip 172.x.x.x and u have to open ports.
I’m under debian there is no ufw installed and i havn’t to configure iptables.(ufw configure iptables)

1 Like

Hence my question :-). Glad its solved!

1 Like