Korean original: docker daemon is not running in WSL Ubuntu
Symptom
When you run a docker command in WSL, you see this message. It means the Docker daemon is not running.
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Quick fix
- Launch WSL with administrator privileges.
- Switch to root with su - root.
- Run dockerd.
You can also try starting it as a service with sudo service docker start.
Check that the daemon is running
If docker info or docker ps prints a result without errors, the daemon is running.
Keep it running after you close the terminal
If you run dockerd in the foreground, the daemon stops when you close that terminal. To run it in the background, use the command below and read /tmp/dockerd.log if something goes wrong. After a full WSL shutdown you need to start it again.
sudo dockerd > /tmp/dockerd.log 2>&1 &
Start Docker automatically
- On WSL2 with systemd enabled, Docker can be configured to start automatically when WSL boots.
- On Windows, using Docker Desktop is another option.
Related error
If docker-compose fails with an iptables error such as "Unable to enable NAT rule", see the Korean post docker-compose error (Unable to enable NAT rule). The workaround there is a temporary one, and WSL2 is recommended over WSL1.
Originally written in 2020 in Korean. This English version was added in November 2026.
댓글 없음:
댓글 쓰기