Skip to content

Instantly share code, notes, and snippets.

@NLKNguyen
Created June 24, 2019 23:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NLKNguyen/3824ff4f93ce57f35ec8d2936bf5590d to your computer and use it in GitHub Desktop.
Save NLKNguyen/3824ff4f93ce57f35ec8d2936bf5590d to your computer and use it in GitHub Desktop.
Ubuntu 18.04 Setting Up Docker to Use Without Root Privileges

Install Docker

I still use docker.io which is now considered an old version, so you probably want to use the recommended Docker CE (Community Edition) instead. More info here:https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository

At this point, most docker commands including docker ps require sudo permission, and this should be avoided. Next section addresses this.

Post Install

Run these commands. Some are straight from Docker's docs: https://docs.docker.com/install/linux/linux-postinstall/

# This might already done
sudo groupadd docker

sudo usermod -aG docker $USER

# More rationale about the following: https://askubuntu.com/a/982187
sudo setfacl -m user:$USER:rw /var/run/docker.sock

You should be able to use docker and docker-compose without root privileges now. If that didn't go well, check out the links mentioned above and Google!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment