How to Install Docker Swarm on Debian Latest

This tutorial will walk you through the steps to install Docker Swarm on Debian Latest. Before proceeding, make sure that you have a Debian Latest system with administrative privileges.

Step 1: Install Docker

To install Docker on your system, run the following commands:

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release -y
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io -y

Step 2: Initialize Docker Swarm

Once Docker is installed on your system, initialize Docker Swarm by running the following command:

sudo docker swarm init

This command will create a Swarm manager and Swarm worker node on your host.

Step 3: Join Swarm Nodes

If you want to add additional nodes to your Swarm, use the following command on each individual machine:

sudo docker swarm join --token <TOKEN> <IP_ADDRESS>:2377

Replace with the token output from the docker swarm init command and with the IP address of your Swarm manager.

Step 4: Verify Swarm Cluster Status

To verify the status of your Swarm cluster, run the following command on your Swarm manager:

sudo docker node ls

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

Congratulations! You have successfully installed Docker Swarm on Debian Latest and created a Swarm cluster. You can now deploy and manage containers on your Swarm cluster.

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!