How To

Install Docker on Ubuntu 24.04 With Easy Setup Guide

Docker has become one of the most important tools in modern software development. If you want to Install Docker on Ubuntu systems for containerized applications, setting it up correctly from the official repository is the safest approach. Docker allows developers to build, test, and deploy applications in isolated environments called containers, making deployments faster and more consistent.

Unlike traditional virtual machines, Docker containers use fewer system resources and start almost instantly. As a result, developers, DevOps teams, and cloud engineers rely on Docker for everything from local testing to production deployments.

Why Install Docker Ubuntu From the Official Repository

Ubuntu includes Docker packages in its default repositories. However, those versions are sometimes outdated. Therefore, installing Docker from Docker’s official repository ensures you receive the latest features, bug fixes, and security updates.

Before starting, make sure your system meets these requirements:

  • Ubuntu 24.04 or another supported release
  • 64-bit architecture
  • Internet connection
  • User account with sudo privileges

It is also recommended to remove any old Docker-related packages before proceeding.

sudo apt remove docker.io docker-doc docker-compose podman-docker containerd runc

Install Docker on Ubuntu Using APT Repository

First, update your package list and install the required dependencies.

sudo apt updatesudo apt install ca-certificates curl

Next, create the Docker keyring directory and download Docker’s official GPG key.

sudo install -m 0755 -d /etc/apt/keyringssudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.ascsudo chmod a+r /etc/apt/keyrings/docker.asc

After that, add Docker’s official repository to Ubuntu.

sudo tee /etc/apt/sources.list.d/docker.sources <<EOFTypes: debURIs: https://download.docker.com/linux/ubuntuSuites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")Components: stableArchitectures: $(dpkg --print-architecture)Signed-By: /etc/apt/keyrings/docker.ascEOF

Now refresh the package database and install Docker Engine.

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

Verify Install Docker Ubuntu Setup

Once installation finishes, check whether Docker is running properly.

sudo systemctl status docker

You can also verify the installed Docker version.

sudo docker version

To confirm Docker can download and run containers successfully, execute the test container below.

sudo docker run hello-world

If everything works correctly, Docker will pull the test image and display a confirmation message.

Run Docker Without sudo

By default, Docker commands require sudo access. Fortunately, Ubuntu lets you grant Docker permissions to your user account.

sudo usermod -aG docker $USER

Then apply the new group changes:

newgrp docker

Afterward, test Docker again without sudo.

docker run hello-world

Common Docker Maintenance Commands

Keeping Docker updated is important for security and performance.

Update Docker packages:

sudo apt updatesudo apt upgrade

Remove unused Docker resources:

docker system prune -a

Uninstall Docker completely if needed:

sudo apt purge docker-ce docker-ce-cli containerd.io

Conclusion

Choosing to Install Docker on Ubuntu systems from the official Docker repository gives you access to the latest stable releases and security improvements. In addition, Docker simplifies application deployment, improves development workflows, and supports modern DevOps practices. Once Docker is installed correctly, you can start building containers, deploying services, and managing scalable applications with ease.

Cyber Defence

Recent Posts

What Is a Data Protection Platform and Why Your Organization Needs One

A data protection platform is a unified system that helps organizations discover, classify, monitor, and…

4 days ago

How Swiss Privacy Rules Affect AI Companies Under GDPR

AI companies operating in or around Switzerland face a compliance challenge that most legal teams…

5 days ago

Swiss FADP vs EU GDPR: Key Differences for AI and Data Privacy

Two major data privacy laws now govern how organizations handle personal data across Europe; the…

6 days ago

Kali Linux Commands Cheat Sheet: Complete Quick Reference

This cheat sheet covers the essential Kali Linux commands every pentester and ethical hacker uses…

1 month ago

What I Wish I Knew Before Learning Malware Analysis and Reverse Engineering

When I first started learning malware analysis and reverse engineering, I thought the hardest part…

1 month ago

git fetch vs git pull: How They Work and When to Use Each

Both git fetch and git pull talk to a remote repository, but they do very different things to your…

2 months ago