Code and Tech2026-04-215 min readStacks Horizon
Docker Installation Guide
## Introduction Docker is an open-source platform that allows developers to build, package, and run applications inside containers. Containers ensure consistency across different environments.
Prerequisites
Before installing Docker, make sure your system meets the following requirements:
- 64-bit OS
- Virtualization enabled in BIOS
- Administrative (sudo/root) access
- Updated system packages
Install Docker on Linux (Ubuntu)
Step 1: Update System
sudo apt update
sudo apt upgrade -y
Step 2: Install Required Packages
sudo apt install -y ca-certificates curl gnupg lsb-release
Step 3: Add Docker GPG Key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
Step 4: Add Docker Repository
echo \
"deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Step 5: Install Docker Engine
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Start and Enable Docker
sudo systemctl start docker
sudo systemctl enable docker
Verify Installation
docker --version
Test Docker with:
sudo docker run hello-world
Run Docker Without sudo (Optional)
sudo usermod -aG docker $USER
newgrp docker
Install Docker on Windows
- Download Docker Desktop from the official website
- Run the installer and follow instructions
- Enable WSL 2 when prompted
- Restart your system
Verify installation:
docker --version
Install Docker on macOS
- Download Docker Desktop for Mac
- Open the .dmg file and drag Docker to Applications
- Launch Docker and complete setup
Verify installation:
docker --version
Basic Docker Commands
docker --version | Check Docker version
docker pull image_name | Download an image
docker run image_name | Run a container
docker ps | List running containers
docker stop container_id | Stop a container
Comments
Share your thoughts on this article.
Loading comments…
