SOURCE VERIFIEDSource review Sep 7, 2026No hands-on test claimed2 sources

Cannot connect to the Docker daemon

Docker documents two primary causes for “Cannot connect to the Docker daemon”: the daemon is not running, or the client is pointed at another unreachable daemon. On Linux, local Unix-socket permissions can also prevent a non-root user from connecting even when dockerd is healthy.

SymptomDocker CLI commands fail with “Cannot connect to the Docker daemon” or a permission-denied error for the Docker Unix socket.
Problem familyServers · Servers
Highest step riskAdvanced
Editorial statePublic launch · indexed
Affected scope
Docker EngineLinuxdockerdDocker CLIUnix socket
Start here

Confirm the daemon and target context

Run docker info and check the Docker service state. Then inspect DOCKER_HOST/current context. If sudo works but your normal user does not, diagnose Unix-socket/group permissions instead of restarting containers.

  1. Run docker info to test the control connection.
  2. Check the Docker daemon/service status and start it using the platform-supported service manager if stopped.
  3. Inspect DOCKER_HOST and docker context ls/use to confirm the CLI targets the intended daemon.
  4. Retest before changing socket permissions.

Why this branch first: Docker explicitly says the daemon may be stopped or the client may be targeting an unreachable host.

TroubleByte diagnostic diagram for Cannot connect to the Docker daemon, covering context, service and socket access.
Docker daemon connection pathTroubleByte · Original TroubleByte editorial diagram
Visual diagnosis

TroubleByte diagnostic path

01
Connection

Run docker info and capture the exact failure.

02
Daemon

Check dockerd/service state.

03
Target

Inspect DOCKER_HOST and Docker context.

04
Permission

If local Linux only, fix socket/group access without unsafe chmod.

Original TroubleByte diagnostic map. It summarizes the cited troubleshooting order; it is not a vendor screenshot.

Diagnosis

What this usually means

This error is about the control-plane connection between the Docker CLI and daemon, not an individual container. Docker’s daemon troubleshooting says the service may be stopped or the client may target a different host. On Linux, the default Unix socket is root-owned and access through the docker group carries root-level privilege, so permission fixes must be made deliberately rather than chmod 777 on the socket.

What the evidence establishes

What we verified from the source material

Docker’s daemon troubleshooting identifies a stopped daemon or wrong/unreachable Docker host as primary connection causes. Docker’s Linux post-installation docs explain default root ownership of the Unix socket and warn that docker-group membership grants root-level privileges.

Before you change anything

Prerequisites and checks

Prepare first

  • Know whether Docker Engine is local, Docker Desktop or a remote context.
  • Do not chmod the Docker socket world-writable.
  • Understand that membership in the docker group grants root-level privileges.

Checks that prevent the wrong fix

  • Run docker info and capture the exact error.
  • Check systemctl status docker or the platform-specific daemon status.
  • Inspect DOCKER_HOST and the active Docker context before changing permissions.
Scope

Applies to

✓ Docker Engine✓ Linux✓ dockerd✓ Docker CLI✓ Unix socket
Troubleshooting path

Solutions, in order

01
SAFE · START HERE

Confirm the daemon and target context

  1. Run docker info to test the control connection.
  2. Check the Docker daemon/service status and start it using the platform-supported service manager if stopped.
  3. Inspect DOCKER_HOST and docker context ls/use to confirm the CLI targets the intended daemon.
  4. Retest before changing socket permissions.

Why this can work: Docker explicitly says the daemon may be stopped or the client may be targeting an unreachable host.

02
ADVANCED

Fix Linux socket access safely

  1. If sudo docker works but normal docker does not, inspect /var/run/docker.sock ownership and your group membership.
  2. Use Docker’s supported docker-group procedure only when the security implications are acceptable.
  3. Log out/in so new group membership is applied.
  4. Prefer rootless Docker when that security model better fits the host; never solve this with chmod 777.

Why this can work: Docker documents the root-owned Unix socket and docker-group access, with an explicit warning that the group grants root-level privileges.

Verification

How to know the fix actually worked

  1. docker info returns server information from the intended daemon.
  2. The normal intended user can run a harmless command such as docker ps without permission errors.

Do not count a temporary disappearance of the symptom as a confirmed fix if the problem normally returns after a restart, reconnect or several minutes of use.

Stop conditions

When not to keep changing things

  • Do not make /var/run/docker.sock world-writable; if access policy is unclear on a shared server, stop and choose an approved privilege model.

Escalation: If dockerd is active and the client targets the correct local socket but connection still fails, inspect daemon logs/socket state; for managed Docker hosts, involve the platform administrator.

Evidence

Sources used for this record

Primary · checked Sep 7, 2026Docker — Troubleshooting the Docker daemonFirst-party documentation used as the primary evidence source for this troubleshooting record.Corroborating · checked Sep 7, 2026Docker — Linux post-installation steps for Docker EngineFirst-party documentation used as the corroborating evidence source for this troubleshooting record.
Who reviewed this

Mihailo Ivanjac

This record was written and source-reviewed by Mihailo Ivanjac. Source review means the cited documentation was checked against the troubleshooting order on this page; it does not imply a hands-on reproduction unless the page explicitly says so.

Author profile and editorial scope →
Community troubleshooting

Discuss this exact problem

Share what happened on your system, ask a focused follow-up question, or add evidence that may help someone with the same symptom. Community posts are separate from TroubleByte editorial verification.

Before posting Do not include passwords, API keys, recovery codes, private IP addresses or other secrets. TroubleByte automatically attaches only coarse OS, browser and device-class context. Your full Browser & System Info report is not uploaded automatically.
Start a discussion

Loading community discussions…
Keep diagnosing

Related Servers problems

Change log

Revision history

Show 1 recorded revision

2026-09-07 — Created for the v0.9 launch-acceleration content pass from current first-party documentation; indexing remains disabled pending final launch review.