Docker
6%
Course progress
1 of 31 topics done
Keep going, you are close!
2 topics in a row
1 of 31 topics done
LessonΒ·2 of 31

Installation

N/A31 lessons
1

Installation

πŸ“‹ Overview

🎯 Install Docker Engine on Linux Systems

This guide walks you through installing Docker Engine on RHEL/Debian-based Linux distributions with step-by-step instructions.

πŸ” What This Guide Covers

  • πŸ–₯️ Prerequisites - System requirements and OS compatibility
  • πŸ“¦ Repository Setup - Configure Docker repository
  • πŸ”§ Installation - Install Docker Engine and components
  • βœ… Verification - Verify successful installation
  • πŸš€ Post-Installation - Configure Docker for your user
  • πŸ“š Troubleshooting - Common installation issues

πŸ–₯️ Prerequisites

πŸ“‹ OS Requirements

Docker Engine requires a 64-bit version of one of the following distributions:

DistributionSupported Versions
Fedora32, 33, 34, 35+
Ubuntu18.04 LTS, 20.04 LTS, 22.04 LTS
CentOS7, 8, 9
RHEL7, 8, 9
Debian9, 10, 11

πŸ’» Hardware Requirements

  • 64-bit Processor: Required for Docker Engine
  • RAM: Minimum 2GB (4GB+ recommended)
  • Disk Space: At least 10GB free space
  • Internet Connection: Required for downloading Docker

πŸ“¦ Install Docker Engine on Fedora

Step 1️⃣: Set Up the Repository

Before you install Docker, set up the Docker repository and install some dependencies:

Install dnf-plugins-core

bash
sudo dnf -y install dnf-plugins-core

This package allows you to manage your DNF repositories.

Add Docker Stable Repository

bash
sudo dnf config-manager \
  --add-repo \
  https://download.docker.com/linux/fedora/docker-ce.repo

Verify GPG Key (Optional)

If prompted, verify the GPG key's fingerprint matches:

text
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35

Step 2️⃣: Install Docker Engine

Install the latest version of Docker Engine and containerd:

bash
sudo dnf install docker-ce docker-ce-cli containerd.io

Components Installed:

  • docker-ce: Docker Community Edition
  • docker-ce-cli: Docker command-line interface
  • containerd.io: Container runtime

Step 3️⃣: Start Docker Service

Start the Docker daemon:

bash
sudo systemctl start docker

Enable Docker to start on boot:

bash
sudo systemctl enable docker

Step 4️⃣: Verify Installation

Verify that Docker Engine is installed correctly by running the hello-world image:

bash
sudo docker run hello-world

Expected Output:

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

πŸ“¦ Install Docker Engine on Ubuntu/Debian

Step 1️⃣: Set Up the Repository

Update Package Index

bash
sudo apt-get update

Install Dependencies

bash
sudo apt-get install \
  ca-certificates \
  curl \
  gnupg \
  lsb-release

Add Docker GPG Key

bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Add Docker Repository

bash
echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 2️⃣: Install Docker Engine

Update package index and install Docker:

bash
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Step 3️⃣: Start Docker Service

bash
sudo systemctl start docker
sudo systemctl enable docker

Step 4️⃣: Verify Installation

bash
sudo docker run hello-world

πŸ”§ Post-Installation Setup

Add User to Docker Group

To run Docker commands without sudo:

bash
sudo usermod -aG docker $USER

Apply group changes:

bash
newgrp docker

Verify Docker Works Without Sudo

bash
docker run hello-world

βœ… Verification Checklist

  • Docker Engine installed successfully
  • Docker daemon is running
  • Docker service starts on boot
  • docker --version shows version information
  • docker run hello-world executes successfully
  • User can run Docker commands without sudo

πŸ”— Navigation

⬅️ Previous: Docker Architecture

πŸ“ Current Location: Docker Installation (You are here)

➑️ Next Step: Command Overview

πŸ—ΊοΈ Full Path: Introduction β†’ Architecture β†’ Installation β†’ Commands β†’ First Container

πŸ“š Additional Resources