Docker Community Forums

Share and learn in the Docker community.

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

Hi guys.

I’m using WSL on Windows 11 and installed Docker following instructions from Docker documentation - Install Docker Engine on Ubuntu | Docker Documentation

renatospaka@LINA-QG:~/dev$ docker version
Client: Docker Engine - Community
 Version:           20.10.9
 API version:       1.41
 Go version:        go1.16.8
 Git commit:        c2ea9bc
 Built:             Mon Oct  4 16:08:29 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

However, it is not working as per the following error:

renatospaka@LINA-QG:~/dev$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

This is my WSL/Ubuntu setup:

renatospaka@LINA-QG:~/dev$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Regards,
Renato

Hi, WSL does not have systemd. I have Windows 10, but I don’t think it is different in Windows 11.
Every time you start the WSL distro you have to start the docker service:

sudo service docker start