Installing Docker on Linux Mint 20.x / Ubuntu (Jammy 22.04 / Impish 21.10 / Focal 20.04 / Bionic 18.04)
Uninstall old versions
sudo apt-get remove docker docker-engine docker.io containerd runc
If apt-get
reports that none of these packages are installed, that means we havn’t installed Docker previously.
Installation
I prefer setting up Docker’s repository and install from that source for ease of installation and upgrade.
Set up the repository
-
Update the apt package index
sudo apt-get update
-
Install required packages
sudo apt-get install ca-certificates curl gnupg lsb-release
-
Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
-
Set up the repository
Linux Mint 20.x
The Linux Mint 20.x is based on Ubuntu focal & we have to use it as source.
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Ubuntu - Jammy 22.04 / Impish 21.10 / Focal 20.04 / Bionic 18.04
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Install Docker Engine
-
Update the apt package index
sudo apt-get update
-
Install the latest version of Docker Engine, containerd, and Docker Compose.
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Got a project in mind? Send me a quick message, and I'll get back to you within 24 hours!.
Recent Posts
- Disabling Payment Methods in WooCommerce Based on Conditions
- How to Update Product Quantity in WooCommerce Using Custom Code
- Dynamically Generating a Table of Contents in WordPress
- Direct Checkout in WooCommerce - Add Product to Cart from Checkout Page & Skip Shop, Product, and Cart Pages
- Understanding the Impact of git reset --hard Command
Your Questions / Comments
If you found this article interesting, found errors, or just want to discuss about it, please get in touch.