Setting up Docker on Linux Mint 20.X

Michael Shoemaker
3 min readJul 25, 2021


This is a quick LFG (Let’s….uh, “freaking” GO) :-) article on setting up Docker on Linux Mint. There are plenty of guides out there, but I’ve run into some snags myself and I’m hoping this guide will save some people time and get them up and running as quick as possible.

To begin make sure that there are no pre-existing installations of docker.

sudo apt-get remove docker docker-engine containerd runc

Then make sure everything is up to date:

sudo apt-get update

Install the dependencies that docker needs:

sudo apt-get install \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-common

Add the gpg key to your system:

url -fsSL | sudo apt-key add -

Add the repository for docker so you can download the necessary components (docker-ce docker-ce-cli

sudo add-apt-repository "deb [arch=amd64] $(. /etc/os-release; echo "$UBUNTU_CODENAME") stable"

You will need to another update so that the ppa is actually searched on the next step.

sudo apt-get update

Now we actually install docker.

sudo apt-get install docker-ce docker-ce-cli

Create a group for docker.

newgrp docker

Add yourself/the current user to the docker group.

sudo usermod -aG docker $USER

Note: If you switched to root to make installation easier or if you are going to be using docker as a different user than you are currently logged in as you will want to replace the $USER above with the correct username.

You will need to log out and log back in for the group permissions to take effect. Or if you’re like me and lazy you can just switch user to yourself.

su - $USER

You should be all set and are ready to go using docker. Check out dockerhub for images you can pull or look around for how to create your own images.

There is a simple script I have written and placed on my Github which will run all of the above mentioned steps above for you. Also, if you pass the keyword “all” when executing the script it will install docker-compose as well.

Just docker install:


Install Docker and Docker-Compose:

./MintDockerInstall all

Quick Start Bonus:

To get you going here is a simple command to get a container running quickly.

docker run -it alpine /bin/sh

This gets the Alpine Linux image (which is about the lightest Linux image there is) and runs a container

Above docker run tells docker to find the image specified and to run a container from that image. If I had previously run this containerThe analogy I come across the most is based on OOP. You can think of a docker image as a class and a container as an instance of that class.

-it are two flags. The -i keeps STDIN open and the -t allocates a pseudo-tty

Finally the /bin/sh tells docker what to run in the container.

Notice the line that states “Unable to find image ‘alpine:latest’ locally. If I run this command again it will place me at the command line in the docker container with no out put. That is because I did not have a copy of the image locally so docker pulled the image from docker hub to my local machine. Running it again docker sees that I already have the image locally and makes a container from that image.

Hopefully I’ll have time in the near future to make a follow up article which goes into running and managing containers. In the meantime stay curious and happy coding.



Michael Shoemaker

Technologist and tinkerer.