How to install Docker on Ubuntu 22.04

How to setup docker on Ubuntu 22.04 with easy steps (all commands included)

3 months ago   •   1 min read

By aquasp


Installing docker may look like an easy task, but finding the most convenient way or searching for instructions all the time is not the most pleasurable thing ever.

Setup docker repositories

With this block of code you can't go wrong. Just copy and past everything into the terminal of a Ubuntu 22.04 and you will be all set with everything necessary to self host your docker softwares.

sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" 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-buildx-plugin docker-compose-plugin

As a note, using this method you can use docker compose with"docker compose" instead docker-compose used in the most guides.


If you enjoyed this article, you can share it your friends or subscribe to The Self Hosting Art to keep us motivated. Thank you for reading :)

Spread the word

Keep reading