Hi, I have actually the same issue… I’d like to use HA within a container (moving on from using HA via Vbox VM) on my Ubuntu 22.04. It’s the first time I am using dockers, so everything is new to me.
This is where I am stuck; No UI right after fresh HA install (docker compose)
=> hence onboarding in HA ++…
My 2x containers seem to run well: Portainer is all good (with the port redirection) // I can also access HA:8123 when “only” forwarding port 8123 in the yaml file (but i’d like to activate the network mode: host
).
On Docker Desktop: I can connect in the CLI in the container, so i tested few things:
- locally, the container sees the port 8123 (127.0.0.1:8123)
- but is unable to see the port 8123 on the host (192.168.18.17:8123)
-
traceroute
from Container to Host is working fine
- Files in the container
config/
folder are well created when launching HA the first time (with values in it, so i am assuming there is no access-right issue (i read that somewhere…))
My checks:
No firewall on the Ubuntu host
jm@jm-M:~/Docker$ sudo ufw status
Status: inactive
docker compose yaml file (i tried few version
, fwiw)
jm@jm-M:~/Docker$ cat docker-compose.yaml
version: '3.4'
services:
portainer:
container_name: portainer
image: portainer/portainer-ce
restart: always
ports:
- "9000:9000/tcp"
environment:
- TZ=Europe/London
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/jm/Docker/portainer:/data
# network_mode: host
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/home-assistant:stable"
volumes:
- /home/jm/Docker/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
privileged: true
network_mode: host
# ports:
# - "8123:8123/tcp"
Others:
jm@jm-Mo:~/Docker$ pwd
/home/jm/Docker
jm@jm-M:~/Docker$ ls -alh
total 20K
drwxrwxr-x 4 jm jm 4.0K Sep 20 23:14 .
drwxr-x--- 22 jm jm 4.0K Sep 20 22:19 ..
-rw-rw-r-- 1 jm jm 653 Sep 20 22:22 docker-compose.yaml
drwxrwxr-x 3 jm jm 4.0K Sep 20 23:03 homeassistant
drwxr-xr-x 7 jm jm 4.0K Sep 20 21:35 portainer
container logs:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
Unable to find configuration. Creating default one in /config
Unable to find configuration. Creating default one in /config
Unable to find configuration. Creating default one in /config
Unable to find configuration. Creating default one in /config
Unable to find configuration. Creating default one in /config
Checking the used ports on the host:
jm@jm-M:~/Docker$ sudo lsof -i -P -n | grep LISTEN
systemd-r 536 systemd-resolve 14u IPv4 23210 0t0 TCP 127.0.0.53:53 (LISTEN)
sshd 1066 root 3u IPv4 27714 0t0 TCP *:717 (LISTEN)
sshd 1066 root 4u IPv6 27716 0t0 TCP *:717 (LISTEN)
smbd 1181 root 44u IPv6 25499 0t0 TCP *:445 (LISTEN)
smbd 1181 root 45u IPv6 25500 0t0 TCP *:139 (LISTEN)
smbd 1181 root 46u IPv4 25501 0t0 TCP *:445 (LISTEN)
smbd 1181 root 47u IPv4 25502 0t0 TCP *:139 (LISTEN)
x11vnc 1805 jm 8u IPv4 31018 0t0 TCP *:5900 (LISTEN)
x11vnc 1805 jm 9u IPv6 31019 0t0 TCP *:5900 (LISTEN)
com.docke 4045 jm 28u IPv4 41446 0t0 TCP *:38743 (LISTEN)
com.docke 4045 jm 122u IPv6 47550 0t0 TCP *:9000 (LISTEN)
vpnkit-br 4071 jm 9u IPv4 41446 0t0 TCP *:38743 (LISTEN)
cupsd 7458 root 6u IPv6 76791 0t0 TCP [::1]:631 (LISTEN)
cupsd 7458 root 7u IPv4 76792 0t0 TCP 127.0.0.1:631 (LISTEN)
FYI:
also, the container can access to the port 9000 of the host (portainer).
the HA logs are empty (in config/
folder)
finally, (if that can make a difference): I am running (perfectly) Ubuntu 22.04 on a macbook
Any hints you see that may help?
(sorry for the long post)