❯ docker compose up -d Cannot connect to the Docker daemon at…
- User
❯ docker compose up -d
Cannot connect to the Docker daemon at unix:///Users/alexeykotomin/.docker/run/docker.sock. Is the docker daemon running?
- Assistant
❯ docker compose up -d
Cannot connect to the Docker daemon at unix:///Users/alexeykotomin/.docker/run/docker.sock. Is the docker daemon running?
The error message:
Cannot connect to the Docker daemon at unix:///Users/alexeykotomin/.docker/run/docker.sock. Is the docker daemon running?
indicates that your Docker CLI cannot communicate with the Docker daemon. This typically means that the Docker service (daemon) isn't running, or the socket path is incorrect or inaccessible.
Here are steps to resolve this issue:
On macOS (Docker Desktop):
Check Docker daemon status:
docker info
If this still shows a similar error, Docker daemon is not running or your environment is misconfigured.
Your Docker CLI is trying to use the socket at:
unix:///Users/alexeykotomin/.docker/run/docker.sock
That looks suspicious—it is not the usual Docker socket path, which is usually:
/var/run/docker.sock
Possible reasons:
DOCKER_HOST set that point to an incorrect socket path.Check environment variables:
env | grep DOCKER
If you see something like:
DOCKER_HOST=unix:///Users/alexeykotomin/.docker/run/docker.sock
then that's the problem. You should unset or correct it:
unset DOCKER_HOST
or
export DOCKER_HOST=unix:///var/run/docker.sock
Then retry:
docker compose up -d
Check if the default Docker socket exists:
ls -l /var/run/docker.sock
You should see something like:
srw-rw---- 1 root wheel 0 Jun 10 12:34 /var/run/docker.sock
If the file does not exist, Docker daemon is likely not running.
Sometimes simply restarting Docker Desktop resolves the issue.
If problems persist, try reinstalling Docker Desktop for macOS from the Docker website.
DOCKER_HOST environment variable./var/run/docker.sock exists.If after these steps you still have the problem, please share:
env | grep DOCKERdocker infoNot yet included in a published release.