Run docker commands without sudo :))
Mohammad Reza
Posted on July 10, 2020
First create a docker group
sudo groupadd docker
Add the connected user $USER to the docker group
sudo gpasswd -a $USER docker
Done
Log out and log back in so that your group membership is re-evaluated.
If testing on a virtual machine, it may be necessary to restart the virtual machine for changes to take effect.
On a desktop Linux environment such as X Windows, log out of your session completely and then log back in.
On Linux, you can also run the following command to activate the changes to groups:
newgrp docker
💖 💪 🙅 🚩
Mohammad Reza
Posted on July 10, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
docker Docker Compose Demo: Running Multiple Services with Two Domains on Localhost
November 29, 2024