• Register
1 vote

Problem :

I am trying to add one manager in Docker swarm. But it is showing me the below error.

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

Any ideas on what I need to do to fix this? Thanks!

14.6k points

Please log in or register to answer this question.

1 Answer

1 vote

Solution :

I have applied every solution available on internet , This one work for me.

You can get this error if docker doesn't shut down cleanly. Run snap logs docker and look for the following:

Error starting daemon: pid file found, ensure docker is not running or delete /var/snap/docker/179/run/docker.pid

Deleting that file and restarting docker worked for me.

rm /var/snap/docker/<your-version-number>/run/docker.pid
snap stop docker
snap start docker

Make sure to replace ‍‍‍‍<your-version-number>‍ with the appropriate version number.

24.5k points