#Introduction
In this tutorial, How to Deploy service to the swarm. First, You need to install the Docker swarm cluster here.
How to Deploy service to the swarm
The simple, I will deploy the NGINX container service.
Log into Controller. Run the following command.
docker service create --name nginx_test nginx

To check service status as command below
vagrant@controller:~$ docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
44sp9ig3k65o nginx_test replicated 1/1 nginx:latest
We will deploy that service to all three nodes as commanded below
docker service create --replicas 3 --name nginx3nodes nginx
The result is Deploy service to the swarm as the picture below

You want to scale the service to all five nodes.
docker service scale nginx3nodes=5

We deploy Portainer on the controller to easily manage the swarm.
docker run -d -p 8000:8000 -p 9443:9443 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Open the browser, and go to http://SERVER:9443 (Where SERVER is the IP address of the server). you should see Swarm listed in the left navigation

Swarm on portainer

Conclusion
You have to Deploy service to the swarm. I hope will this your helpful. Thank you for reading the DevopsRoles page!