Enable Docker Remote Api on Docker Host
Docker engine has inbuild API service that allows you to control & modify your docker engine and docker instance using HTTP.
To do that:
- Navigate to
/lib/systemd/systemin your terminal and opendocker.servicefilesudo vim /lib/systemd/system/docker.service - Find the line which starts with ExecStart and adds
-H=tcp://0.0.0.0:2375to make it look likeExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock -H=tcp://0.0.0.0:2375 :wqSave the modified file- Reload the docker daemon
sudo systemctl daemon-reload - Restart the container
sudo service docker restart - Test if it is working by using this command, if everything is fine below command should return a JSON
curl http://localhost:2375/services - Ensure the port is open in your firewall
sudo ufw allow 2375/udp - you also test it with
curl http://192.168.99.120:2375/services