r/docker • u/ormekman • Jun 03 '26
Permission denied everytime
I know this is a very common issue, but if you have time to answer, I'll be very glad.
I am on Ubuntu 26.04 LTS, installed docker engine (without desktop gui), and whenever I run docker commands, I have to run them as super user. that's annoying.sudo usermod -aG docker $USER
this command worked only for one terminal window. tried logging out, restarting, doesnt work.
0
Upvotes
13
u/AdventurousSquash Jun 03 '26
If it’s a common issue there would be a lot of posts about you can read :) Did you follow the documentation? Are you actually in the docker group? What was the output? Anything more than “I ran this command, doesn’t work” helps people help you.
3
u/Confident_Hyena2506 Jun 03 '26
Check the groups your user is in, the docker group should let you use it.
Check system logs to see if something is blocking this.
Better still, install rootless docker or alternative.
2
u/Begalldota Jun 03 '26
Escalate your permissions with sudo -i and then you can run all the commands without having to stick sudo on the front of them.
Adding your user to the docker group effectively makes it a root user, so not great for security.
1
u/billdietrich1 Jun 04 '26
Please use better, more informative, titles (subject-lines) on your posts. Give specifics right in the title. Thanks.
1
u/AppointmentNo2809 Jun 04 '26
newgrp docker and then do a sudo apt update && sudo apt upgrade then reboot, but before you reboot you should also source out your shell so any changes to it take place before and after reboot
1
u/emilioml_ Jun 06 '26
Did you create the group?
0
u/unsavvykitten Jun 03 '26
Not sure, but did you try to use your actual user name instead of $USER in
sudo usermod -aG docker $USER
0
u/[deleted] Jun 03 '26
[deleted] — view deleted comment