Run docker as nonroot

Prerequisites

Before you proceed, make sure docker is installed and it is running properly.

Steps to run docker as non-root

In order to run docker as normal user you should perform the following steps:

1. Create a new group named ‘docker’

sudo groupadd docker

2. Add current user to the group ‘docker’

sudo usermod -aG docker $USER

3. Activate group changes

newgrp docker

4. Verify docker works

View docker info
docker info
Run a test
docker run hello-world

For more info read this article.

Leave a Reply