Installing Docker on Ubuntu Guide | Generated by AI

Home 2025.10

Based on your Ubuntu system output, you have several options to install Docker. Here’s the recommended approach:

The most common and recommended way is to install Docker Engine from Docker’s official repository:

# Update package index
sudo apt update

# Install prerequisites
sudo apt install apt-transport-https ca-certificates curl software-properties-common

# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

# Add Docker repository
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Update package index again
sudo apt update

# Install Docker Engine
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Option 2: Quick Install via APT (Simpler)

From the options shown in your terminal, you can use:

sudo apt install docker.io

Post-Installation Setup

After installation, you’ll want to:

  1. Start and enable Docker service:
    sudo systemctl start docker
    sudo systemctl enable docker
    
  2. Add your user to the docker group (to run Docker without sudo):
    sudo usermod -aG docker $USER
    

Then log out and log back in, or run:

newgrp docker
  1. Verify installation:
    docker --version
    docker run hello-world
    

Which Option to Choose?

For most users, Option 2 (sudo apt install docker.io) is perfectly fine and much simpler. The version difference is usually minimal for regular use.

Would you like me to explain any of these steps in more detail?


Back

anthropic/claude-sonnet-4

Donate