Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Building a Docker Swarm

Docker swarm allows you to quickly move beyond simply using Docker to run containers. With swarm, you can easily set up a cluster of Docker servers capable of providing useful orchestration features. This lab will allow you to become familiar with the process of setting up a simple swarm cluster on a set of servers. You will configure a swarm master and two worker nodes, forming a working swarm cluster.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 16, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Install Docker CE on all three nodes.
    1. On all three servers, install Docker CE.
    sudo apt-get update
    
    sudo apt-get -y install 
       apt-transport-https 
       ca-certificates 
       curl 
       gnupg-agent 
       software-properties-common
    
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    
    sudo add-apt-repository 
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu 
       $(lsb_release -cs) 
       stable"
    
    sudo apt-get update
    
    sudo apt-get install -y docker-ce=5:18.09.5~3-0~ubuntu-bionic docker-ce-cli=5:18.09.5~3-0~ubuntu-bionic containerd.io
    
    1. Add cloud_user to the Docker group so that you can run docker commands as cloud_user.
    sudo usermod -a -G docker cloud_user
    
    Log out each server, then log back in.
    
    1. You can verify the installation on each server like so:
    docker version
    
  2. Challenge

    Configure the swarm manager.
    1. On the swarm manager server, initialize the swarm. Be sure to replace <swarm manager private IP> in this command with the actual Private IP of the swarm manager (NOT the public IP).
    docker swarm init --advertise-addr <swarm manager private IP>
    
  3. Challenge

    Join the worker nodes to the cluster.
    1. On the swarm manager, get a join command with a token:
    docker swarm join-token worker
    

    This should provide a command that begins docker swarm join .... Copy that command and run it on both worker servers.

    NOTE: If you have any trouble, on the swarm manager try: docker swarm leave --force and then docker swarm init --advertise-addr [privater ip of the swarm manager] After that, run the provided command to join the workers to the swarm.

    1. Go back to the swarm manager and list the nodes.
    docker node ls
    

    Verify that you can see all three servers listed (including the manager). All three should have a status of READY. Once all three servers are ready, you have built your own Docker swarm cluster!

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight