Last active
July 21, 2020 19:10
-
-
Save hrabryi/d24c8ba9058cbe81151e5b919d0114c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Run Docker as non-root user (without sudo)in ubuntu/linux | |
To fix the Docker permission denied error and use Docker as non-root user, | |
(like Got permission denied while trying to connect to the Docker daemon socket at...connect: permission denied) | |
create a group called “docker” with the following command: | |
$ sudo groupadd docker | |
Next, add your user to the docker group: | |
$ sudo usermod -aG docker $USER | |
After adding the user to the docker group, log out and log back in to take effect the changes. | |
Alternatively, run the following command to apply the changes to groups: | |
$ newgrp docker | |
From now on, the normal (non-root) user can be able to use Docker without sudo permissions. | |
$ docker version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment