Installing Docker on Ubuntu 24.04 is not that difficult. This short article will step you through the steps necessary to get the current version installed properly.

The video walks through the following topics:

  • Introduction
  • Remove any pre-existing unofficial docker packages
  • How to add the official Docker apt repo
  • How to install docker
  • Test docker installation
  • how to add user to docker group
  • Activate new group membership immediately

Docker Install Documentation: https://docs.docker.com/engine/install/ubuntu/

Remove any unofficial docker packages

1for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

Add the official Docker apt repository

 1# Add Docker's official GPG key:
 2sudo apt update
 3sudo apt install ca-certificates curl
 4sudo install -m 0755 -d /etc/apt/keyrings
 5sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
 6sudo chmod a+r /etc/apt/keyrings/docker.asc
 7
 8# Add the repository to Apt sources:
 9echo \
10  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
11  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
12  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
13sudo apt update

Install latest version of Docker

1sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Add yourself to the docker group

1# The following adds the currently logged in user to the docker group
2usermod -aG docker $LOGNAME
3# This command immediately activates your membership in the docker group, 
4# allowing you to run the docker command with the need for sudo
5newgrp docker

Verify Docker installation

In order to verify the installation, attempt to run a simple test container:

1docker run hello-world

What success looks like

Here’s what a successfull docker run will look like for the test command:

 1❯ docker run hello-world
 2Unable to find image 'hello-world:latest' locally
 3latest: Pulling from library/hello-world
 4c1ec31eb5944: Already exists 
 5Digest: sha256:53cc4d415d839c98be39331c948609b659ed725170ad2ca8eb36951288f81b75
 6Status: Downloaded newer image for hello-world:latest
 7
 8Hello from Docker!
 9This message shows that your installation appears to be working correctly.
10
11To generate this message, Docker took the following steps:
12 1. The Docker client contacted the Docker daemon.
13 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
14    (amd64)
15 3. The Docker daemon created a new container from that image which runs the
16    executable that produces the output you are currently reading.
17 4. The Docker daemon streamed that output to the Docker client, which sent it
18    to your terminal.
19
20To try something more ambitious, you can run an Ubuntu container with:
21 $ docker run -it ubuntu bash
22
23Share images, automate workflows, and more with a free Docker ID:
24 https://hub.docker.com/
25
26For more examples and ideas, visit:
27 https://docs.docker.com/get-started/

My Gear

Please Note: As an Amazon Associate, I earn from qualifying purchases.

Workstation Build: