Docker Docker Engine API Enable Remote access to Docker API on Linux running systemd

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

Linux running systemd, like Ubuntu 16.04, adding -H tcp://0.0.0.0:2375 to /etc/default/docker does not have the effect it used to.

Instead, create a file called /etc/systemd/system/docker-tcp.socket to make docker available on a TCP socket on port 4243:

[Unit]
Description=Docker Socket for the API  
[Socket]
ListenStream=4243  
Service=docker.service  
[Install]
WantedBy=sockets.target 

Then enable the new socket:

systemctl enable docker-tcp.socket
systemctl enable docker.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker

Now, verify if Remote API is working:

curl -X GET http://localhost:4243/images/json


Got any Docker Question?