WSL - Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

In my case the problem was that the installation of docker expects to listen events from another socket.

I went to /var/log/docker.log and the last line of the log was saying:

“API listen on /mnt/wsl/shared-docker/docker.sock”

So wat i did was: go to /var/run and run:

sudo rm docker.sock && sudo ln -s /mnt/wsl/shared-docker/docker.sock /var/run/docker.sock

Basically I created a symbolic link between the two sockets. This fixed the issue.

1 Like