Docker

Portainer API Setup

To allow Portainer to add an environment. Docker must be configured to open the port for remote access. The firewall must also allow this port. Below is for no TLS.

 

Edit:

nano /lib/systemd/system/docker.service

Add the line and comment out the other ExecStart line.

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

Reload systemctl after the change

systemctl daemon-reload

Add fire exception (RHEL)

firewall-cmd --zone=public --add-port=2375/tcp --permanent
firewall-cmd --reload

Restart the service

systemctl restart docker.service

Portainer Enviroment Configuration

On the left side menu of Portainer click on the environment tab to add a new environment. 

 

Portainer-enviroments.png

Under Enviroment type click on Docker

 

Portainer-docker-01.png

Fill out the name and the "Environment URL" as follows

 

Portainer-docker-02.png

We are not using TLS on this, since it is not a production setup so we can skip it.