How to Install Docker on Ubuntu 24.04

How to install docker on Ubuntu 24.04

Docker is a popular platform used for developing, shipping, and running applications. It allows developers to package their applications and all of their dependencies into a standardized unit called a container. These containers can then be easily deployed across different environments, such as development, testing, and production, without worrying about differences in underlying infrastructure.

In this article, we will describe a step-by-step procedure on how to install docker on Ubuntu 24.04 LTS. You may also read our guide on how to install docker on Ubuntu 22.04 LTS.

Install Docker on Ubuntu 24.04

Follow the steps to install docker on your Ubuntu machine.

Step 1. Update the Package Repository

Update the package repository index with an apt update command so that you get the latest version of docker on your machine.

sudo apt update

Wait for a moment so that the apt update command finishes updating the package repository.

Step 2. Install Docker with apt

Now, you can install docker on your machine. Run the below command with sudo privileges to install docker. Note that Installing or removing any packages requires sudo privileges.

sudo apt install docker.io

This may take several minutes. Sit back and relax while the installation finishes.

Step 3. Add Current User to the Docker Group (Optional)

Running docker commands requires administrative privileges. To avoid this problem, it is recommended to add current user to the docker group. A Docker group is automatically created at the time of installation.

sudo usermod -aG docker <username>

Replace username with the actual user you are adding to the group.

Step 4. Test the installation

Finally, you can test your docker installation by running a hello-world command.

docker run hello-world

As you can see from the above screenshot, docker is running perfectly fine.

Conclusion

Congratulations! You have successfully installed Docker on your Ubuntu system. If you have any issue, you can let us know using the comments. Good bye and have a nice day!