Installing Docker on Ubuntu
Installing Docker on Ubuntu-based Linux distributions: Linux Mint, Zorin, Pop OS, etc. is simple!
Installing Docker from CLI
Docker is available in the default repositories of apt. Install via:
1sudo apt install docker.ioAdd permissions to the docker group by adding the current user:
1sudo usermod -a -G docker $(whoami)Verify that everything worked:
1docker psOutput:
1CONTAINER ID IMAGE COMMAND CREATEDTroubleshooting
If the following error occurs after docker ps:
1Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/json: dial unix /var/run/docker.sock: connect: permission denied1. Check if Docker is running:
1sudo systemctl status dockerthe status should show active (running).
If not, restart the docker service with the following command:
1sudo systemctl restart docker2. Verify that the current user is apart of the docker group
1grep docker /etc/groupthe output should show docker:x:135:USER with USER as the current user given from $(whoami). If not, add the current user to the docker group using the instructions above.
3. Verify that the tty session shows correct group membership
1id -nGthe output should contain docker in the list. If not, reboot.
4. Reboot
If all the prior steps were successful, simply reboot.
1sudo reboot