How to install Docker on Ubuntu 22.04

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

a year ago   •   1 min read

By aquasp

Introduction

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 https://download.docker.com/linux/ubuntu/gpg | 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] https://download.docker.com/linux/ubuntu \
  "$(. /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 containerd.io 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.

Conclusion

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

You can also help with XMR(Monero):

8AWKRGyqQ6fdaLwGVAdVTbEP6ZttSXwcYWQWy7gnq6zceTngtJgaAr82Hxr2FY5bkCUJVerccH9XNFX1qWnZxuGYTU5bJ34

Spread the word

Keep reading