Enabling Docker Remote API on Ubuntu


Edit the file /lib/systemd/system/docker.service
I used the nano editor:

sudo nano /lib/systemd/system/docker.service

Modify the line that starts with ExecStart to look like this:

ExecStart=/usr/bin/docker daemon -H fd:// -H tcp://0.0.0.0:2375

Save the modified file & restart Server

Test that the Docker API is indeed accessible:

curl https://localhost:2375/version

You should see output similar to this as the result:

{"Platform":{"Name":""},"Components":[{"Name":"Engine","Version":"17.12.1-ce","Details":{"ApiVersion":"1.35","Arch":"amd64","BuildTime":"2018-02-30T17:46:05.000000000+00:00","Experimental":"true","GitCommit":"4440fc6","GoVersion":"go1.10.1","KernelVersion":"4.15.0-32-generic","MinAPIVersion":"1.12","Os":"linux"}}],"Version":"17.12.1-ce","ApiVersion":"1.35","MinAPIVersion":"1.12","GitCommit":"4440fc6","GoVersion":"go1.10.1","Os":"linux","Arch":"amd64","KernelVersion":"4.15.0-32-generic","Experimental":true,"BuildTime":"2018-02-30T17:46:05.000000000+00:00"}