Docker is an open source platform that has revolutionized container-based application deployment. It solves the “but it works on my machine…” problem caused by differences between development and production environments! โจ In this guide, we’ll show you step-by-step how to install it for each major OS.
—.
๐ ๏ธ Preparation before installation
-
System Requirements.
- 64-bit processor + 4 GB or more RAM (virtualization support required)
- Windows/macOS: Latest version recommended
- Linux: Kernel 3.10 or later (Ubuntu 20.04 LTS recommended)
-
Check if virtualization is enabled Enable VT-x (Intel) or AMD-V** in BIOS/UEFI settings (Windows:
Ctrl+Shift+Esc
โ Performance tab โ check “Virtualization: Enabled”)
—]
๐ฅ๏ธ Installing on Windows
**1. install WSL 2
wsl --install
> Make sure to reboot before proceeding
**2. Download Docker Desktop Run the installation file from the official site
**3. installation options
- Check Use WSL 2 โ
- Restart after installation is complete
**4. verification command
docker --version
# Docker version 24.0.7, build afdd53b
docker run hello-world
—]
๐ Installing on macOS
**1. download Docker Desktop Select the Apple Chip or Intel Chip version
**2. installation process
- Run the downloaded
.dmg
file - Drag the Docker icon to the Applications folder
- Need to allow permissions on first run
**3. Setting up Rosetta (Apple Silicon) Run “`bash softwareupdate –install-rosetta
**4. Test the behavior
```bash
docker run -it ubuntu:22.04 /bin/bash
# root@a1b2c3d4:/#
—]
๐ง Installing on Linux (based on Ubuntu)
**1. Set up the repository
sudo apt update
sudo apt install ca-certificates curl gnupg
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
**2. Add a repository
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
**3. Install Docker Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io
**4. Set permissions (required!)
sudo usermod -aG docker $USER # grant permissions to the current user
newgrp docker # apply group settings
**5. start the service automatically
sudo systemctl enable --now docker
—]
๐งช Verify installation & run first container
docker version # Check Client/Server version
docker run -d -p 80:80 docker/getting-started
> Access http://localhost
in your browser โ Check the “Docker Getting Started” page โ
—]
๐ Docker Basic Commands Checklist
Command | Description | Example |
---|---|---|
docker ps |
Check running containers | docker ps -a (all) |
docker images |
List downloaded images | |
docker pull |
Download an image | docker pull nginx:latest |
docker rm |
Delete a container | docker rm -f [ID] (force delete) |
docker rmi |
Delete an image | docker rmi ubuntu:20.04 |
—]
โ ๏ธ Troubleshooting tips
- “Permission denied” error: **Use
sudo
or change the user todocker → Enable
sudoor add user to
docker` group - WSL related error on Windows]
โ After running PowerShell administrator privileges:
wsl --update wsl --shutdown
- Network problems.
โ Change DNS settings: In
/etc/docker/daemon.json
, add{ "dns": ["8.8.8.8"] }
append
—]
๐ฏ Wrapping up
After installing Docker, Steps to apply the actual project:
- Create
Dockerfile
โ 2. Build the image (docker build
) โ 3. Run the container (docker run
) Experience the magic of setting up your development environment from 1 hour to 5 minutes ๐ !
> ๐ข Note: Docker is a container technology, not a virtual machine. It features lighter and faster process isolation!
Install it now to start your container journey! Leave any questions in the comments ๐ #Docker #DevOps #Containerization