Linux Mint 22, with its robust Ubuntu 24.04 LTS base and user-friendly interface, makes an excellent platform for running Docker. This leading containerization technology allows you to package and distribute applications consistently across environments.
This guide will walk you through every step necessary to quickly get Docker up and running on your Mint 22 system. We cover everything in a structured, easy-to-follow way.
However, if you opt for Docker Desktop instead, an intuitive and powerful GUI application that makes it easier to create, manage, and deploy Docker containers on systems with desktop environments, weโve got you covered.
Our detailed guide, โHow to Install Docker Desktop on Linux Mint 22,โ will help you set it up quickly.
Installing Docker on Linux Mint 22
You can install Docker on your Linux Mint 22 in several ways. For example, it is available in its official repositories, where users can easily install it with a single APT command. However, one disadvantage to this approach is that the version available is not always the most recent.
For this reason, this guide will show you how to install Docker on Linux Mint 22 from the official Docker repository so you always get the latest version.
The best part? It will automatically receive all future software updates as they become available, along with the other regular ones for your Mint 22 system, thus ensuring you always have the latest and greatest.
Step 1: Install Prerequisites
First, run the two commands below to update the package index and install the prerequisite necessary to add and use a new HTTPS repository.
sudo apt update
sudo apt install apt-transport-https ca-certificates curl gnupg
Code language: Bash (bash)
Once operations are completed, you can move to the next section, where weโll add the Dockerโs repo GPG key and repo itself to our Linux Mint 22 system.
Step 2: Add Dockerโs Official GPG Key
Next, import the Docker GPG repository key to your Mint system. This security feature ensures that the software youโre installing is authentic.
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg
Code language: JavaScript (javascript)
Notice that the command produces no output.
Step 3: Add Docker Repo to Linux Mint 22
After importing the GPG keys, weโll add the official Docker repository to our Linux Mint 22 system. Thus, when a new version is released, the update package will be made available with the rest of your systemโs regular updates.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu noble stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Code language: Bash (bash)
As with the previous command, its execution produces no output. Next, refresh the package list.
sudo apt update
Code language: Bash (bash)
As you can see, the new Docker repository is now available to our Mint system and ready to be used.
Step 4: Install Docker on Linux Mint 22
Finally, run the below command to install the latest up-to-date Docker release on Linux Mint 22.
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Code language: Bash (bash)
This installs the following Docker components:
- docker-ce: The Docker engine itself.
- docker-ce-cli: A command line tool that lets you talk to the Docker daemon.
- containerd.io: A container runtime that manages the containerโs lifecycle.
- docker-buildx-plugin: This extension for Docker enhances the capabilities of building images, mainly focusing on multi-platform builds.
- docker-compose-plugin: A configuration management plugin that helps manage multi-container Docker applications using a single YAML file.
Thatโs all! Docker should now be installed, service enabled, and set to start automatically on boot. In addition, check its status using the command below to confirm that everything is as expected:
sudo systemctl is-active docker
Code language: Bash (bash)
Step 5: Verify Installation
This is the moment of truth. Letโs check if our new Docker installation works correctly by running a simple containerized application called โhello-world.โ
sudo docker run hello-world
Code language: Bash (bash)
Congratulations! As we can see, everything works properly.
Enabling Non-root Users to Run Docker Commands
We have successfully installed Docker on the Arch system so far. However, only root and users with sudo privileges can execute Docker commands by default.
In other words, if you attempt to run the docker
command without prefixing it with sudo
, youโll get an error message like this:
But there is no room for worries. To run Docker commands as a non-root user, you must first add your user to the โdockerโ group. It is a simple task. To do that, type in the following:
sudo usermod -aG docker ${USER}
Code language: Bash (bash)
In the above command, โ${USER}โ is a system environment variable that contains your username. Then, run the following command to activate the changes to the group:
newgrp docker
Code language: Bash (bash)
You can then execute docker
commands without prefixing them with sudo
.
Remember that this solution will work only for your current terminal session. In other words, if you close the terminal, you will either have to execute the newgrp
command above again or prefix docker
commands with sudo
. To make this change last permanently, just restart your Mint system.
Conclusion
Installing Docker on Linux Mint 22 is straightforward with our guide and allows you to benefit from the latest features and improvements in Docker technology. Youโre now ready to containerize applications and fully take advantage of Dockerโs efficiencies and portability.
To learn more about Docker, check out its official documentation. Additionally, we recommend our detailed guide to expanding your skills with Docker and learning how to run and manage multi-container applications using Docker Compose.
If you encounter any issues or have questions, let me know in the comments section below. Thank you for following this tutorial, and happy Dockerizing!