New container not responding to Port 8123

I am spinning up a new docker container on my raspi 5 (raspi.voh.haus). When i run docker compose up the container comes up without errors. However when I browse to raspi.voh.haus:8123 it times out. When I run nc -zv raspi.voh.haus 8123 it times out. When I nc to 22 or 80 it succeeds and raspi.voh.haus is pingable.

Any suggestions of where I can look for why I can’t access the web interface?

My docker-compose.yml

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - ./config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    network_mode: host
    cap_add:
      - NET_ADMIN
      - NET_RAW
    environment:
      TZ: America/Los_Angeles

my sudo ufw status numbered

Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 22/tcp                     ALLOW IN    Anywhere                  
[ 2] Nginx Full                 ALLOW IN    Anywhere                  
[ 3] 22/tcp (v6)                ALLOW IN    Anywhere (v6)             
[ 4] Nginx Full (v6)            ALLOW IN    Anywhere (v6)

my other containers on the raspi running on different ports are responsive and available.

Have you tried ip:8123?

Is the container running? did it stop?

yep. same issue. I can ping the ip, I can’t nc the port of homeassistant but I can nc the ports of my other services.

What’s ss -lntp | grep "8123" say? Does it work if you disable UFW?

LISTEN 0      128          0.0.0.0:8123       0.0.0.0:*          
LISTEN 0      128             [::]:8123          [::]:*

I also tried sudo netstat -tulpn and for the 8123 port I get

tcp        0      0 0.0.0.0:8123            0.0.0.0:*               LISTEN      355366/python3  

not PIDnumber/docker-proxy like my other docker ports. Is there a way to change the port of home assist? It may be a conflict with another process.

You didn’t answer my second question. You can via server_port but I recommend against it.

That did it. Disabling it and it worked. When I re-enabled it it still worked.

actually no. As soon as I re enable the firewall it stops working. I need to have the firewall enabled so it is not a long term solution.

I’m not very familiar with UFW but try

sudo ufw allow 8123/tcp

HA does a lot of stuff networking wise (hence why it uses host networking mode) so you need to see what else it needs to be allowed.

That does it. Thanks!