Docker
To install Docker, you first need to add the official Docker GPG key, then add the corresponding repository ("PPA") to the package sources, and update everything (for safety, any previously installed packages may be removed beforehand, if necessary).
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runcdocker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin runc; do sudo apt purge -y $pkg; done
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
For Ubuntu and its derivatives (such as Linux Mint), use these commands to add the repository:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$UBUNTU_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
To install it:
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
To verify the installation:
sudo docker run hello-world
After the installation, you can use these commands to add your user to the docker group,
allowing you to run Docker commands without sudo.
sudo groupadd docker
sudo usermod -aG docker $USER
Then reboot your computer.
To verify that you can also run Docker commands as a “normal user”, run:
docker run hello-world
If everything is running, enable and start the Docker service with:
sudo systemctl enable --now docker.service
sudo systemctl enable --now containerd.service