Sarathlal N

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

  1. Update the apt package index

     sudo apt-get update
    
  2. Install required packages

     sudo apt-get install ca-certificates curl gnupg lsb-release
    
  3. 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
    
  4. 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

  1. Update the apt package index

     sudo apt-get update
    
  2. 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

  1. Disabling Payment Methods in WooCommerce Based on Conditions
  2. How to Update Product Quantity in WooCommerce Using Custom Code
  3. Dynamically Generating a Table of Contents in WordPress
  4. Direct Checkout in WooCommerce - Add Product to Cart from Checkout Page & Skip Shop, Product, and Cart Pages
  5. 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.