Getting Started with Docker on Windows 11
This guide walks you from zero β running containers on Windows 11. No prior Docker knowledge needed.
Weβll cover:
- What Docker is (in plain English)
- Setting up WSL (required)
- Installing Docker Desktop using
winget - Running your first container
- Using Portainer as a visual UI
- Core concepts you actually need
π§ What is Docker (and why should you care?)β
Docker lets you run applications in containers β lightweight, isolated environments that include everything the app needs to run.
Instead of:
"It works on my machine"
You get:
"It works anywhere Docker runs"
π§± How Docker Works (Simplified)β
flowchart LR
A[Your App] --> B[Docker Container]
B --> C[Docker Engine]
C --> D[WSL2 Linux Kernel]
D --> E[Windows 11]
Key idea:
- Docker uses Linux under the hood
- On Windows β this is handled by WSL2
βοΈ Step 1 β Install WSL (Windows Subsystem for Linux)β
Docker Desktop depends on WSL.
Run this in PowerShell (Admin):β
wsl --install
This will:
- Enable WSL
- Install a Linux distro (usually Ubuntu)
- Set WSL2 as default
Then restart your PCβ
Verify WSL is working:β
wsl --status
You should see:
- Default Version: 2
π³ Step 2 β Install Docker Desktop using Wingetβ
Run:β
winget install -e --id Docker.DockerDesktop
After installation:β
- Launch Docker Desktop
- Accept the license
- Let it finish setup (it may restart WSL)
Verify Docker is running:β
docker --version
π Step 3 β Run Your First Containerβ
Letβs run the classic test:
docker run hello-world
What just happened?β
sequenceDiagram
participant You
participant Docker
participant DockerHub
participant Container
You->>Docker: run hello-world
Docker->>DockerHub: download image
DockerHub-->>Docker: image returned
Docker->>Container: start container
Container-->>You: success message
If everything worked, youβll see:
"Hello from Docker!"
π¦ Step 4 β Understanding Basic Concepts (No fluff)β
πΉ Imageβ
A template for a container
Example: nginx, postgres, hello-world
Think:
Blueprint
πΉ Containerβ
A running instance of an image
Think:
A live app created from the blueprint
πΉ Docker Hubβ
Public registry where images live
πΉ Volumeβ
Persistent storage for containers
Without volumes:
Data disappears when container stops
π§° Step 5 β Install Portainer (Visual UI for Docker)β
Portainer gives you:
- Web UI
- Container management
- Logs, stats, configs
Option A β Docker Desktop Extension (Easiest)β
- Open Docker Desktop
- Go to Extensions Marketplace
- Search for Portainer
- Click Install
Option B β Run Portainer manuallyβ
docker volume create portainer_data
docker run -d `
-p 9000:9000 `
--name portainer `
--restart=always `
-v /var/run/docker.sock:/var/run/docker.sock `
-v portainer_data:/data `
portainer/portainer-ce
Access Portainerβ
Open: http://localhost:9000
How Portainer Fits Inβ
flowchart LR
A[You] --> B[Portainer UI]
B --> C[Docker Engine]
C --> D[Containers]
β‘ Quick Example β Run a Web Serverβ
docker run -d -p 8080:80 nginx
Then open: http://localhost:8080
π§ Final Mental Modelβ
- Docker = runtime
- Image = blueprint
- Container = running app
- WSL = Linux layer on Windows
β You're Doneβ
You now have:
- Docker running on Windows 11
- Your first container executed
- A UI (Portainer) to manage everything
Thatβs Docker.