Skip to content

Instantly share code, notes, and snippets.

@mshRoR
Created April 8, 2020 08:04
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mshRoR/555f26c2c9048030d1ae7b1770fae63f to your computer and use it in GitHub Desktop.
Save mshRoR/555f26c2c9048030d1ae7b1770fae63f to your computer and use it in GitHub Desktop.
How to fix docker: Got permission denied issue
If you want to run docker as non-root user then you need to add it to the docker group.
1. Create the docker group if it does not exist
$ sudo groupadd docker
2. Add your user to the docker group.
$ sudo usermod -aG docker $USER
3. Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
$ newgrp docker
4. Check if docker can be run without root
$ docker run hello-world
source: https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue
@mshRoR
Copy link
Author

mshRoR commented Apr 8, 2020

If you want to run docker as non-root user then you need to add it to the docker group.

  1. Create the docker group if it does not exist
    $ sudo groupadd docker
  2. Add your user to the docker group.
    $ sudo usermod -aG docker $USER
  3. Run the following command or Logout and login again and run (that doesn't work you may need to reboot your machine first)
    $ newgrp docker
  4. Check if docker can be run without root
    $ docker run hello-world

source: https://stackoverflow.com/questions/48957195/how-to-fix-docker-got-permission-denied-issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment