Docker – API over TCP

All steps are relevant for distributions with systemd (tested on CentOS 7 and Ubuntu 18.04)

We look at the Docker launch command:

grep "ExecStart" /usr/lib/systemd/system/docker.service

Ubuntu 18.04 has a different path, "/lib/systemd/system/docker.service"


We get something similar:


Now create the "override.conf" file, just enter:

systemctl edit docker

We insert the following there:

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

For Ubuntu 18.04:

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

ExecStart should be two, the first with an empty value. In the previous step, we looked at the launch command, and added parameters for TCP to it.

Reload the configuration of the daemon:

systemctl daemon-reload

Restart Docker and see its status:

systemctl restart docker
systemctl status docker

If all is well, then you can still verify that Docker is listening on the port:

netstat -anp | grep ":2375"

Now you can remotely execute Docker commands, but you should consider that there is no authentication in this scheme.

Tagged: Tags