Command Palette

Search for a command to run...

Docker Installation Guide

Comprehensive guide for installing Docker across different operating systems with package manager specific commands.

This guide provides detailed instructions for installing Docker on various operating systems using their native package managers.

System Requirements

  • 64-bit processor
  • Minimum 4GB RAM
  • Supported operating system (see below)
  • Internet connection for package downloads

Installation Instructions

Ubuntu/Debian Installation

# Update package index
sudo apt update
 
# Install prerequisites
sudo apt install -y \
  apt-transport-https \
  ca-certificates \
  curl \
  gnupg \
  lsb-release
 
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
 
# Set up the stable repository
echo \
  "deb [arch=$(dpkg --print-architecture) 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
 
# Install Docker Engine
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
 
# Start and enable Docker
sudo systemctl start docker
sudo systemctl enable docker
 
# Verify installation
sudo docker --version
sudo docker run hello-world

Post-Installation Steps

# Create docker group
sudo groupadd docker
 
# Add your user to docker group
sudo usermod -aG docker $USER
 
# Apply new group membership
newgrp docker

Troubleshooting

Common Issues

Post-Installation Configuration

Docker Compose Installation

# Download Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
 
# Apply executable permissions
sudo chmod +x /usr/local/bin/docker-compose
 
# Verify installation
docker-compose --version

System Configuration

# Configure log rotation
sudo tee /etc/docker/daemon.json <<EOF
{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}
EOF
 
# Restart Docker
sudo systemctl restart docker

Next Steps