Docker Engine installation
How to download in Ubuntu (updated on Sep.2024)
For detailed instructions follow the documentation: https://docs.docker.com/engine/install/ubuntu/
Below are the instructions for Ubuntu.
-
Preparation
#remove any previous installationfor pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; donesudo apt-get updatesudo apt-get install ca-certificates curlsudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc -
Setup Repository [recommended]
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/nullsudo apt-get update -
Install Docker Engine
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -
Add docker to give non root user access
sudo groupadd dockersudo usermod -aG docker $USER -
Logout session or use command below to activate the new changes
newgrp docker -
Installation verification
docker run hello-world