Swarm is an distributed app scheduler service.
A swarm consists of a cluster of Docker hosts (running in swarm mode) which act as:
A given Docker host can be a manager, a worker, or perform both roles.
When you create a service, you define its optimal state (number of replicas, network and storage resources available to it, ports the service exposes to the outside world, and more). Docker works to maintain that desired state.
docker swarm init
docker swarm leave --force