Mac OSX Docker shows "Cannot connect to the Docker daemon"


When running Docker you may experience the following error,

root# docker images
Cannot connect to the Docker daemon. Is the docker daemon running on this host?


To start the Docker daemon run the following commands.

docker-machine start default
eval 'docker-machine env default'

Below is an example,

root# docker-machine start default
Starting "default"...
(default) Check network to re-create if needed...
(default) Waiting for an IP...

Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

root# eval 'docker-machine env default'

To ensure the Docker daemon is started each time you log in, add these commands to ~/.bash_profile
You can now confirm everything is working as expecting by issuing a Docker command, like so,

root# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
Digest: sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
Status: Image is up to date for busybox:latest

Tags: Docker

About the Author


R Donato

Rick Donato is the Founder and Chief Editor of He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001