How to Install Docker on Ubuntu 25.04

What is Docker?

Docker is a container engine that uses the Linux kernel features (like namespaces and control groups) to create lightweight, portable, and isolated environments called containers.
It helps to create, deploy, and run applications easily across different environments.

Install Docker

Install Docker and Docker Compose using the apt package manager:

apt install docker.io docker-compose

Enable and start the Docker service immediately:

systemctl enable --now docker

Verify if Docker is active and running:

systemctl status docker

Output:

root@server:~# systemctl status docker
● docker.service - Docker Application Container Engine
     Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: e>
     Active: active (running) since Sat 2025-04-26 16:28:00 UTC; 42s ago
 Invocation: 72fc482a4ec6424e883a5e78ee546926
TriggeredBy: ● docker.socket
       Docs: https://docs.docker.com
   Main PID: 2394 (dockerd)
      Tasks: 9
     Memory: 21.6M (peak: 21.9M)
        CPU: 1.018s
     CGroup: /system.slice/docker.service
             └─2394 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/cont>

Create Docker Group

To manage Docker as a non-root user, create a docker group:

groupadd docker

Add your user to the docker group:

usermod -aG docker $USER

⚡ If adding a different user, replace $USER with the actual username.

Check the installed Docker version:

docker --version

Output:

root@server:~# docker --version
Docker version 27.5.1, build 27.5.1-0ubuntu3

Test Docker Installation

Run the hello-world test container:

docker run hello-world

Output:

root@server:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
e6590344b1a5: Pull complete
Digest: sha256:c41088499908a59aae84b0a49c70e86f4731e588a737f1637e73c8c09d995654
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

🎉 Done! Docker is successfully installed and running on Ubuntu 25.04.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS