How to Install Docker Swarm on Windows 10

Docker Swarm is a clustering and orchestration tool for Docker containers. In this tutorial, we will learn how to install Docker Swarm on Windows 10.

Prerequisites

Steps

  1. Download and install Docker Desktop for Windows from the Docker website.

  2. Open Docker Desktop for Windows and navigate to the Settings menu.

  3. Select the Kubernetes tab and uncheck the checkbox labeled Enable Kubernetes.

  4. Select the Swarm tab and check the checkbox labeled Enable Docker Swarm.

  5. Set the number of managers and workers that you want in your Swarm cluster.

  6. Click on Apply & Restart to save the changes and restart Docker Desktop.

  7. Once Docker Desktop is restarted, open a PowerShell terminal and run the following command to initialize a new Docker Swarm:

    docker swarm init
    

    This command will initialize a new Docker Swarm with the current Docker host as the manager node.

  8. Copy the output of the docker swarm init command as it contains the command to join the workers to the Swarm.

  9. In order to join a worker node to the Swarm, open a PowerShell terminal on the worker node and run the command that was copied from the output of the docker swarm init command in step 8.

  10. Once the worker node has joined the Swarm, you can verify the status of the Swarm by running the following command on the manager node:

    docker node ls
    

    This command will display a list of nodes in the Swarm cluster.

Conclusion

In this tutorial, we learned how to install Docker Swarm on Windows 10 using Docker Desktop for Windows. We also learned how to initialize a new Swarm and join worker nodes to the Swarm. With Docker Swarm, you can easily create and manage a cluster of Docker containers.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!