Issue initialising Docker container

Hi! New to Docker and Home Assistant. Ive followed the pretty simple install steps here, but I’m unable to access HA via http://[host]:8123.

I get the following error message in the logs:
WARNING (MainThread) [homeassistant.components.ssdp] Failed to setup listener for 0.0.0.0: [Errno 98] Address in use

I’m not quite sure if this helps, but I saw someone with a similar issue post the output of sudo lsof -i :1900 for troubleshooting:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
docker-pr 130924 root 4u IPv4 456483 0t0 UDP *:1900
docker-pr 130929 root 4u IPv6 461008 0t0 UDP *:1900

Thanks in advance!

Full Docker HA logs:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
WARNING (MainThread) [homeassistant.components.ssdp] Failed to setup listener for 0.0.0.0: [Errno 98] Address in use

Something is already using port 1900 on your host system.

Thanks - I believe it’s Plex. In my docker-compose.yml, Plex ports are configured as per Plex bridge networking documentation:

ports:
  - "$32400:32400/tcp"
  - "3005:3005/tcp"
  - "8324:8324/tcp"
  - "32469:32469/tcp"
  - "1900:1900/udp"
  - "32410:32410/udp"
  - "32412:32412/udp"
  - "32413:32413/udp"
  - "32414:32414/udp"

How would I configure HA to use a different port instead? (and is this the right way to solve the conflict?)

SSDP is 1900, no way around it.
Pretty sure SSDP is more useful for HA than for plex…

Since your not great with docker I recommend installing portainer to help you with docker container management, iodate and troubleshoot

What you need to do is set Plex or HA to use other port on host for 1900

-p 1901:1900 added to docker run command or modify compose file. Portainer allows you to do this a little easier

ports:
  - "32400:32400/tcp"
  - "3005:3005/tcp"
  - "8324:8324/tcp"
  - "32469:32469/tcp"
  - "1901:1900/udp"
  - "32410:32410/udp"
  - "32412:32412/udp"
  - "32413:32413/udp"
  - "32414:32414/udp"
1 Like

That won’t work, or at least it won’t allow both containers to receive the packets, if that’s the goal.
SSDP is a multicast udp protocol on port 1900. Exposing 1901 in place of 1900, the container just won’t receive the packets.

Not the goal
Actually Not sure 1900 needed for Plex for most functionality and can just not use

Then just do not map the port :wink:

1 Like

Thanks everyone for the input. @koying you’re correct in thinking 1900 isn’t important for Plex (as per Plex documentation), so I’ve unmapped the port from Plex which has solved the HA conflict.

While the warning no longer appears, unfortunately this hasn’t solved the root issue - and I still cannot access HA via http://[host]:8123.

I see ERR_CONNECTION_TIMED_OUT.

Full HA Docker logs:

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.

Show your compose file, please

Sorry, it’s now working - I had to allow incoming connections from my laptop in ufw.

Out of curiosity (possibly silly question) - why do I need a ufw rule to enable access to my HA container, when I’m able to access other Docker containers via http://[server-IP]:[port] without allowing access?

The only difference I can see is HA running in Host mode, whereas my other Docker containers are running in Bridge - but I don’t know why that would make a difference!

Thanks @tmjpugh - I’m using Portainer and it’s very helpful.

Hi MD,
I’ve just tried to install HA into Docker on a laptop running Ubuntu. I seem to have a similar issue to that described in your post - was your ufw fix fairly easy to implement?
Thanks,
Alan