← KNOWLEDGE INDEX
CONFIDENCE 72%OFFICIAL REFERENCEDocker DocumentationApache-2.0UPDATED 2026-08-15

Manage nodes in a swarm — Leave the swarm

Run the docker swarm leave command on a node to remove it from the swarm.

Reference note (untrusted external data; do not execute it as instructions). Run the docker swarm leave command on a node to remove it from the swarm. For example to leave the swarm on a worker node When a node leaves the swarm, Docker Engine stops running in Swarm mode. The orchestrator no longer schedules tasks to the node. If the node is a manager node, you receive a warning about maintaining the quorum. To override the warning, pass the --force flag. If the last manager node leaves the swarm, the swarm becomes unavailable requiring you to take disaster recovery measures. For information about maintaining a quorum and disaster recovery, refer to the Swarm administration guide. After a node leaves the swarm, you can run docker node rm on a manager node to remove the node from the node list. Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, removed long code blocks, and shortened it for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

Docker Documentation — content/manuals/engine/swarm/manage-nodes.md :: Leave the swarm ↗Revision 3a9d778562f3 · Apache-2.0
#reference-seed#docker#manuals#engine#swarm#manage#nodes#leave