You open Terminal, type docker ps, and get hit with Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? It usually happens right after a reboot, a Docker Desktop update, or when you quit the app to free up RAM and forgot to restart it. Had a client last month whose entire dev team hit this after a macOS Sonoma 14.5 update — Docker Desktop silently failed to launch on login and nobody noticed until standup.
On macOS, there is no native Docker daemon. Unlike Linux, you don't have systemd running dockerd in the background. Docker Desktop runs a lightweight Linux VM (using Apple's Virtualization framework or HyperKit) and the daemon lives inside that VM. Your docker CLI talks to it through a Unix socket that Docker Desktop maps to /var/run/docker.sock. If Docker Desktop isn't running, or the socket isn't linked, the CLI has nothing to talk to.
The real fix
- Start Docker Desktop. Open Spotlight (
Cmd + Space), type "Docker", hit Enter. Wait for the whale icon in your menu bar to stop animating. It can take 20–40 seconds on older Intel Macs. Don't just glance and assume — the icon spins until the daemon is actually up. - Check it's actually running. Run:
If you see Server Version, CPU count, and storage driver info, you're done. If you still get the socket error, keep going.docker info - Verify the socket link exists. Docker Desktop creates a symlink for CLI compatibility:
Ifls -la /var/run/docker.sock ls -la ~/.docker/run/docker.sock/var/run/docker.sockis missing but~/.docker/run/docker.sockexists, your CLI context is pointing at the wrong place. - Check your Docker context. This trips up a lot of people who've used Docker with remote hosts or Colima:
The active context (marked withdocker context ls*) should bedesktop-linux. If it's something likecolimaor a remote host, switch back:docker context use desktop-linux - Restart Docker Desktop cleanly. Quit it fully from the whale menu (not just closing the window). Then:
Give it 30 seconds. Runkillall Docker && open -a Dockerdocker psagain. - If the daemon refuses to start, reset the VM. In Docker Desktop, go to Troubleshoot (bug icon) → Clean / Purge data is nuclear — don't do that unless you can lose your images and volumes. First try Restart from the same menu. That restarts the VM without nuking data.
If it still fails
Here's the stuff that actually matters once the basics are done.
Check the CLI version matches. If you installed docker via Homebrew separately from Docker Desktop, you can end up with two competing installs. Run which -a docker. If it shows /usr/local/bin/docker and /opt/homebrew/bin/docker, that's your problem. Remove the Homebrew one:
brew uninstall docker docker-compose
# Then in Docker Desktop: Settings → Advanced → Install CLI tools
Look at the Docker Desktop logs. Settings → Troubleshoot → Open logs. Grep for "Fatal" or "error". I've seen a corrupted settings-store.json in ~/Library/Group Containers/group.com.docker/ cause the daemon to silently die on launch. Renaming that file (Docker recreates it) fixes it.
Rosetta on Apple Silicon. If you're on an M1/M2/M3 Mac and you've set Docker Desktop to run under Rosetta, the daemon can be flaky. Make sure Settings → General → Use Rosetta for x86/amd64 emulation is only checked if you actually need x86 emulation. Unchecking it fixed a Mac Studio for me last week where the daemon hung at "Starting" indefinitely.
Resource limits. Settings → Resources. If you gave Docker 2GB of RAM and 2 CPUs, it can fail to boot the VM under load. Bump to at least 4GB RAM and 4 CPUs on modern Macs. This is especially true for anyone running a k8s cluster or heavy Compose stack.
One more thing: if you're using Colima instead of Docker Desktop, this error meanscolima starthasn't been run since reboot. Checkcolima statusand start it. The socket path is different — usually~/.colima/default/docker.sock— and the context should becolima, notdesktop-linux.
Nine times out of ten it's just "Docker Desktop isn't running." The other one time, it's the context or a broken symlink. Rarely is it anything more exotic than that. Don't reinstall Docker Desktop first — that's a waste of 10 minutes and it usually doesn't fix the problem anyway.