How to Install Docker on Ubuntu 24.04 (Noble Numbat)

These days, Docker is an essential tool for coders who want to get more done. Docker is a program that lets you package and run programs in a separate environment. The container is the separate setting, and you can have more than one container on the same host. This post tells you what to do to quickly install Docker on Ubuntu 24.04.

How to Install Docker on Ubuntu 24.04 (Noble Numbat)

It is easy to set up Docker on Ubuntu 24.04. You only need to be online and have access to a user account with manager rights. Again, the steps you need to take will depend on how you installed it. In this case, there are two ways to get Docker installed on Ubuntu 24.04. Let us talk more about each one.

Install from Docker Official Repository

Installing the most recent stable version of Docker has many perks, such as giving you access to new features. If you want to install the most recent version of Docker, you have to get it from the official Docker source. But more commands need to be run for this method than for the second way in the next section. However, let us do the process one step at a time.

Step 1: Update the Repository

Run the following command to update the repository and make sure our system is ready to get the newest packages.

$ sudo apt update

Step 2: Install Prerequisites

Other packages must be installed before Docker can be loaded. To download the GPG key, for example, we need the curl tool. The command below takes care of installing all the tools that are needed.

$ sudo apt install apt-transport-https ca-certificates curl software-properties-common

Step 3: Add Docker’s GPG Key

We need to add the Docker source GPG key when we use curl. This makes sure that we can use the key to make sure the software package is real before we install it.

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Step 4: Add the Docker Repository into APT Sources

Ubuntu looks through the sources list to get a package when you type “install.” So, we need to run the following command to add Docker’s folder to the system’s list of sources.

$ 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

Run the update command to refresh the sources list after adding the Docker repository,

$ sudo apt update

Step 7: Verify the Installed Docker

As a last step before downloading Docker, run the following command to tell the system to use the Docker repository that we added instead of the one that is in the Ubuntu repository. In this way, you can get to the newest version of Docker.

$ apt-cache policy docker.ce

Step 6: Install Docker

$ sudo apt install docker-ce -y

Step 7: Verify installed Docker

$ sudo systemctl status docker

Step 8: Pull sample image

$ sudo docker pull ubuntu:24.04

Install Docker from the Ubuntu Repository

You can also get Docker from the official Ubuntu 24.04 source. This is the easiest way to set up Docker, but it will not give you the most recent version. You still manage to get Docker, though. Do the following.

Step 1: Make changes to Ubuntu’s repository.

Like the last time, we need to update the Ubuntu source before we can install Docker.

$ sudo apt update

Step 2: Install Docker

After the update, we can install Docker using the command below.

$ sudo apt-get install docker.io -y

Step 3: Install Docker Dependencies

We were able to install Docker, but we still need to install some dependencies. It is better to install Docker as a snap package than to use APT to install each one separately. By doing this, all the Docker requirements will be installed at the same time as the snap package. Follow these steps to install Snap.

$ sudo snap install Docker