💥 TRENDING: Engine/swarm/swarm tutorial/inspect service - Uncensored 2025


When you have deployed a service to your swarm, you can use the Docker CLI to see details about the service running in the swarm.

  1. If you haven't already, open a terminal and ssh into the machine where you run your manager node. For example, the tutorial uses a machine named manager1.

  2. Run docker service inspect --pretty <SERVICE-ID> to display the details about a service in an easily readable format.

    To see the details on the helloworld service:

    Tip

    To return the service details in json format, run the same command without the --pretty flag.

  3. Run docker service ps <SERVICE-ID> to see which nodes are running the service:

    In this case, the one instance of the helloworld service is running on the worker2 node. You may see the service running on your manager node. By default, manager nodes in a swarm can execute tasks just like worker nodes.

    Swarm also shows you the DESIRED STATE and CURRENT STATE of the service task so you can see if tasks are running according to the service definition.

  4. Run docker ps on the node where the task is running to see details about the container for the task.

    Tip

    If helloworld is running on a node other than your manager node, you must ssh to that node.

Next steps

Next, you'll change the scale for the service running in the swarm.

Change the scale