Skip to main content

Getting Started with Docker on Windows 11

Β· 3 min read

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:​

  1. Launch Docker Desktop
  2. Accept the license
  3. 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)​

  1. Open Docker Desktop
  2. Go to Extensions Marketplace
  3. Search for Portainer
  4. 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.