How to install Docker on Ubuntu 22.04 LTS
Follow these steps:
Step 1: Update package index
sudo apt update
Step 2: Install dependencies
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
Step 3: Add Docker’s GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Step 4: Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 5: Install Docker Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
Step 6: Verify installation
sudo docker run hello-world
This will download a test image and run it in a container to verify Docker is installed correctly.[1][4]
Step 7: Add user to docker group (optional)
sudo usermod -aG docker $USER
newgrp docker
This allows running Docker commands without sudo.[1][2]
With these steps, you have successfully installed the latest version of Docker on your Ubuntu 22.04 LTS system from the official Docker repository.[1][2][4]
Citations:
[1] https://cloudcone.com/docs/article/how-to-install-docker-on-ubuntu-22-04-20-04/
[2] https://www.cherryservers.com/blog/install-docker-ubuntu-22-04
[3] https://www.reddit.com/r/docker/comments/tksg0b/2204_best_way_to_install_docker/
[4] https://www.youtube.com/watch?v=JfM8w70AXVQ
[5] https://docs.docker.com/engine/install/ubuntu/