Connecting to the Docker socket on a Swarm environment is a legacy option and not recommended for new installs. We highly recommend using the Portainer Agent instead.
Connecting to the Docker socket directly can only be done from the local environment. Before you begin, ensure the user running the Portainer Server container has permissions to access the Docker socket.
From the menu select Environments then click Add environment.
Next, select Docker Swarm as the environment type then click Start Wizard. Select the Socket option and your platform. You will be shown the required parameter to pass to the Portainer container as part of your Portainer Server deployment.
Fill out the fields based on the table below.
Give the environment a descriptive name.
Override default socket path
Toggle this option on to override the default /var/run/docker.sock socket path.
If Override default socket path is enabled, enter the path to the Docker socket.
Ensure that if you change the Socket Path, that you update the required bind mount parameter above to suit.
As an optional step you can expand the More settings section to 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.