Stacks Horizon
All posts
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.

Docker Installation Guide

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

  1. Download Docker Desktop from the official website
  2. Run the installer and follow instructions
  3. Enable WSL 2 when prompted
  4. Restart your system

Verify installation:

docker --version

Install Docker on macOS

  1. Download Docker Desktop for Mac
  2. Open the .dmg file and drag Docker to Applications
  3. 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…