Docker without sudo

Using Docker looks very promising but having to use sudo all the time is really a killer. Luckily there’s a way around it by adding users to the docker group and restarting the docker service.

  • Add the docker group if it doesn’t already exist: sudo groupadd docker
  • Add the connected user “${USER}” to the docker group. Change the user name to match your preferred user: sudo gpasswd -a ${USER} docker
  • Restart the Docker daemon: sudo service docker restart
  • If you are on Ubuntu 14.04 and up use docker.io instead: sudo service docker.io restart

How can I use docker without sudo?

Published by

lekkim

Positive, competent, out-spoken, frank and customer focused architect and developer with a strong foundation in web, cloud and product development. I'm a strong advocate for API first and cloud based solutions and development. I have a knack for being able to communicate and present technically complicated matters in conference, customer and training settings. I've previously acted as team member and leader in a product organisation.