How to connect to Docker API from another machine? How to connect to Docker API from another machine? docker docker

How to connect to Docker API from another machine?


Came across a similar issue, one thing I don't see mentioned here is you need to start docker to listen to both the network and a unix socket. All regular docker (command-line) commands on the host assume the socket.

sudo docker -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -d &

will start docker listening to any ip address on your host, as well as the typical unix socket.


You need to listen to 0.0.0.0. When you listen on 127.0.0.1, it means that no one outside your host will be able to connect.


Please note that in doing this, you have given anyone, and any URL sent to you by email access to your Docker API, and thus root permission.

you should, at minimum, secure your socket using https: http://docs.docker.com/articles/https/