Docker Installation

Docker Installation


2 min read

Docker Installation Steps:

Docker can be installed on Linux, Windows and Mac.

Let's see the installation steps on Ubuntu.

Installation of Docker Engine on Ubuntu:


To install Docker Engine, 64-bit version of one of the below Ubuntu versions is required:

  • Ubuntu Jammy 22.04 (LTS)

  • Ubuntu Impish 21.10

  • Ubuntu Focal 20.04 (LTS)

  • Ubuntu Bionic 18.04 (LTS)

1. Install using the repository:

Set up the repository and then install the Docker Engine, CLI, Containerd, and Docker Compose packages.

sudo apt-get update
sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
sudo mkdir -p /etc/apt/keyrings
curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli docker-compose-plugin

2. Install using the script:

The script will be downloaded from and runs it to install the latest stable release of Docker on Linux.

curl -fsSL -o
sudo sh

Installation Check:

sudo docker --version

By default, only the root user can connect to the docker daemon by cli. If you want any other user to run docker commands then you need to add the user into the docker group.

If you would like to use Docker as a non-root user, you should add your user to the “docker” group with below command.

sudo usermod -aG docker username

Example: In the above step, 'username' is replaced by 'vagrant'.

sudo usermod -aG docker vagrant

Uninstall Docker Engine:

  • Uninstall the Docker Engine, CLI, Containerd, and Docker Compose packages:
sudo apt-get purge docker-ce docker-ce-cli docker-compose-plugin
  • To delete all images, containers, and volumes:
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

Community and Social Footprints :

Did you find this article valuable?

Support Cloudnloud Tech Community by becoming a sponsor. Any amount is appreciated!