How to Install Docker on Linux Mint 22 or 21 Step-by-Step

In this blog post, we will show you how to install docker on Linux Mint 22 or 21 step-by-step.

Docker is an open-source tool that allows developers and system administrators to package their applications along with all dependencies inside a docker image. Later this image can be distributed among team members and can run a container using this image where docker is installed.

Docker play an vital role in DevOps CI/CD projects, using docker we build build the image and upload it central repository like Jfrog and later in the pipeline we call this image while installing the micro services on Kubernetes cluster.

Docker comes with community edition and enterprise edition. In this post, we will be installing docker community edition.

Prerequisites

  • Pre-Install Linux Mint 22 or Linux Mint 21
  • Sudo user with admin rights
  • Reliable Internet connection

Without any delay, let’s jump into docker installation steps.

1) Install Docker Dependencies

Open the terminal and run following apt commands to install docker dependencies.

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

Download Docker Dependencies Linux Mint 22

2) Import Docker GPG Key

Run the following commands to download and import docker repository gpg key into your linux mint 22 or 21.

$ sudo install -m 0755 -d /etc/apt/keyrings
$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
$ sudo chmod a+r /etc/apt/keyrings/docker.asc

Import GPG Key Docker on Linux Mint 22

3) Add Docker APT Repository on Linux Mint 22 /21

Now, add the following apt repository for docker on your linux mint 22 or 21, run below echo command

$ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$UBUNTU_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Add Docker APT Official Repository on Linux Mint 22

Next, update the package index by executing following apt command.

$ sudo apt update

4) Install Docker on Linux Mint 22 or 21

As we have completed all prerequisites, now it’s time to install docker, run following apt command.

$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

This command will install latest version of community edition of docker.

Install Docker on Linux Mint 22

Once the docker and it’s dependecies are installed then verify the docker version and its service.

$ sudo docker version

Docker Version Check Linux Mint 22

$ sudo systemctl status docker

Docker Service Status on Linux Mint 22

Perfect, output above confirms that docker service is up and running.

5) Manage Docker with Local User

If you want your local user to manage docker then you need to the user to docker secondary group. Run following chmod command,

$ sudo usermod -aG docker $USER
$ newgrp docker

Now, you can run docker command without typing sudo in front of it.

6) Test Docker Installation

To ensure that Docker is installed correctly on your Linux Mint 22 /21  system, you can run a container using hello-world image as shown below:

$ docker run hello-world

Docker Run Hello World Linux Mint 22

This command will download hello-world image and run a container from it. If everything is set up properly, you will see an information message confirming that Docker is working correctly.

That’s all from this post, we hope you have found it informative and useful. Feel free to post your queries and feedback in below comments section.

Also Read: How to Install VirtualBox on Linux Mint 21 Step-by-Step

8 thoughts on “How to Install Docker on Linux Mint 22 or 21 Step-by-Step”

  1. There should one more command that should be added
    $ sudo systemctl enable docker
    This will run docker automatically after rebooting the system

  2. ~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Linuxmint
    Description: Linux Mint 22
    Release: 22
    Codename: wilma

    Docker woks well

Leave a Comment

Your email address will not be published. Required fields are marked *