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:
| Distribution | Supported Versions |
|---|---|
| Fedora | 32, 33, 34, 35+ |
| Ubuntu | 18.04 LTS, 20.04 LTS, 22.04 LTS |
| CentOS | 7, 8, 9 |
| RHEL | 7, 8, 9 |
| Debian | 9, 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
sudo dnf -y install dnf-plugins-core
This package allows you to manage your DNF repositories.
Add Docker Stable Repository
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:
060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
Step 2οΈβ£: Install Docker Engine
Install the latest version of Docker Engine and containerd:
sudo dnf install docker-ce docker-ce-cli containerd.io
Components Installed:
docker-ce: Docker Community Editiondocker-ce-cli: Docker command-line interfacecontainerd.io: Container runtime
Step 3οΈβ£: Start Docker Service
Start the Docker daemon:
sudo systemctl start docker
Enable Docker to start on boot:
sudo systemctl enable docker
Step 4οΈβ£: Verify Installation
Verify that Docker Engine is installed correctly by running the hello-world image:
sudo docker run hello-world
Expected Output:
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
sudo apt-get update
Install Dependencies
sudo apt-get install \
ca-certificates \
curl \
gnupg \
lsb-release
Add Docker GPG Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add Docker Repository
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:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
Step 3οΈβ£: Start Docker Service
sudo systemctl start docker
sudo systemctl enable docker
Step 4οΈβ£: Verify Installation
sudo docker run hello-world
π§ Post-Installation Setup
Add User to Docker Group
To run Docker commands without sudo:
sudo usermod -aG docker $USER
Apply group changes:
newgrp docker
Verify Docker Works Without Sudo
docker run hello-world
β Verification Checklist
- Docker Engine installed successfully
- Docker daemon is running
- Docker service starts on boot
-
docker --versionshows version information -
docker run hello-worldexecutes 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
- π Docker Installation Guide: docs.docker.com/engine/install
- π Fedora Installation: docs.docker.com/engine/install/fedora
- π Ubuntu Installation: docs.docker.com/engine/install/ubuntu
- π‘ Post-Installation Steps: docs.docker.com/engine/install/linux-postinstall