How to Install Docker On Ubuntu 24.10
What is docker?
Docker is basically a container engine that uses the Linux Kernel in order to create containers on top of an operating system. Which is used to create, deploy, and run the applications.
Install Docker
Install the docker using the apt
package manager.
apt install docker.io docker-compose
Start and enable the docker
systemctl enable --now docker
Check Docker service
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 Fri 2024-11-29 13:34:22 UTC; 16s ago
Invocation: 5e217f1e18554e7babec03d37b1124f4
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 2482 (dockerd)
Tasks: 9
Memory: 29.4M (peak: 29.7M)
CPU: 258ms
CGroup: /system.slice/docker.service
└─2482 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Create a group called docker,
groupadd docker
To add a user to the docker user group
usermod -aG docker $USER
If you want to add a different user, replace $USER
with an existing username.
Check the docker version,
docker --version
Output:
root@ubuntu23:~# docker --version
Docker version 26.1.3, build 26.1.3-0ubuntu1
Test docker using the hello-world
container.
docker run hello-world
Output:
root@ubuntu23:~# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:305243c734571da2d100c8c8b3c3167a098cab6049c9a5b066b6021a60fcb966
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/
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