Docker Community Forums

Share and learn in the Docker community.

WSL and Docker for Windows: "Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?"

(Arc1) #1

I’m trying to execute Docker commands from a WSL bash terminal and am getting the following error…

$ docker ps
Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?

I’ve added DOCKER_HOST=tcp://localhost:2375 to my .bashrc and enabled “Expose daemon on tcp://localhost:2375 without TLS” in the Windows Docker settings.

I’ve searched and searched and nobody seems to be running into this problem like I currently am.

Any ideas?

(Alphascythian) #2

Well I’m crispy new to docker currently with some struggles in another area so all I can help with is THIS.

This tutorial helped me to get docker running, so just cross check with it, that is if you haven’t seen it already)

(Bitva77) #3

I think alphascythian is on the right track. Have you exposed the daemon on the Windows side first?

(Tgeliot) #4

This is the error I see if I forget to use sudo when running Docker.

(Arc1) #5

@alphascythian I’ve essentially done everything in that tutorial except fixing the /mnt/ stuff.

@tgeliot If I use sudo on docker ps, I lose the configuration set in .bashrc to use tcp://localhost:2375 to connect to the Windows daemon.

For some reason, Docker in WSL can’t see the daemon at the specified address. Not exactly sure why. I’ve tried restarting everything to no avail.

(Arc1) #7

Well, I’ve been trying to troubleshoot this for the past 3 hours and haven’t gotten anywhere.

I’m throwing in the towel. I’ll just stick to doing everything in the Windows command line for now.

So far as I can tell, the daemon isn’t listening on port 2375 even though I have the option enabled in settings. I ran netstat -an | find /i "listening" in cmd to show all actively listening ports and there isn’t anything listening on 2375.

No matter what I do, docker in wsl cannot reach the daemon.