Here I have 2 methods for running portainer on windows, a quick, preferred method only requiring a fairly recent version of docker, or a more complicated method to try if that does not work.
This setup will let you run Portainer on windows by using the docker.for.win.localhost endpoint.
Please note:
- This will expose your docker API, without TLS, publicly from your machine.
- For more advanced config see the portainer docs.
Docker settings -> General -> Expose docker daemon on tcp://...
The only trick here is to use this endpoint: tcp://docker.for.win.localhost:2375
.
Powsershell (admin):
docker volume create portainer_data
docker run -d -p 3040:9000 --name portainer --restart=always -v portainer_data:/data portainer/portainer --no-auth -H tcp://docker.for.win.localhost:2375
docker run -d -p 3040:9000 --name portainer --restart=always -v portainer_data:/data portainer/portainer -H tcp://docker.for.win.localhost:2375
Go to http://localhost:3040
Powsershell (admin):
docker stop portainer
docker rm portainer
docker rmi portainer/portainer
docker volume rm portainer_data
This setup will let you run Portainer on windows by using a loopback address.
Please note:
- Working with (current) Docker version 2.1.0.1, Windows 10 Build 18362.
- YOU NEED TO BE ON LINUX CONTAINERS, this will not work on windows containers.
- This will expose your docker API, without TLS, publicly from your machine.
- For more advanced config see the portainer docs.
Docker settings -> General -> Expose docker daemon on tcp://...
ipconfig -> Ethernet adapter vEthernet (DockerNAT): -> IPv4 Address -> eg: 10.0.75.1
This will be referred to as $DockerAddress
.
Powsershell (admin):
netsh interface portproxy add v4tov4 listenaddress=$DockerAddress listenport=2375 connectaddress=127.0.0.1 connectport=2375
Powsershell (admin):
netsh advfirewall firewall add rule name="Docker" dir=in action=allow protocol=TCP localport=2375 enable=yes profile=domain,private,public
OR, Manual version, create new firewall rule:
Firewall inbound rule:
Rule Type: Port
Protocol and Ports: TCP, 2375
Action: Allow
Profile: Domain, Private & Public
Nname: docker-portainer
Edit Rule
Scope, Remote IP address: 127.0.0.1
If the above steps were done correctly you should be able to see the docker API exposed on http://127.0.0.1:2375/ and http://10.0.75.1:2375/ (will just return a {"message":"page not found"}
response).
Powsershell (admin):
docker volume create portainer_data
docker run -d -p 3040:9000 --name portainer --restart=always -v portainer_data:/data portainer/portainer
Go to http://localhost:3040 and add your endpoint (endpoint is: $DockerAddress:2375)
Powsershell (admin):
docker run -d -p 3040:9000 --name portainer --restart=always -v portainer_data:/data portainer/portainer --no-auth -H tcp://$DockerAddress:2375
Go to http://localhost:3040
Powsershell (admin):
docker stop portainer
docker rm portainer
docker rmi portainer/portainer
docker volume rm portainer_data
netsh interface portproxy reset
netsh advfirewall firewall delete rule name="Docker"