Well, Be careful about running docker swarm if you have multiple interfaces (wlan, eth0) etc. And also if you are running at different places, for example you ran in office with an IP. Forgot to turndown the cluster, and came back home.
What happend to me is, I had both ethernet cable and wifi enabled. So, I started swarm with eth0 interface IP.
Then, I shutdown the laptop and disconnected the cable. Next time I started the laptop, I was getting this error: “Docker can’t connect to docker daemon”.
It happend because the Dockerd will stop working as it cannot start docker server, because of failing to initiate docker swarm.
I found it by stopping the docker service.
sudo service docker stop
Then When I checked dockerd,
Then I found out that dockerd could not start because of Swarm init failed.
This is an issue in docker :
They still did not fix it.
Fow now, there is a hack to solve this:
which is go to
and delete the following files:
Then restart sudo service docker start.
Check docker version.
It should work now.
YOU ARE WELCOME!