Connect Portainer to remote docker instance

I run several services via docker on different devices. I wanted to manage all these docker instances via one Portainer docker instance.

The connection to the local docker instance on is done using Unix socket following this documentation

The connection to the remote docker instances on & is configured following this documentation

For remote instance you need to replace by the correct IP address of your remote servers: & in this example

Use the command sudo systemctl edit docker.service to open an override file for docker.service in a text editor.

Add or modify the following lines, substituting your own values.

ExecStart=/usr/bin/dockerd -H fd:// -H tcp://

Save the file.

Reload the systemctl configuration.

 sudo systemctl daemon-reload

Restart Docker.

 sudo systemctl restart docker.service

Once done you can add this docker instance as a new environment in your portainer:

This solution is good only for a private use, in a professional environment you would prefer to connect via a secured connection using TLS certificates.

Leave a Reply

Your email address will not be published. Required fields are marked *