TOP
EN EL
Docker installation
24 August 2024 Published by Aristotelis Pitaridis
Tools used for this tutorial
Ubuntu Server 24.04
Docker 27.1.1
SHARE

Introduction

Docker is a powerful platform that enables developers to automate the deployment of applications inside lightweight, portable containers. This guide will walk you through the installation process of Docker.

Prerequisites

Before you begin, ensure that your system meets the following requirements:

  • A 64-bit operating system
  • Administrative privileges
  • An internet connection

Installing Docker on Linux

1. Update Your System:

sudo apt update
sudo apt upgrade

2. Install Required Packages:

sudo apt install ca-certificates curl

3. Add Docker’s Official GPG Key:

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

4. Add the repository to apt sources:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

5. Install the docker packages:

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

6. Verify Installation:

sudo systemctl status docker

7. Add User to Docker Group

To run Docker commands without sudo, add your user to the Docker group.

sudo usermod -aG docker newuser

8. Enable Docker to Start on Boot

Ensure Docker starts automatically when the server boots.

sudo systemctl enable docker

Conclusion

Docker simplifies the process of developing, shipping, and running applications by using containerization technology. By following this guide, you should now have Docker installed.