Docker Swarm Cheat Sheet/Initialize swarm

Initialize the current engine as a swarm manager.

Section: Swarm Basics

Initialize swarm

bash
bash
docker swarm init
Explanation

Starts the control plane and prints worker join instructions.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Swarm Basics
Initialize swarm with advertise address
Initialize swarm and advertise a specific manager IP.
OpenIn sheetbashsame section
Join a swarm
Join a node to an existing swarm.
OpenIn sheetbashsame section
Leave the swarm
Leave the current swarm.
OpenIn sheetbashsame section
Show worker join token
Show or rotate the worker join token.
OpenIn sheetbashsame section
Show manager join token
Show or rotate the manager join token.
OpenIn sheetbashsame section
List swarm nodes
List nodes in the swarm.
OpenIn sheetbashsame section