Unable to Access Web UI - Docker on Windows

So I’ve successfully pulled the docker image and I can get HA to create files in my config directory, but I’m unable to access the web UI from anywhere including the host machine. Host machine is running Windows 10 Pro w/Docker version 18.03.1-ce-win64 (17438). I’ve tried both localhost:8123 and [docker IP]:8123 with no success. There are other containers that I run that I can access via the web with no problems. The docker container is running at least… here’s the command I used:

docker pull homeassistant/home-assistant
docker run -d --network=host --name home-assistant -v C:\home_assistant\config:/config homeassistant/home-assistant

I’ve also tried:

docker run -d -p 8123:8123 --name home-assistant -v C:\home_assistant\config:/config homeassistant/home-assistant

I’ve seen numerous topics on this, but with no answers. Has anybody been able to get this working on W10? If so could you share your docker command or docker-compose.yml?

Look at below link under windows. Could be networking issue fixable by following suggestion

Hey, sorry, I forgot to state in my OP that I already did this. I ran the following commands via escalated command prompt:

netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8123 connectaddress=10.0.75.1 connectport=8123
netsh interface portproxy add v4tov4 listenaddress=192.168.0.105 listenport=8123 connectaddress=10.0.50.2 connectport=8123

Still not able to access the WebUI.

@drewh1991 do you ever get this resolved?

I found that I didn’t need the netsh commands if I used docker-compose to run home-assistant because this creates a network for you.

Doing this I can access home-assistant via localhost but not from any any devices on my local network.

No, I didn’t, I actually ended up just installing on an Ubuntu server vm and got it to work just fine. Thanks for sharing though, I’ll give this a whirl! It would be nice if I could ditch the VM.

Docker on Windows runs a Linux VM. You wouldn’t be getting rid of anything.

Right, I know that. But currently its in docker, in a Linux VM running on Windows 10. It would be nice if I could just run it via docker. It sounds like there is a solution to my original problem.

And again, in Windows, when you run a Linux image, it’s actually firing up a Linux VM and running docker in it. It’s literally no difference except you have more control when it’s a VM YOU manage.

Docker on Windows 10 and Windows Server 2019 can run Linux and Windows containers.

This is the docker-compose file that I use:

version: “3.7”
services:
home-assistant:
image: homeassistant/home-assistant
ports:
- 8123:8123
init: true
volumes:
- /hassio:/config
restart: always

volumes:
hassio:

To run use:
docker-compose up

2 Likes

Yes, I know.

It uses HYPER-V to create a LINUX VM that runs docker in it.

Go look for yourself.

Docker Desktop for Windows requires Microsoft Hyper-V to run. The Docker Desktop for Windows installer enables Hyper-V for you, if needed, and restarts your machine. After Hyper-V is enabled, VirtualBox no longer works, but any VirtualBox VM images remain. VirtualBox VMs created with docker-machine (including the default one typically created during Toolbox install) no longer start. These VMs cannot be used side-by-side with Docker Desktop for Windows. However, you can still use docker-machine to manage remote VMs.

Thank you Geoff for sharing!

@flamingm0e it is true that Linux containers on Windows run in a VM but docker on Windows is far simpler to install and run than setting up your own VM. It does not come with the complications of installing installing a VM such as virtual box. Then installed a flavor of Linux. Then the configuration…
More to install and more to get wrong.

I guess it is horses for courses and whatever floats your boat.

Also bear in mind that future versions of Windows will have it a ‘real’ Linux kernel and thus removing the need run a Linux contain in a VM. We will need to wait and see when this will be release and what benefits, if any, it brings to the party.

but he already has a VM set up…that was my point. It’s the same. If the “hard part” is already done (setting up the VM), then why waste time switching to something else that will literally be the same thing?

The original question was about docker on Windows. I provided a docker-compose file that works for me. I ran into the same issues and found a solution that works for me.

Like I say whatever floats your boat.

This worked for me after trying the ‘offical’ method using netsh. If I didn’t hate Git so much I would try to update the Wiki.

docker run --init -d --name="home-assistant" -e "TZ=America/Toronto" -v //c/Users/<your login name>/homeassistant:/config -p 8123:8123 homeassistant/home-assistant:stable

FYI, It appears that the network-mode: “host” doesn’t work as advertised. I had to remove that and then add ports: -“8123:8123” then it worked