How to Install Docker on Ubuntu, Fedora, Arch, openSUSE and KALI

How to Install Docker on Ubuntu, Fedora, Arch, openSUSE and KALI

Introduction: In today's tutorial, we'll guide you through the process of installing Docker on four popular Linux distributions: Ubuntu, Fedora, Arch Linux, openSUSE and Kali. Docker is a powerful containerization platform that simplifies application deployment and management.

Installing Docker on Ubuntu:

Step 1: remove all conflicting packages

sudo apt-get remove docker.io docker-doc docker-compose podman-docker containerd runc

Step 2: repository and Dependencies

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

ok, now update again,

sudo apt-get update

Step 3: Install Docker Engine

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

you can also use the script provided by Docker hosted on GitHub at this address!

Installing Docker on Fedora 37 and 38:

Step 1: remove all conflicting packages

sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

Step 2: repository and Dependencies

sudo dnf -y install dnf-plugins-core
sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Step 3: Install Docker Engine and start

sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start docker

Installing Docker on Arch:

Step 1: update

sudo pacman -Syu

Step 2: Install Docker Engine and start

sudo pacman -S docker
sudo systemctl start docker.service

Installing Docker on OpenSuse:

For Tumbleweed:

sudo zypper refresh
sudo zypper update -y
sudo zypper install docker docker-compose docker-compose-switch
sudo systemctl start docker

sudo systemctl enable docker

For Leap:

sudo zypper refresh
sudo zypper update -y
sudo zypper install -y docker
sudo systemctl start docker
sudo systemctl enable docker

Installing Docker on Kali:

Step 1: update

sudo apt update

Step 2: install and enable

sudo apt install -y docker.io
sudo systemctl enable docker --now

For all distributions:

  • we add our user to the sudo group so we don't always have to specify sudo docker ... with the command:
    sudo usermod -aG docker $USER
  • we start the service with:
    sudo systemctl start docker
  • we enable docker at startup with:
    sudo systemctl enable docker

I hope it was helpful to encapsulate on one page how to install docker in multiple distributions.

thank you