Complete Guide to Docker Installation: Engine, CLI & Desktop
A comprehensive guide covering Docker Engine, Docker CLI, and Docker Desktop installation across different platforms with alternatives comparison.
Introduction
Docker has revolutionized how we develop, ship, and run applications. Whether you’re a developer spinning up local environments, a DevOps engineer managing CI/CD pipelines, or a system administrator deploying production workloads, understanding Docker’s installation options is crucial.
In this guide, we’ll cover the three main components of the Docker ecosystem:
- Docker Engine - The core runtime that runs containers
- Docker CLI - The command-line interface to interact with Docker
- Docker Desktop - The GUI application that bundles everything together
Let’s dive in and explore how installation differs across platforms, along with alternatives you might consider.
Understanding Docker Architecture
Before installing, it’s important to understand how these components work together:
┌───────────────────────────────────────────────┐
│ Docker Desktop │
│ ┌─────────────────────────────────────────┐ │
│ │ Docker CLI │ │
│ │ ┌───────────────────────────────────┐ │ │
│ │ │ Docker Engine │ │ │
│ │ │ ┌─────────────┐ ┌─────────────┐ │ │ │
│ │ │ │ containerd │ │ runc │ │ │ │
│ │ │ └─────────────┘ └─────────────┘ │ │ │
│ │ └───────────────────────────────────┘ │ │
│ └─────────────────────────────────────────┘ │
└───────────────────────────────────────────────┘- Docker Engine (dockerd): The daemon that manages containers, images, networks, and volumes
- containerd: The container runtime that Docker Engine uses under the hood
- runc: The low-level container runtime that actually creates containers
- Docker CLI: The
dockercommand you use in your terminal - Docker Desktop: A GUI wrapper that includes all of the above plus extras
Part 1: Docker Engine
What is Docker Engine?
Docker Engine is the core component that actually runs containers. It consists of:
dockerd- The Docker daemoncontainerd- Container runtime- REST API - For programmatic access
- Networking and storage drivers
When to use Engine only:
- Production servers
- CI/CD pipelines
- Headless systems
- When you need minimal overhead
Installation on Linux
Ubuntu / Debian
# Update package index
sudo apt-get update
# Install prerequisites
sudo apt-get install ca-certificates curl gnupg
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \ # [!code ++]
https://download.docker.com/linux/ubuntu \ # [!code ++]
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Engine
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.ioFedora / RHEL / CentOS
# Install dnf-plugins-core
sudo dnf -y install dnf-plugins-core
# Add Docker repository
sudo dnf config-manager --add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
# Install Docker Engine
sudo dnf install docker-ce docker-ce-cli containerd.io
# Start and enable Docker
sudo systemctl start docker
sudo systemctl enable dockerArch Linux
# Install from official repositories
sudo pacman -S docker
# Start and enable
sudo systemctl start docker
sudo systemctl enable dockerPost-Installation Steps
After installing Docker Engine, you’ll want to configure it properly:
# Add your user to the docker group (avoid using sudo)
sudo usermod -aG docker $USER
# Apply the new group membership
newgrp docker
# Verify installation
docker run hello-worldSecurity Note: Adding a user to the
dockergroup grants root-equivalent privileges. Only do this for trusted users.
Configure Docker to Start on Boot
# Enable Docker service
sudo systemctl enable docker.service
sudo systemctl enable containerd.servicePart 2: Docker CLI
What is Docker CLI?
The Docker CLI (docker command) is your primary interface for interacting with Docker Engine. It communicates with the Docker daemon via REST API.
Key Commands Overview
# Container Lifecycle
docker run nginx # Create and start a container
docker start <container> # Start a stopped container
docker stop <container> # Stop a running container
docker rm <container> # Remove a container
# Image Management
docker pull ubuntu:22.04 # Download an image
docker build -t myapp . # Build an image from Dockerfile
docker push myrepo/myapp # Push to registry
docker images # List local images
# Inspection
docker ps # List running containers
docker ps -a # List all containers
docker logs <container> # View container logs
docker inspect <container> # Detailed container infoDocker Compose CLI
Docker Compose is included with modern Docker installations:
# Start services defined in docker-compose.yml
docker compose up -d
# Stop and remove services
docker compose down
# View logs
docker compose logs -f
# Scale services
docker compose up -d --scale web=3CLI Configuration Tips
Set up Docker context for remote engines:
# Create a context for remote Docker host
docker context create remote-server \
--docker "host=ssh://user@remote-host"
# Switch to remote context
docker context use remote-server
# Run commands on remote Docker
docker ps # Now runs on remote-server!Useful aliases for your shell:
# Add to ~/.bashrc or ~/.zshrc
alias d='docker'
alias dc='docker compose'
alias dps='docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"'
alias dlog='docker logs -f'Part 3: Docker Desktop
What is Docker Desktop?
Docker Desktop is an all-in-one application that includes:
- Docker Engine
- Docker CLI
- Docker Compose
- Kubernetes (optional)
- GUI for container management
- Extensions marketplace
- Automatic updates
macOS Installation
Download and Install:
- Download from docker.com/products/docker-desktop
- Open the
.dmgfile - Drag Docker to Applications folder
- Launch Docker from Applications
Apple Silicon vs Intel:
# Check your chip architecture
uname -m
# Output:
# arm64 = Apple Silicon (M1/M2/M3)
# x86_64 = Intel Docker Desktop natively supports both architectures. For Apple Silicon:
- Native ARM containers run fastest
- Intel containers run via Rosetta 2 (slower but compatible)
- Some images may not have ARM variants yet
Resource Configuration:
Docker Desktop → Settings → Resources:
- CPUs: Allocate based on your workload (default: half of available)
- Memory: 4GB minimum, 8GB+ recommended for development
- Disk: Docker images can grow large; allocate accordingly
Windows Installation
Prerequisites:
- Windows 10/11 (64-bit) Pro, Enterprise, or Education
- WSL 2 enabled (recommended) OR Hyper-V
WSL 2 Backend (Recommended):
# Enable WSL
wsl --install
# Set WSL 2 as default
wsl --set-default-version 2
# Install a Linux distribution
wsl --install -d UbuntuThen download Docker Desktop from docker.com and install.
WSL Integration:
Docker Desktop → Settings → Resources → WSL Integration:
- Enable integration with your WSL distros
- Access Docker from within WSL without extra configuration
# Inside WSL Ubuntu
docker ps # Works directly! Windows Containers vs Linux Containers:
# Switch to Windows containers (right-click Docker icon)
# Or via CLI:
& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemon
# Check current mode
docker version --format '{{.Server.Os}}'Note: Most development uses Linux containers. Windows containers are mainly for legacy Windows applications.
Linux Installation (Docker Desktop)
Docker Desktop is also available for Linux (DEB/RPM packages):
# Ubuntu/Debian
sudo apt-get install ./docker-desktop-<version>-amd64.deb
# Fedora
sudo dnf install ./docker-desktop-<version>-x86_64.rpmWhen to use Desktop on Linux:
- You want the GUI management interface
- You need Kubernetes integration
- Unified experience across team (Mac/Windows/Linux)
When to skip it:
- Servers (use Engine only)
- Resource-constrained systems
- When you prefer CLI-only workflow
Docker Desktop Licensing
Docker Desktop licensing changed in 2021:
| Use Case | License |
|---|---|
| Personal use | Free |
| Education | Free |
| Small business (<250 employees, <$10M revenue) | Free |
| Large enterprises | Paid subscription required |
This is why alternatives have gained popularity…
Alternatives Comparison
For macOS
| Tool | Pros | Cons |
|---|---|---|
| Docker Desktop | Official, full-featured, K8s included | Resource heavy, licensing for enterprise |
| Colima | Lightweight, free, CLI-focused | No GUI, requires some setup |
| Rancher Desktop | Free, K8s-focused, GUI included | Uses nerdctl by default (different CLI) |
| Podman Desktop | Daemonless, rootless, OCI-compliant | Some Docker compatibility quirks |
| OrbStack | Fast, lightweight, excellent UX | Paid for commercial use |
Colima Quick Start:
# Install via Homebrew
brew install colima docker
# Start Colima with Docker runtime
colima start
# Use Docker CLI as normal
docker ps
docker run hello-worldOrbStack (if you want speed):
# Install
brew install orbstack
# It just works - Docker CLI is available immediately
docker run -d -p 80:80 nginxFor Windows
| Tool | Pros | Cons |
|---|---|---|
| Docker Desktop | Best WSL2 integration, official | Resource usage, licensing |
| Rancher Desktop | Free, K8s included | Newer, less mature on Windows |
| Podman Desktop | Daemonless architecture | WSL required, compatibility issues |
| WSL + Docker Engine | Full control, completely free | Manual setup required, no GUI |
WSL + Docker Engine (Free Alternative):
# Inside WSL Ubuntu
# Follow Linux Docker Engine installation above
# Then from Windows, use WSL to run Docker
wsl docker psFor Linux
| Tool | Pros | Cons |
|---|---|---|
| Docker Engine (native) | Best performance, official | CLI only |
| Podman | Daemonless, rootless, drop-in replacement | Minor compatibility differences |
| Docker Desktop | GUI, unified experience | Runs in VM (overhead), licensing |
| Rancher Desktop | GUI, K8s included | VM overhead |
Podman as Docker Alternative:
# Install Podman
sudo apt install podman # Debian/Ubuntu
sudo dnf install podman # Fedora
# Podman commands mirror Docker
podman run hello-world
podman ps
# Create alias for full compatibility
alias docker=podmanKey Podman differences:
- Daemonless: No background service required
- Rootless: Runs containers without root privileges
- Pod support: Native Kubernetes pod concept
- Docker-compatible: Most Docker commands work directly
Recommendations by Use Case
For Local Development
| Platform | Recommendation |
|---|---|
| macOS | Docker Desktop (convenience) or OrbStack (performance) |
| Windows | Docker Desktop with WSL 2 |
| Linux | Native Docker Engine |
For CI/CD Pipelines
# GitHub Actions example
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t myapp .
- name: Run tests
run: docker run myapp npm testUse Docker Engine only - no Desktop needed in CI environments.
For Kubernetes Development
| Tool | K8s Support |
|---|---|
| Docker Desktop | Built-in single-node cluster |
| Rancher Desktop | K3s (lightweight K8s) |
| minikube | Full K8s, multiple drivers |
| kind | K8s in Docker containers |
For Enterprise/Production Servers
# Production: Docker Engine only
# Never install Docker Desktop on servers
# Security hardening
sudo systemctl enable docker
sudo usermod -aG docker deploy-user # Specific user only
# Configure logging driver
cat <<EOF | sudo tee /etc/docker/daemon.json
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
EOF
sudo systemctl restart dockerTroubleshooting Common Issues
Permission Denied
# Error: permission denied while trying to connect to Docker daemon
# Solution 1: Add user to docker group
sudo usermod -aG docker $USER
newgrp docker
# Solution 2: Check Docker socket permissions
ls -la /var/run/docker.sock
# Should be: srw-rw---- 1 root dockerDocker Daemon Not Running
# Check status
sudo systemctl status docker
# Start if stopped
sudo systemctl start docker
# Check logs for errors
sudo journalctl -u docker.service -n 50Resource Issues (Docker Desktop)
# Check resource usage
docker system df
# Clean up unused resources
docker system prune -a
# Remove all stopped containers
docker container prune
# Remove unused images
docker image prune -aNetwork Conflicts
# Check Docker networks
docker network ls
# Inspect network
docker network inspect bridge
# If conflicts with host network, use custom network
docker network create --subnet=172.20.0.0/16 custom-net
docker run --network custom-net myappConclusion
Choosing the right Docker installation depends on your use case:
- Docker Engine: Production servers, CI/CD, minimal overhead
- Docker CLI: Always included, your primary interface
- Docker Desktop: Development machines, GUI management, K8s integration
For enterprises concerned about licensing, Podman, Colima, or Rancher Desktop are excellent free alternatives that maintain Docker compatibility.
The container ecosystem continues to evolve, but the core concepts remain the same. Whether you choose Docker, Podman, or another runtime, you’re embracing a powerful paradigm for building and deploying applications.