Docker fails to start on Ubuntu 15.04

July 17, 2015 [Docker, Tech, Ubuntu]

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.

Comments

Nicholas Maietta 2016-06-23

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.

Andy Balaam 2016-07-13

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…

fay 2016-12-28

it worked!!
and very clearly described, thanks!

Luciano 2018-03-22

Thank you very much, help appreciated :D

Andy Balaam 2018-03-23

Glad it helped :–)

Jesús Virseda Jerez 2018-09-05

"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.

Andy Balaam 2018-09-05

Thanks, updated!

brawaga 2019-06-05

Did not help. Still masked.