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 Error
sh

Cause

This error occurs because the current user does not have permission to access 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 permissions
sh

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 sudo.
Add current user to docker group
sh
To apply group changes immediately, log out and log back in, or run the command below.
Apply group changes
sh
Jooojub
System S/W engineer
Explore Tags
Series
    Recent Post
    © 2026. jooojub. All right reserved.