Add a Docker Swarm environment
Last updated
Last updated
From the menu select Environments then click Add environment.
Next, select Docker Swarm as the environment type then click Start Wizard. Select the Agent option and your platform. Copy the command, then run it on the manager node of your Docker Swarm cluster.
You must run the command on the Docker Swarm cluster before entering the environment details.
The deployment command will return something similar to this:
To validate the agent is running, run the following command:
The result of which should look something like this:
Once the Portainer Agent has been successfully deployed on the cluster, you can complete the rest of the environment configuration.
Once the agent is running on the Docker Swarm cluster, enter the environment details, using the table below as a guide.
Only do this once for your environment, regardless of how many nodes are in the cluster. You do not need to add each node as an individual environment in Portainer. Adding just one node (we recommend the manager node) will allow Portainer to manage the entire cluster.
Name
Give the environment a descriptive name.
Environment address
Enter the IP or DNS name at which the Portainer Server instance can reach the environment along with the port (9001
).
As an optional step you can expand the More settings section and categorize the environment by adding it to a group or tagging it for better searchability.
When you're ready, click Connect. If you have other environments to configure click Next to proceed, otherwise click Close to return to the list of environments.