Failed to start docker.service: Unit is masked

I download Docker, I run docker run hello-world. It works! THEN I restart my server to make sure it works correctly and I get this after it restarts.I am using Red Hat

Client:
Version: 18.09.1
API version: 1.39
Go version: go1.10.6
Git commit: 20b6775
Built: Wed Jan 9 16:51:30 2019
OS/Arch: linux/amd64
Experimental: false
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

When I run

systemctl start docker

I get

Failed to start docker.service: Unit is masked.

I run

sudo systemctl list-unit-files

I get this

docker.service masked

Does anyone know why?

Here is what masked means:

I tried this but did not work
https://www.artificialworlds.net/blog/2015/07/17/docker-fails-to-start-on-ubuntu-15-04/

I had the same problem. Try this:

sudo systemctl unmask docker
sudo systemctl start docker

found bug here:

4 Likes

You saved me !
Thank you again !

only this has worked for me:

file /etc/xdg/systemd/user/docker-desktop.service

then, delete it

sudo rm /etc/xdg/systemd/user/docker-desktop.service

Since you changed a unit file, you need to run this:

sudo systemctl daemon-reload

now check the status:

systemctl status docker-desktop
1 Like