Deploying Portainer on a Windows 2016 or 2019 Swarm Cluster

By popular demand, i will quickly show you the process to get Portainer and the Portainer Agent running in a Docker Swarm environment atop Windows Server 2016 or 2019.

Deploying Portainer and the Portainer Agent to manage a Windows 2016 (1803) or Windows 2019 (1903) Swarm cluster is easy !

This procedure ONLY works if you are running Docker EE 19.03.5 or later, so if you are not, update before continuing.

First step, make sure the required network ports are open on your Docker hosts (all of them). Reboot the hosts after running these commands.

netsh advfirewall firewall add rule name="cluster_management" dir=in action=allow protocol=TCP localport=2377
netsh advfirewall firewall add rule name="node_communication_tcp" dir=in action=allow protocol=TCP localport=7946
netsh advfirewall firewall add rule name="node_communication_udp" dir=in action=allow protocol=UDP localport=7946
netsh advfirewall firewall add rule name="overlay_network" dir=in action=allow protocol=UDP localport=4789
netsh advfirewall firewall add rule name="swarm_dns_tcp" dir=in action=allow protocol=TCP localport=53
netsh advfirewall firewall add rule name="swarm_dns_udp" dir=in action=allow protocol=UDP localport=53

Second Step, deploy Portainer and its Agent on Windows:

$ curl https://downloads.portainer.io/portainer_windows_stack.yml -o portainer_windows_stack.yml
$ docker stack deploy --compose-file=portainer_windows_stack.yml portainer

You'll now just need to access the port 9000 of the Docker engine where portainer is running using your browser. Note that due to a design constraint, you cannot open Portainer from the Windows Server UI, you must access from a remote workstation.

 


Leave a comment!

All fields marked with an asterisk* are required.