Docker Installation on Ubuntu

This guide explains how to install Docker Engine and its associated tools on Ubuntu, ensuring a clean, reliable setup for containerized applications.


1. Update and Upgrade the System

Always start by updating your package lists and upgrading existing packages to ensure your system is up-to-date:

sudo apt update && sudo apt upgrade -y


2. Install Required Prerequisites

Install essential packages required for adding Docker repositories and handling HTTPS:

sudo apt install -y ca-certificates curl gnupg lsb-release


3. Add Docker’s GPG Key

Docker packages are signed. Add the official GPG key to verify package authenticity:

sudo mkdir -p /etc/apt/keyrings
curl -fsSL <https://download.docker.com/linux/ubuntu/gpg> | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg