Unable to connect to port 8123

After a brand new installation of image: “Package home-assistant · GitHub
looking at
Alternative - Home Assistant

no problem in booting, but unable to connect to port 8123.
where to go to dig into the logs to get a clue of the problem?
I’m on Mac and
netstat | grep 8123 is empty

Docker Desktop 4.29.0 (145265) is currently the newest version available.

docker log :
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

Thanks for your help.

Do you mean 8123?

run

docker ps

in terminal to see is container running and if it is on what port does it listen.

yes of course !
I am dyslexic :slight_smile:

docker ps
CONTAINER ID   IMAGE                                          COMMAND        CREATED       STATUS                 PORTS                                                                                        NAMES
dc6da035557d   ghcr.io/home-assistant/home-assistant:latest   "/init"        3 hours ago   Up 3 hours                             

no port !

because you are running it in host mode.

sudo netstat -tunlp | grep 8123

should give you info is something listening on that port.

it’s empty

then you will have to post you configuration here. Are you running it in docker or docker compose ?

with docker compose

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:latest"
    volumes:
      - /Users/proux/ha/config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
#    restart: unless-stopped
    privileged: true
    network_mode: host

I dont see anything wrong with it. Have nearly the same config but i dont use privileged.
For testing purposes do

# network_mode: host
ports
  - 8123:8123

and do docker compose up -d
Container should be now listen to port 8123.
If it doesnt you could try

docker compose up -d --no-deps --build homeassistant

to rebuild image.

MBM3-PROUX:ha proux$ docker compose up -d
WARN[0000] /Users/proux/ha/docker-compose.yml: `version` is obsolete 
[+] Running 2/2
 ✔ Container homeassistant                                                  Started                                                                                                                                                                    0.0s 
 ! homeassistant Published ports are discarded when using host network mode                                                                                                                                                                            0.0s 
MBM3-PROUX:ha proux$ docker compose up -d --no-deps --build homeassistant
WARN[0000] /Users/proux/ha/docker-compose.yml: `version` is obsolete 
[+] Running 1/0
 ✔ Container homeassistant  Running             

and

netstat -tunl | grep 8123

is empty

try version 3.8

Disable in yaml file host mode like

# network_mode: host

OK, it’s run …

version: '3'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:latest"
    volumes:
      - /Users/proux/ha/config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
#    restart: unless-stopped
    privileged: true
#    network_mode: host
    ports:
      - 8123:8123

You will have to play a bit with it. If things go south rebuild image and that is basically it.

Thanks !
JPP

After you gain a better understanding of docker, change your docker networking to MacVlan.

It provides docker container with its own IP/MAC using your hosts network adapter and will help deal with discovery issues you will soon be scratching your head over. I wouldn’t do this for all containers. Just HA really.

1 Like