Fixing Docker Daemon Socket Permission Denied Error
A quick guide to resolving the 'permission denied' issue when connecting to the Docker daemon socket by managing user groups
February 10, 2026
Fixing Docker Daemon Socket Permission Denied Error
When you first install Docker and run related commands, you may encounter the following error and have your command rejected.
Docker Daemon Socket Permission Denied Errorsh
Cause
This error occurs because the current user does not have permission to access the
By default, this socket file is owned by the
/var/run/docker.sock file.By default, this socket file is owned by the
root user, and only users in the docker group are configured to access it.Chech socket permissionssh
Solution
However, you should not perform Docker commands with
sudo every time or arbitrarily modify the socket's permissions.The most ideal solution is to add the current user to the docker group.
This allows you to run Docker commands without
This allows you to run Docker commands without
sudo.Add current user to docker groupsh
To apply group changes immediately, log out and log back in, or run the command below.
Apply group changessh