Docker: Cannot connect to the Docker daemon

Docker

Docker CLI shows 'Cannot connect to the Docker daemon at unix:///var/run/docker.sock — is the docker daemon running?' The Docker service is not started or the current user lacks permissions.

Check your exact device first. Codes and procedures vary by model and software version. Back up important files before recovery. Stop if a device is overheating, smells burnt, or has a swollen battery.

CHOOSE HOW YOU WORK

Clear help. Useful detail.

Start with the checks below. Tick a step after you try it, and keep a note of what changed. You can stop as soon as the original task works.

What can cause it?

  • Docker service not started
  • User not in 'docker' group requiring sudo for all commands
  • Docker socket file permissions too restrictive
  • Docker daemon startup failure (check logs)

What to try

Work through one step at a time
Your troubleshooting progress0 steps tried
  1. Start the Docker Service

    Run: sudo systemctl start docker. Then: sudo systemctl enable docker to start it automatically on boot.

  2. Add User to Docker Group

    Run: sudo usermod -aG docker $USER. Log out and back in (or run: newgrp docker) for the group change to take effect. After this, you can run docker without sudo.

  3. Check Docker Service Status

    Run: sudo systemctl status docker to see if the service failed to start and why.

  4. Fix Socket Permissions

    If the socket exists but is inaccessible: sudo chmod 666 /var/run/docker.sock (use as temporary fix only; permanent fix is adding user to docker group).

How did it go?

Test the original task again. A completed checklist doesn’t by itself mean the problem is fixed.

If the error comes back

Record the full error, your exact model, software version, and the steps you tried. Share these with the manufacturer or a qualified technician. A repeated code needs a diagnosis, especially if it involves storage, heat, or power.

Find the instructions for your model

Docker official support

This is a general support link. This reference guide has not been checked against a model-specific source in this update.