How to Install Docker CE in Linux Mint 20

Docker is an open-source containerization technology that is designed to create, deploy and run container-based applications. In this article, you will learn how to install the Docker Community Edition (CE) on Linux Mint 20.

If you have any older version of docker already installed in your machine you have to remove it.

$ sudo apt-get remove docker docker-engine containerd runc

Let’s get started…

How to Install Docker in Linux Mint

Now there are three ways you can install Docker in Linux Mint.

  1. Setting up docker repository.
  2. Download and install the .deb package locally.
  3. Using Docker installation script.

1. Install Docker Using Repository

Using this method we will add the Docker repository to the apt package manager index and will install the docker from there. By default apt will not support HTTPS, you have to enable it.

$ sudo apt update
$ sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y

Now add GPG key for docker.

$ curl -fsSL | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Now add the stable repository. As per the official documentation, if you use Linux Mint and if you face any installation issue then replace $(lsb_release -cs) with your parent Ubuntu distribution. In my case, my parent ubuntu distribution will be focal.

echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] \
  focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Update the repository and install the docker package using the below command.

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

2. Install Docker Manually Using Deb Package

In this method, we will download the .deb file and install it locally using the apt or dpkg command. Go to the docker index page from where you can download the .deb file. If you take a look at the below image there is no package for ulyana so I will download .deb from focal.

List of Releases
List of Releases

You can go inside “ubuntu/dists/focal/pool/stable/amd64/” and download .deb package for the Docker Engine version you wish to install.

List of Docker Releases
List of Docker Releases

Once you have downloaded the packages go inside the directory where the file is downloaded and run the following command.

$ sudo dpkg -i /home/karthick/downloads/package.deb

3. Install Docker Using Installation Script

In this method, you will install docker using a shell script which will take care of installing docker in your machine. This script will try to install the latest version that is released under the edge channel. If you already have docker installed in your machine, running this script will cause issues. Run the following command to download and run the script.

$ curl -fsSL -o
$ sudo sh

How to Validate the Docker Installation

You can choose any of the three methods described in previous sections for installing docker. Once the installation is completed you can run the “hello-world” container to check if your installation is successful.

$ sudo docker run hello-world 
Verify Docker Engine
Verify Docker Engine

To check the docker version run the following command.

$ docker --version
$ docker version
Check Docker Engine Version
Check Docker Engine Version

In Ubuntu-based distribution, docker will be automatically started and enabled to start during boot.

$ systemctl is-active docker
$ systemctl is-enabled docker
$ systemctl status docker
$ systemctl start docker
$ systemctl stop docker

How to Run Docker as a Normal User

Instead of binding with TCP socket docker binds with Unix socket which is accessible only by root. If you wish not to use sudo every time to work with docker then you can create a group called docker and add non-root users into the group.

$ sudo groupadd docker
$ sudo usermod -aG docker karthick

Now open a new terminal and run the hello-world container without sudo. From the below image you can see I am able to successfully run the container without sudo privilege.

$ sudo docker run hello-world 
Running Docker as Normal User
Running Docker as Normal User

That’s it for this article. If you have any feedback use the comment section.

4 thoughts on “How to Install Docker CE in Linux Mint 20”

    • As a day-1 Linux Mint user (with no previous Linux experience), I’ve been rather impressed that this distro meets & often exceeds my previous Windows experience.

      Unfortunately, my self-taught CLI lessons have been less than stellar; at a rate of probably 20%, I run into errors after eliminating syntax issues, spelling, etc.

      Having followed the tutorial all the way through the “groupadd” section, I attempt to run the su-less “hello-world” command in docker & am met with:

      docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post “http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create”: dial unix /var/run/docker.sock: connect: permission denied.
      See ‘docker run –help’.

      Previous CLI obstacles I’ve encountered have almost always been either incorrect permissions or generating terminal commands from the wrong directory. I suspect the former is the case here after a perusal of the error message. However, I don’t know what directory or file requires permission or what permission it requires (x would be my guess).


Got something to say? Join the discussion.

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.