Best installation method on windows

Hi, I have a Windows server at home and I can install on it either Windows Server 2016 or Windows 10.

I know Windows isn’t the best solution to install HA, but I have another program needing windows and I can’t use another OS. Moreover since on Windows you have multiple way to install it, I would like to know which is the best before start to install.
I don’t want to have too much issue on that.

I can install directly on windows, by installing Python, or it is better using the linux subsystem or docker?
I could also virtualize a linux os but the host isn’t powerful enought

thanks

I’ve been looking into this myself,
conclusion is that Docker for Windows is the most futureproof option.
If you’re running Windows 10 Pro.

The only caveat for us noobs is : no one has made a proper tutorial or step-by-step for getting Home Assistant up & running on Docker for Windows.

There is this : Installation on Docker , except it doesn’t explain how to install on Docker.

1 Like

Installing in Docker on Windows is just like docker anywhere else. They all use the same commands, except your volume mounts need to be in the form of Windows paths…

@flamingm0e
you speak with some level of experience with both Docker as well as Home Assistance, obviously.
To us noobs an example helps way more than a description of how something is supposed to work.

So, would you mind showing your (redacted to protect the innocent) command line for starting the container?

Thanks for your input!

I don’t run Docker on Windows for my home assistant setup. I run docker on Windows at work for work things.

Once you’ve installed Docker, you just use the instructions found on the home assistant website.

You don’t have the same volume binds in Windows though.

I don’t know what exactly you’re looking for. It’s a very simple one line command to get a Docker running. If you just want to test it, run the normal docker command for home assistant and remove the pieces from the command that start with a -v and remove the net=host, replace net=host with -p 8123:8123

The default docker cmd as per docs is
docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant

the docker cmd i’m putting together is shaping up to be

docker run -d --restart always --name="home-assistant-0.62.1" -v D:\Docker\homeassistant_data:/config -v /etc/localtime:/etc/localtime:ro -p 8123:8123 homeassistant/home-assistant

Of course the volume binds are personal, but what is up with
-v /etc/localtime:/etc/localtime:ro
For MacOS, this needs editing, how about for Windows ??

Doesn’t it make sense to add the version number to the container name, so that a roll-back would be more simple in case of a botched update ?

In a home automation scenario, why aren’t we doing --restart always ??

If we replace --net=host with -p 8123:8123
do we then still need
netsh interface portproxy add v4tov4 listenaddress=192.168.1.10 listenport=8123 connectaddress=10.0.50.2 connectport=8123 netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=8123 connectaddress=10.0.50.2 connectport=8123
?

not needed for Windows, there is no /etc/localtime in Windows

I always run ‘latest’ on mine, because a roll back is simply the same command but adding the version after it. It might take a few minutes to restart because it has to download a tagged image, but I have only had to do this one time in the last 8 months of running Home Assistant.

You can if you want. I do --restart unless-stopped on my containers

based on my experience, I have never had any issues just passing a port through like normal. The best way would be to try it without making those changes and see if it works. If it doesn’t work, it’s not like you are breaking anything…just experiment.

@flamingm0e : Great stuff! Thanks! Can’t speak for OP, but for me you’ve certainly flattened the learning curve somewhat .
:ok_hand:

If you are curious how I run my home assistant on my Docker host (it runs Alpine Linux on the host) here is my command:

docker run -d --name="home-assistant" --privileged --restart unless-stopped -v /dev/ttyACM0:/dev/ttyACM0 -v /srv/docker/hass-config:/config -v /etc/localtime:/etc/localtime:ro -v /srv/docker/hass_media:/media --net=host homeassistant/home-assistant:latest

Docker would be best, except you can’t use USB sticks with Docker on Windows.

Did You get this running?
How about things on USB (like z-stick or something alike)

i gave up on docker for windows, too many complications with the networking side. Maybe things have changed since February, but I’m not inclined to dig into it again.

Since USB pass-through isn’t in my usage case, I went for Hyper-V + Hass.io

For Windows + Z-Wave USB stick I have been using an installation of VirtualBox+Ubuntu Server+Docker+HASS.IO, works beautifully.

1 Like

Thanx! I’ll try that!

Are you using docker-compose? Could you please share your install files?

As his post indicates, he is using Ubuntu running inside virtual box, with docker installed in Ubuntu, and he ran the hassio Linux install script. It runs hassio in a normal docker environment without the need to install it on a pi. It also removes the problem that windows has with docker and networking.

Sounds like he is running Windows as the host OS and using VirtualBox as the VM instead of Hyper-V, no?

Correct. Because pass through of hardware on hyper-v is non-existent

That’s exactly what I’m doing :slight_smile:

So how are you using docker? Are you setting up an Ubuntu container and then installing hassio? Are you mounting your HA config files on an external volume? Could you please share your scripts, etc to get this going? Sounds like exactly what I want to do.