"docker ps" cannot connect to the Docker daemon

I just installed Docker for Mac. I opened the terminal and tried to execute “docker ps”, but it failed with the error message “Cannot connect to the Docker daemon. Is the docker daemon running on this host?” When I click the whale in my menu bar, it says Docker is running.

I’ve uploaded my diagnostic and the ID is “61F285D4-3E00-4AD7-8E98-E59C602668C9”. I’m running OS X El Capitan 10.11.6 beta.

There is a thread here, for docker application not asking sudo permission. Did your installation ask for sudo permission after installing?

If not, it might be related to that.

In my case that’s exactly the problem. To run docker commands I have to use the “sudo” or change to root with “sudo su”. If I run without sudo or root permissions then I get the error specified by fishnet. Any ideas on how to avoid having to elevated permissions to run docker?

1 Like

Do you have DOCKER_HOST set? You do not need to use DOCKER_HOST with Docker for Mac and it can cause this kind of issue.

Yes, I do have DOCKER_HOST set. I was using Boot2Docker about a year ago on this computer. So should I just clear the value of the variable or do I need to remove the variable completely?

i have to use sudo for all docker commands after installing docker for mac. i do not have DOCKER_HOST set. It still requires to use sudo.

Thanks this was my issue…