Enable remote access to Docker for Windows 10

Enable remote access to Docker for Windows 10

With the release of Docker for Windows 10, more and more users are wanting to experiment, and many want to use Portainer as a UI to manage the Docker daemon.

Unfortunately, Docker to make exposing the Daemon externally all that straight forward, so I will show you how its done (note that I DO NOT recommend exposing the Daemon without any TLS authentication, you should always configure your Daemon with TLS to ensure only authorised people can manipulate your Docker Daemon):

First up, install Docker for Windows 10, and switch to Windows Containers (assuming thats what you want).

Start Docker, and then right click on the whale icon in your task bar and select "settings"

Enable_remote_access_to_Docker_for_Windows_10-01

You can now see a tick box labelled "expose daemon on tcp://localhost:2375 without TLS. This may or may not be enabled, but if it is, dont be fooled, it still wont let you manage Docker remotely

Enable_remote_access_to_Docker_for_Windows_10-02

Enable_remote_access_to_Docker_for_Windows_10-03

Instead, you can only use the loopback address; which is really of no use.

Enable_remote_access_to_Docker_for_Windows_10-04

So, go back into Docker Settings, and make sure that "expose daemon on TCP is NOT checked", then click on "Daemon"

Enable_remote_access_to_Docker_for_Windows_10-05

Click on the switch "Basic" so that it switches to "Advanced"

Enable_remote_access_to_Docker_for_Windows_10-06

Now, you need to make changes... edit the text area in the bottom so it looks like the pic below (note the addition of a "," after "false". Then click "Apply"

Enable_remote_access_to_Docker_for_Windows_10-07

go back to the command prompt, and you can now query the daemon using the Hosts normal IP.

Enable_remote_access_to_Docker_for_Windows_10-08

To ensure that you can access the daemon remotely, run the following command to update the windows firewall:

netsh advfirewall firewall add rule name="docker_daemon" dir=in action=allow protocol=TCP localport=2375

And to start Portainer for Windows on this environment:

docker run -d -p 8000:8000 -p 9000:9000 -v portainer_data:C:\data --restart=always --name=portainer portainer/portainer


5 Comments

  1. Good POST very helpful.

    Reply


  2. This no longer works in the current version. They have blocked “hosts” from being used in docker desktop that runs on hyper-v back end.

    Reply


  3. Neil Cresswell

    I have just retested this. using Windows 10 Enterprise, 1903, Docker Desktop ver 2.1.0.1.

    Setting my environment to Windows Containers, and then following the guide works perfectly.. Note that the guide is for WINDOWS containers, not Linux.

    For Linux, you are correct that hosts cannot be used. The way to get around this is to use Portainer locally on your desktop instance, or use the Portainer agent (which uses the Docker Socket).

    Reply


  4. Brandon Snuggs

    If you are trying to fix the port loopback issue for a Windows Host/Linux Containers, there are some solutions offered here:

    https://github.com/Microsoft/Docker.DotNet/issues/109

    https://youtrack.jetbrains.com/issue/WI-32733#comment=27-1549346

    Reply


  5. Big Big Thanks for your Post, I Struggle with this matter 3 hours, Very Thanks!

    Reply


Leave a comment!

All fields marked with an asterisk* are required.