By default, you have to run docker using sudo. When you try to run it without sudo, you will get
$ docker images
Got permission denied while trying to connect to the Docker daemon socketIn order to run without sudo, you will need to do the following steps
- Add the docker group if it does not already exist
sudo groupadd docker- Add the user to the docker group. If you want to add the current user, you can just use this
sudo gpasswd -a $USER dockerIf you want to add, say user user1, then you should just do
sudo gpasswd -a user1 dockerAfter you do the above steps, log out and now you can run docker without sudo.
Comments