Create a Docker group Linux

When working with Docker in Linux, you may find yourself using sudo before every Docker command. This is because the docker daemon binds to a Unix socket (which by default is owned by the root user) rather than a TCP port. Thus the reason for always needing to use sudo.

A good way to avoid this is to create a docker group and add your user to it. You can do this following the steps below.

1. Change the login session’s owner to root. If you are unable to do this the root user password probably needs to be unlocked – Unlock root user password Linux

2. Create the docker group

3. Add your user to this group

4. Change the login session’s owner back to original user

5. Restart Docker to see the change take effect

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">