How to allow non root users to run docker commands without using sudo
Although the docker daemon runs as root, it is sometimes useful to grant non root user to run docker commands without the need to use sudo each time. To achieve this add the current user to the docker group. Run the below commands
sudo groupadd docker
sudo usermod -aG docker $USER
# to refresh the group settings
newgrp docker
docker ps