Linux & DevOps Ubuntu 24.04 LTS

How to Fix Docker Permission Denied on Ubuntu Without Sudo

A clean, tested solution to run Docker commands on Ubuntu without prefixing sudo, fixing unix socket permission errors safely.
Z
Zaisha
Staff Writer · Verified Editor
Published Oct 20, 2026 · 3 min read · 234 words
Quick Overview

This deep-dive covers fix docker permission denied with actionable analysis, practical implications, and expert insights.

How to Fix Docker Permission Denied on Ubuntu Without Sudo

The Error: Permission Denied to Docker Daemon Socket

When running docker ps on a new Ubuntu installation, you may encounter this error:

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

This happens because the Unix domain socket is owned by root:docker with 0660 permissions. If your user account is not a member of the docker group, access is denied.

Step 1: Create the Docker Group

The Docker package usually creates the group automatically, but verify its existence:

sudo groupadd docker

Step 2: Add Your User to the Docker Group

Add your current username to the group using usermod:

sudo usermod -aG docker $USER

Step 3: Refresh Active Group Membership

Instead of rebooting or logging out, activate the updated group permissions for your current shell session using newgrp:

newgrp docker

Step 4: Verify Docker Operation Without Sudo

Run the official Hello World container without prefixing sudo:

docker run --rm hello-world

You should see the message: "Hello from Docker! This message shows that your installation appears to be working correctly."

Fixing Permissions on Legacy Socket Files

If you previously executed Docker commands with irregular sudo configurations, the socket file permissions might have become altered. Reset them if necessary:

sudo chown root:docker /var/run/docker.sock
sudo chmod 660 /var/run/docker.sock
sudo systemctl restart docker

Your user account can now manage containers and development environments smoothly without elevated sudo prompts.

Tested & Verified Environment
Author Verified
Operating System: Ubuntu 24.04 LTS
Verification Date: Oct 20, 2026
Testing Methodology & Notes: Tested on freshly installed Ubuntu 24.04 LTS with Docker Community Edition. Added standard user to docker group and refreshed group membership using newgrp.

Was this technical analysis helpful?

Your feedback informs our benchmark updates and ongoing article audits.

✓ Thank you for your feedback! Our editorial engineers review submissions weekly.

Frequently Asked Questions

Structured for search engines and AI answer systems (AEO/GEO).

The Docker daemon binds to a Unix socket (/var/run/docker.sock) owned by user root and group docker. Users not in the docker group cannot access the socket.

No. You can run newgrp docker to apply group membership to your current terminal session immediately, or log out and log back in.

Yes. Access to the Docker socket allows launching privileged containers with host root filesystem mounts. Only grant this access to trusted administrative accounts.

More answers in our FAQ hub.

Z
Zaisha

Tech journalist covering AI, software, and emerging technology with a focus on practical insights.

Testing Standards: Tutorials and guides are hands-on tested on Ubuntu Linux workstations before release.
View all articles by Zaisha

Practical Linux & Applied AI Newsletter

Get new tested tutorials and benchmark comparisons delivered directly to your inbox. Zero spam.

Join Weekly guides readers getting our weekly digest.

  • Practical Linux administration & terminal workflows
  • Tested open-source AI setups & benchmarks
  • Zero spam - unsubscribe anytime

Join Weekly guides readers · Weekly digest · Unsubscribe anytime. RSS

Continue Exploring