← Back to Blog
tutorialBeginner3 min read
Docker Install
How to install Docker on Ubuntu or Debian.
Install Docker on Ubuntu 24.04 — Quick Guide
Introduction
This guide will cover how to install Docker on Ubuntu 24.04
Remove Conflicting Packages
The first step is to remove packages that may conflict with the installation
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; donePrepare For Installation
Update apt
sudo apt-get updateInstall Dependencies
sudo apt-get install ca-certificates curlCreate keyring directory
sudo install -m 0755 -d /etc/apt/keyringsDownload GPG key
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascSet Permissions
sudo chmod a+r /etc/apt/keyrings/docker.ascAdd Repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] 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 updateInstall Docker
Install
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginVerify
Verify the installation completed successfully
sudo docker psAdd User to Docker Group (Optional)
If you want to allow for docker commands without sudo, you can add your user to the docker group. This comes with security implications and I do not do this.
sudo usermod -aG docker $USER