Docker Error Code 'Cannot connect to the Docker daemon at unix:///var/run/docker.sock': How to Fix It
Easy 5-15 minutes High Severity
Verified June 2026
- Error Code
- Cannot connect to the Docker daemon at unix:///var/run/docker.sock
- Brand
- Docker
- Product Type
- dev_tool
- Severity
- High
- DIY Difficulty
- Easy
- Estimated Fix Time
- 5-15 minutes
Ad
Tools You'll Need
- Terminal/Command Prompt
- Administrator/sudo access
How to Fix Error Code Cannot connect to the Docker daemon at unix:///var/run/docker.sock
-
Check if Docker Desktop is running
-
Start Docker daemon on Linux
Requires administrator privileges on your system -
Add your user to the docker group
You must log out and back in or restart your session for group changes to apply -
Restart Docker service completely
This will stop all running containers temporarily -
Check Docker socket permissions
Changing socket permissions affects system security - prefer using docker group method -
Verify Docker installation
Ad
When to Call a Professional
Contact a system administrator or DevOps engineer if you're working on a company computer with restricted permissions, if Docker installation is corrupted and won't reinstall properly, or if you're unfamiliar with command line operations and system permissions.Frequently Asked Questions
Why does Docker say permission denied even after installing?
This happens because your user account isn't in the docker group. Add yourself to the group with 'sudo usermod -aG docker $USER' and log out/in again. This allows running Docker without sudo.
How do I know if Docker daemon is actually running?
Check with 'sudo systemctl status docker' on Linux, or look for Docker Desktop icon in system tray on Windows/Mac. You can also run 'docker info' - if it returns system information, daemon is running.
Can I use Docker without administrator privileges?
Once properly set up, yes. Add your user to the docker group and you can run Docker commands normally. However, initial setup and daemon management require admin access.
What if Docker commands worked before but suddenly stopped?
Usually the Docker service stopped running. Restart Docker Desktop or run 'sudo systemctl restart docker' on Linux. Check if recent system updates affected Docker installation.
Does this error affect running containers?
If containers were already running when daemon stopped, they may continue briefly but will become unmanageable. You'll need to restart the daemon to regain control of containers.