HASS in Docker - exposing non-standard ports

I’m trying to set up the ring-hassio addon which needs to expose port 3000. I’m already using 3000 for Assistant Relay so I have a clash. How can I forward a different port (eg 3005) from my container to home assistant? NMAP shows that 3000 is open (as expected) but 3005 isn’t, despite me configuring it in ring-hassio.

Thanks in advance!

Add a port: 3005 to the addon configuration

I already have that in there but it’s the container port I think I need to change and expose to match.

No, the container lives its own life and doesn’t care about Assistant Relay.
What matters is the port exposed to the external world, as you already did.

Did you restart the addon?

Do I not need to expose that port in my docker host? If I scan my home assistant docker VM with nmap I don’t see that port open.

Have restarted the addon (same result) - just restarting HASS for good measure.

Nevermind. Remove the “port” config, but keep the “exposition”.
Looks like the addon hardcodes the port to 3000 as far as docker is concerned.

Ah ok so that might answer my question then. I’ll see if I can raise a PR for the ring addon as I’m already using 3000 for something else.

No. Once again, the 3000 inside the container does not matter, so remove port: 3005
What matter is what is exposed (3005).

If I remove the port I get this:

Failed to save add-on configuration, Missing option 'port' in root in Ring Livestream (44c60309_ringlivestream). 

Sigh. Set port: 3000, then

Bingo! Seems I fundamentally misunderstood the container:host port relationship.

Thanks very much!

1 Like