To run docker commands, you either need to be a root user or run the commands with
sudo.
To run docker commands with a regular user, you need to add that user to the docker group.
The docker group manage the access to the dockerd Unix socket.
By default the group
docker is created.
-
Add a user to the docker group:
-
You need to log out and log in to your account to activate the changes to groups.
You can optionally use the command newgrp to activate the changes to groups during your login session:
-
Verify that you can execute docker commands with your user: