Install Docker and then Run Docker Commands without Sudo

Commands:

1
2
3
4
$ curl -sSL https://get.docker.io/ubuntu/ | sudo sh
$ sudo usermod -a -G docker $USER
$ sudo service docker restart
$ logout

Explanation:

  1. One line command installation
  2. Add the user to the group docker
  3. Restart the daemon
  4. Make sure to logout and log back in, in order to sudoless Docker taking effect.