Docker? yes
Docker run, not compose but I could
HA container is in “my-main-net” not host. (Portainer is using the “my-main-net” network as well.
It is indeed an internal bridge network. Not sure why Portainer can be accessed but not Homeassistant. I think the problem lies with the installation not setting up listening ports. I will try to wrestle with that or figure out what ports HA needs to have open.
Host networking mode opens every port between the host and the home assistant container, and removes any network isolation between home assistant and the host. Portainer won’t show ports, because every port is open. You also can’t specify a network for a container in host networking mode, because it uses the network settings of the host. So, you need to remove the line
network= my-main-net
You also need to access home assistant by spelling out the IP, NOT container name. If the host is at 192.168.0.156, your home assistant would be at http://192.168.0.156:8123
When you specify host networking mode, but still can’t access home assistant by the ip of the machine:8123, it can mean docker isn’t set up properly. It can also be a firewall or conflict with some other process on the host machine.
Since you’re running on Ubuntu, did you follow the extra docker post install steps? Can you run docker commands without using sudo?
Also make sure you don’t have multiple versions of docker installed.