Home → Articles → How to Install Docker Container Engine on Ubuntu 24.04

How to Install Docker Container Engine on Ubuntu 24.04

02 Apr, 2026

Introduction

Docker is a containerization platform that packages software into standardized units called containers. Each container includes everything the software needs to run, including code, system tools, libraries, and settings. Unlike traditional virtual machines, containers share the host operating system kernel, making them lightweight and faster to start. Developers use Docker to build, ship, and run applications consistently across different environments, from local development machines to production servers.

This guide shows you how to install Docker on Ubuntu 24.04.

Prerequisites

Before you start:

Update Package Information Index

Refresh your system's package list to ensure you get the latest available versions.

console
$ sudo apt update

Install Prerequisite Packages

Docker requires several system packages to add repositories and handle secure transfers. Install these dependencies before proceeding with the Docker install.

Add Docker's Official GPG Key

Docker signs its packages with a GPG (GNU Privacy Guard) key. Adding this key to your system allows apt to verify the authenticity of Docker packages before installing them.

Add Docker Repository

The Docker repository is not included in Ubuntu's default package sources. Add this repository to your system so apt can locate and install Docker packages.

Install Docker Engine

With the repository configured, you can now install Docker Engine and its core components. The Docker Engine is the underlying container runtime that builds and runs containers.

Manage Docker Service

Docker runs as a system service on Ubuntu under the name docker. You can manage this service using specific commands to start, stop, restart, and check the Docker status. These commands ensure your Docker installation runs smoothly and make maintenance easier on your system.

Check Docker Service Status

console
$ sudo systemctl status docker

Output:

● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)
     Active: active (running) since Mon 2025-03-10 14:23:45 UTC; 2min 15s ago
   Main PID: 12345 (dockerd)
      Tasks: 8
     Memory: 42.1M
        CPU: 1.234s
     CGroup: /system.slice/docker.service
             └─12345 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Press Ctrl + C.

Start Docker Service

console
$ sudo systemctl start docker

Stop Docker Service

console
$ sudo systemctl stop docker

Restart Docker Service

console
$ sudo systemctl restart docker

Enable Docker to Start on Boot

console
$ sudo systemctl enable docker

Output:

Synchronizing state of docker.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable docker

Verify Docker Installation

After installing Docker, verify that it works correctly by running a test container. The hello-world image downloads from Docker Hub and runs a container that prints a confirmation message.

Manage Docker as a Non-Root User

By default, only users with sudo privileges can run Docker commands. Adding your non-root user to the docker group eliminates the need to prefix every Docker command with sudo.

Pull a Container Image

Docker Hub hosts thousands of pre-built container images. Pulling an image downloads it to your local system so you can run containers without an internet connection.

Run a Container Interactively

Running a container interactively gives you direct access to the container's shell. This approach helps you test commands and explore containerized environments.

Conclusion

In this guide, you installed Docker Engine on Ubuntu 24.04 by adding Docker's official repository and using apt to install the core components. You managed the Docker systemd service, verified your install with the hello-world container, configured non-root user access, pulled images from Docker Hub, and ran interactive containers. Now that you have Docker running, consider containerizing your own application by writing a Dockerfile or explore Docker Compose to manage multi-container applications like web servers with databases.