Connect Docker Host into Portainer | After you have succesfully Install Portainer, you can connect docker host into Portainer using several ways. Here, we will connecting docker host to Portainer using Docker API.
In Docker Host
- Open docker service file
vi /lib/systemd/system/docker.service
- Find the line which starts with ExecStart and adds -H=tcp://0.0.0.0:2375 in the end
- Save the modified file
- Reload docker daemon
systemctl daemon-reload
- Restart docker
service docker restart
- To test if it successful, run this command
curl http://localhost:2375/images/json
- If everything is fine below command should return a JSON
In Portainer Dashboard
- Open portainer dashboard
- Goto endpoint > Add endpoint
- Fill these field
Name : free to fill
Endpoint URL : <Docker Host IP>:2375
- If you still got failed, check your firewall, don’t forget to add port 2375/tcp, go to this link if you want to know how to configure firewalld
That are the steps configuring your Portainer Dashboard with Docker Host using Docker API. Follow those steps to get your portainer works well with docker host