Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

brew install docker gives a docker command but no engine on macOS

ErrorCannot connect to the Docker daemon. Is 'docker daemon' running on this host?

Short answer

On macOS the Homebrew docker formula installs the command line client only. Docker Engine is a Linux daemon, and on a Mac it ships inside Docker Desktop. With only the client, every command fails to reach a daemon. Install Docker Desktop, or install Colima and run colima start, so a daemon exists.

  • Applies to macOS 15, Homebrew 4, Docker Desktop 4, Colima
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the client and server parts of the version. If the Server section is missing or errors, there is no daemon to talk to.

    docker version
  2. 2Match what you see, then jump to its fix

    1. 1docker version shows a Client block and an error where the Server block should beOnly the client is installedFix
    2. 2Same error after a reboot, though the install worked beforeColima or Docker Desktop is installed but not startedFix
    3. 3DOCKER_HOST is set, or DOCKER_CONTEXT names a runtime that is stoppedThe client points at another daemonFix

What does the error look like?

  • Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?

Cause 1 of 3

Only the client is installed

1Check

Docker's install docs list Docker Engine for Windows and macOS only through Docker Desktop. The Homebrew formula is described as the Docker tool itself; it does not bring a daemon.

which docker && ls /Applications | grep -i docker

2Fix

Install a runtime. Option one: Docker Desktop from Docker's download page, open Docker.app and accept the agreement. Option two: Colima, which Homebrew provides, then start it.

brew install colima
colima start

3Verify

docker version now prints a Server section.

docker run --rm hello-world

Confirmed by docs.docker.com

Did this fix it?

Cause 2 of 3

Colima or Docker Desktop is installed but not started

1Check

Colima has to be running before the client works. Docker Desktop has to be opened once so its engine starts.

colima status

2Fix

Start it.

colima start

3Verify

Run any container.

docker ps

Confirmed by github.com

Did this fix it?

Cause 3 of 3

The client points at another daemon

1Check

The Docker docs name an unreachable remote host as the second cause, and describe the DOCKER_CONTEXT variable overriding the saved default.

env | grep DOCKER
docker context show

2Fix

Unset a stray DOCKER_HOST or switch the context.

unset DOCKER_HOST
docker context use default

3Verify

Run docker version again.

docker version

Confirmed by docs.docker.com

Did this fix it?

How do I stop it coming back?

  • Pick one runtime on a Mac and remove the other from your startup items.
  • Start the runtime before opening your editor's Docker extension.
  • Remove old DOCKER_HOST lines from ~/.zshrc.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

The docker command cannot reach the Docker daemon

Cannot connect to the Docker daemon at unix:///Users/<user>/.docker/run/docker.sock. Is the docker daemon running?

This error means the docker client could not talk to a running daemon.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.