DEV Community

Cover image for Install Docker on Ubuntu 22.04
Amruta Pardeshi
Amruta Pardeshi

Posted on

3 1 1 1 1

Install Docker on Ubuntu 22.04

Docker is a software platform that simplifies the process of building, running, managing and distributing applications. It does this by virtualizing the operating system of the computer on which it is installed and running.

Prerequisites:
Ubuntu 20.04 or higher
A non-root user with sudo privileges

Step 1: Update package list
The first step is to update the package list on the Ubuntu machine. This is done by running the following command in the terminal:
$ sudo apt update

Step 2: Install packages to allow apt to use a repository over HTTPS
Next, we will install the necessary packages to allow apt to use a repository over HTTPS:
$ sudo apt install apt-transport-https ca-certificates curl software-properties-common

Step 3: Add Docker's official GPG key
To add Docker's official GPG key, run the following command in the terminal:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 4: Add the stable Docker repository to the system
To add the stable Docker repository to the system, run the following command:
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 5: Update package list again and install Docker CE
$ sudo apt update
$ apt-cache policy docker-ce

Step 6: Finally install Docker
$ sudo apt install docker-ce

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs