Docker Swarm Explained: The Simple Orchestrator Built Into Docker

Docker Swarm Explained: The Simple Orchestrator Built Into Docker

Docker Swarm explained in plain terms: it is the container orchestrator built into Docker Engine, and it turns a group of Docker hosts into a single cluster that schedules containers, keeps the right number of replicas running, and routes traffic to them. You already have it if you have Docker installed, because swarm mode has shipped inside the Engine since version 1.12 in 2016. The short answer is that Swarm is the simplest way to run containers across several machines, and it is the right choice when Kubernetes would be more machinery than your system needs.

Swarm is often described as dead, which is not accurate. Swarm mode is still part of current Docker Engine releases, it still receives security and bug fixes, and Mirantis, which bought Docker’s enterprise business in 2019, has committed to supporting Swarm commercially through at least 2030 as part of Mirantis Kubernetes Engine 3. What has changed is the pace: feature development has slowed in favour of Kubernetes-based solutions, and Docker’s own documentation says so plainly. If you want the comparison with the bigger orchestrator first, our guide to Kubernetes explained covers the platform most teams choose at scale.

Key takeaways

  • Docker Swarm, or swarm mode, is the orchestrator built into Docker Engine, powered by the SwarmKit library.
  • A swarm has manager nodes that schedule work and worker nodes that run containers, with managers using the Raft consensus algorithm to stay in agreement.
  • Services declare how many replicas should run, and Swarm keeps that count, replaces failed containers and rolls out updates.
  • Swarm is maintained, with security fixes in current Engine releases and Mirantis commercial support through at least 2030.
  • Choose Swarm for small clusters and simple services; choose Kubernetes when you need autoscaling, a large ecosystem or managed offerings.

What Docker Swarm actually is

Swarm mode turns several machines running Docker into one virtual Docker host. You run one command on a manager node, join other machines with a token, and from then on you deploy services to the swarm rather than to individual hosts. Swarm decides which node runs each container, keeps the declared number of replicas alive, and gives every service a stable DNS name so the other services can find it.

Two different products share the Swarm name, and the distinction matters. Classic Swarm was the original standalone clustering tool, and it is archived and no longer developed. Swarm mode, built on the SwarmKit library, is what ships inside Docker Engine today, and it is what this article describes. When someone says Swarm is dead, they are usually repeating a claim about the old standalone product, or about the slowing pace of new features, rather than about swarm mode itself. Best for: teams that already run Docker and want clustering without learning a new platform.

Managers, workers and Raft

A swarm has two kinds of node. Manager nodes hold the cluster state, schedule services onto nodes, and watch for failures. Worker nodes run the containers they are assigned and report back. A small swarm often has one manager, but production swarms should have three or five, because managers keep their shared state in agreement using the Raft consensus algorithm, which needs a majority of managers alive to make decisions.

Raft is the reason the manager count matters. With three managers, one can fail and the remaining two still form a majority, so the swarm keeps working. With two managers, one failure leaves a single manager, which is not a majority, and the swarm can no longer schedule anything. The practical rule is simple: use an odd number of managers, three for most swarms and five for larger ones, and never run an even count. Best for: small clusters where a three-manager setup gives real resilience for very little effort.

Services, tasks and replicas

The unit of work in Swarm is the service, which declares an image, a replica count, networks, ports and update rules. Swarm turns a service into tasks, one task per replica, and assigns each task to a node. If a container crashes, Swarm starts a replacement task to restore the replica count. If a node fails, its tasks are rescheduled onto the surviving nodes.

Deploying a service is a single command, and updating one is just as simple: change the image or the replica count, and Swarm rolls the change out, replacing containers gradually so the service stays available. The default update replaces one task at a time, waiting for the new one to be ready before moving on, which gives you zero-downtime deploys without any extra tooling. For the wider field of orchestrators, see our comparison of container orchestration tools. Best for: services that need replicas and rolling updates but not the full machinery of Kubernetes.

Three identical server units in a rack with status lights, a hand connecting a network cable
A swarm spreads service replicas across its nodes, so the failure of one machine moves its work to the survivors instead of taking the service down.

Networking, load balancing and storage

Swarm gives every service a virtual IP and a DNS name on an overlay network, so containers on different nodes can reach each other as if they were on the same machine. The overlay network is created by Swarm and encrypted by default between nodes, which means service-to-service traffic does not need extra configuration to be private.

Published ports use Swarm’s routing mesh: any node in the swarm accepts traffic on the published port and forwards it to a container running the service, even if that container is on another node. This makes load balancing simple, because any node can be the entry point. Storage is the weak spot: Swarm has no built-in distributed storage, so a service that writes data needs a volume on a shared filesystem or an external storage system, and that is a piece of work Kubernetes handles more gracefully. Best for: stateless services, where the routing mesh and overlay network remove most networking effort.

Deploying a stack with Compose

Swarm’s closest friend is Docker Compose. A Compose file written for local development can be deployed to a swarm with a single command, using the version 3 format that Swarm understands. The services, networks and volumes in the file map directly onto Swarm services, overlay networks and volumes, which means the same file describes the application on a laptop and in the cluster.

There are a few differences to respect. Compose’s build instruction is ignored by Swarm, which deploys images rather than building them, so images must be pushed to a registry first. Container names and restart policies from Compose are replaced by Swarm’s own service model, and the deploy section of the file, where you set replicas and update rules, is what Swarm actually reads. Keep the file free of anything specific to one machine, and it will deploy identically to any swarm. Best for: teams that already describe their application in Compose and want the smallest possible step to multi-host deployment.

Aspect Docker Swarm Kubernetes
Setup One command, built into Docker Cluster install or managed service
Learning curve Days, if you know Docker Weeks to months
Autoscaling None built in Built in, by metrics
Service discovery Built-in DNS and routing mesh Services, ingress and DNS
Ecosystem Small, Docker-focused Very large, many vendors
Managed offerings Mirantis MKE 3 only Every major cloud provider
Best fit Small clusters, simple services Large systems, many services

Is Docker Swarm dead? The honest status in 2026

No, but it is maintained rather than developed. Swarm mode still ships in Docker Engine, and recent Engine releases have included Swarm and overlay networking fixes, including security fixes in Engine 29.9.3 in November 2026. Docker’s documentation carries no deprecation notice for swarm mode, and the only Swarm entry on its deprecated features list is the old classic Swarm.

The commercial picture is narrower. Mirantis committed in July 2025 to support Swarm through at least 2030 as part of Mirantis Kubernetes Engine 3, which is the supported route for enterprises. Mirantis Kubernetes Engine 4, built on k0s Kubernetes, does not support Swarm, so there is no upgrade path that keeps Swarm workloads. There are also no managed Swarm offerings from the major cloud providers. The fair summary is that Swarm is safe to run and safe to inherit, but it is not where the industry is heading, and a new project should choose it deliberately rather than by default. Best for: existing Swarm deployments, small teams that value simplicity, and systems that will not need Kubernetes features later.

Decision framework: Swarm or Kubernetes

  • Choose Swarm when the cluster is small, the services are simple, and the team already knows Docker.
  • Choose Swarm when you need multi-host deployment this week, not after a month of learning.
  • Choose Kubernetes when you need autoscaling, or when traffic varies enough that replica counts should follow demand.
  • Choose Kubernetes when you need the ecosystem: managed offerings, operators, policy tools and observability.
  • Choose Kubernetes when the system will grow well beyond a handful of services.
  • Reconsider Swarm if the application needs features it will never have, such as autoscaling or advanced scheduling.

Frequently asked questions

Is Docker Swarm still maintained in 2026?

Yes. Swarm mode ships in current Docker Engine releases and still receives security and bug fixes, including Swarm fixes in Engine 29.9.3 in November 2026. Mirantis supports it commercially through at least 2030 on Mirantis Kubernetes Engine 3.

What is the difference between Swarm and Kubernetes?

Swarm is a simple orchestrator built into Docker Engine, with basic scheduling, service discovery and rolling updates. Kubernetes is a far larger platform with autoscaling, a huge ecosystem and managed offerings from every major cloud provider, at the cost of much greater complexity.

How many manager nodes should a swarm have?

Use an odd number: one for testing, three for most production swarms, five for larger ones. Three managers survive one failure, because two still form a Raft majority. Never use two managers, because one failure leaves no majority.

Can I deploy a Compose file to Swarm?

Yes, using the version 3 Compose format. Swarm reads the services, networks and deploy settings from the file, but it ignores build instructions, so images must be pushed to a registry before you deploy.

Does Swarm do autoscaling?

No. Swarm keeps a fixed replica count that you set, and it replaces failed containers, but it does not scale replicas up or down based on CPU, memory or traffic. That is one of the main reasons larger systems choose Kubernetes.

Should I start a new project on Swarm in 2026?

Only if the system is small, the team knows Docker, and the simplicity is worth more than the ecosystem. For most new projects, Kubernetes or a managed platform is the safer long-term choice, because that is where the tooling and the hiring pool are.

Latest articles

Scroll to Top