Monday, June 23, 2014

Bootstrap RESTful Docker on Ubuntu

The most "devOps way" of communicating with the Docker server is to expose it via the REST API. And then using the HTTP client of your choice to send commands to that Docker server.  

Here is what you need to do in order to set up the Docker server exposed via REST endpoint on Ubuntu 14.04.

Install Docker

Here is the Official Ubuntu installation documentation in the nutshell - to install Docker on Ubuntu just type the following command into your shell:

curl -s | sudo sh

Expose Docker via HTTP

By default Docker is exposed only via the Unix sockets. You can change it with the additional -H (host) option.

sudo sh -c 'echo "DOCKER_OPTS=\"-H unix:///var/run/docker.sock -H tcp://\"" > /etc/default/docker'
sudo service docker restart
In order to verify that Docker has been properly exposed via HTTP, execute the following command:


Running Docker without root

If you wanna execute docker command without sudo, add yourself to the docker system group:

usermod -a -G docker yourUserName

Fabric8 readiness

The settings presented above are the default Docker setup expected by the Fabric8 Docker integration. If you followed this instruction, you can safely play with the Fabric8 Docker containers.


  1. Hey! The proper way to add a user to a group is either `# usermod -a -G docker rylee` where `rylee` is your username, or `# gpasswd -a rylee docker`, where rylee is the username. Manually editing /etc/group (and /etc/gshadow) is *not* recommended.

  2. Good point! Fixed :) . Many thanks for the comment!