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.
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!