Docker fails to start on Ubuntu 15.04

I installed Docker on Ubuntu 15.04 using:

wget -qO- https://get.docker.com/ | sh

as described at Install Docker on Ubuntu.

I added myself to the docker group:

sudo usermod -aG docker balaaman

Then I logged out and logged in again, and ran:

docker run hello-world

and saw this:

Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

When I tried to start the Docker daemon like this:

sudo service docker start

I got this error:

Failed to start docker.service: Unit docker.service is masked.

Thanks to Yannick Lizzi on this thread I found this fix:

systemctl unmask docker.service
systemctl unmask docker.socket
systemctl start docker.service

After this, I logged out and logged in again (again) and “docker run hello-world” worked fine, and all was well.

10 thoughts on “Docker fails to start on Ubuntu 15.04”

  1. You may want to consider updating this blog post to mention that the user will need to re-authenticate their session to pick up the changes if they cannot simply use the docker command without sudo, after making the aforementioned changes.

    That is all, thank you.

  2. Thanks Nicholas – I mentioned logging out and logging in again earlier (after the usermod command) – do you need to do it again after the systemctl commands? I don’t think I needed to…

  3. “do you need to do it again after the systemctl commands?”
    Yes, you need ;)
    And teras and teras of thanks for your post Andy Balaam.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.