HOWTOIntermediate

Docker Windows Containers: Native Engine Setup Guide

Deploy Docker Engine natively on Windows without Docker Desktop. Covers installation, Windows container mode, lifecycle management, and troubleshooting.

Security Team

Security Engineering

February 3, 2026
6 min read
Docker Windows Containers: Native Engine Setup Guide

Prerequisites

  • Windows 10/11 Pro or Windows Server
  • Administrator privileges
  • Hyper-V capable hardware

Overview

Native Docker Engine installation provides lightweight Windows container environments without Docker Desktop overhead, licensing complexity, or WSL2 dependencies. This approach is ideal for development, CI/CD runners, and production-like environments.

Who Should Use This Guide:

  • Developers needing Windows containers without Docker Desktop licensing
  • DevOps engineers setting up CI/CD build servers
  • System administrators deploying container hosts
  • Organizations with >250 employees avoiding Docker Desktop licensing

Why Native Docker Engine:

BenefitDescription
Cost SavingsAvoid Docker Desktop commercial licensing requirements
Resource EfficiencyLower RAM and CPU usage than Docker Desktop
Production ParityMatches Windows Server container deployments
SimplicityNo WSL2 or Hyper-V GUI components required

Requirements

System Requirements:

ComponentRequirement
Operating SystemWindows 10/11 Pro/Enterprise or Windows Server 2019/2022
RAM4GB minimum, 8GB+ recommended
Disk Space20GB+ free for images
ProcessorHyper-V capable with virtualization enabled

Windows Features Required:

FeaturePurpose
Microsoft-Hyper-VContainer isolation
ContainersWindows container support

Process

Step 1: Enable Windows Features

Enable required Windows features for container support.

PowerShell (Run as Administrator):

# Enable Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -All -NoRestart
 
# Enable Containers feature
Enable-WindowsOptionalFeature -Online -FeatureName Containers -All -NoRestart
 
# Restart to apply changes
Restart-Computer

Verification:

Get-WindowsOptionalFeature -Online | Where-Object {$_.FeatureName -match "Hyper-V|Containers"}

Expected Result: Features show as "Enabled".


Step 2: Download Docker Engine

Download the latest Docker Engine binaries directly from Docker.

Download Latest Version:

# Create installation directory
$installPath = "C:\Program Files\Docker"
New-Item -Path $installPath -ItemType Directory -Force
 
# Download Docker (check docker.com for latest version)
$dockerUrl = "https://download.docker.com/win/static/stable/x86_64/docker-<version>.zip"
$tempZip = "$env:TEMP\docker.zip"
 
Invoke-WebRequest -Uri $dockerUrl -OutFile $tempZip
 
# Extract to temp location
$tempExtract = "$env:TEMP\docker-extract"
Expand-Archive -Path $tempZip -DestinationPath $tempExtract -Force
 
# Copy binaries to install location
Copy-Item -Path "$tempExtract\docker\*" -Destination $installPath -Recurse -Force

Verification:

Test-Path "C:\Program Files\Docker\dockerd.exe"

Expected Result: Returns True.


Step 3: Register Docker Service

Register Docker daemon as a Windows service.

Register Service:

# Register dockerd as a service
& "C:\Program Files\Docker\dockerd.exe" --register-service
 
# Add Docker to system PATH
$currentPath = [Environment]::GetEnvironmentVariable("PATH", "Machine")
if ($currentPath -notlike "*Docker*") {
    [Environment]::SetEnvironmentVariable(
        "PATH",
        "$currentPath;C:\Program Files\Docker",
        "Machine"
    )
}
 
# Refresh PATH in current session
$env:PATH = [Environment]::GetEnvironmentVariable("PATH", "Machine")

Verification:

Get-Service docker

Expected Output:

Status   Name               DisplayName
------   ----               -----------
Stopped  docker             Docker Engine

Step 4: Start Docker Service

Start the Docker service and verify it's running.

Start Service:

Start-Service docker
 
# Wait for Docker to be ready
$maxAttempts = 12
$attempt = 0
do {
    Start-Sleep -Seconds 5
    $attempt++
    try {
        docker version | Out-Null
        Write-Host "Docker is ready!" -ForegroundColor Green
        break
    } catch {
        Write-Host "Waiting for Docker... ($attempt/$maxAttempts)"
    }
} while ($attempt -lt $maxAttempts)

Verification:

docker version

Expected Output:

Client: Docker Engine - Community
 Version:           27.x.x
 API version:       1.47
 ...

Server: Docker Engine - Community
 Engine:
  Version:          27.x.x
  ...

Step 5: Test Installation

Run a test container to verify everything works.

Run Test Container:

# Pull and run hello-world
docker run hello-world

Expected Output: "Hello from Docker!" message confirming successful installation.

Test Windows Container:

# Pull Windows Server Core image
docker pull mcr.microsoft.com/windows/servercore:ltsc2022
 
# Run interactive PowerShell
docker run -it mcr.microsoft.com/windows/servercore:ltsc2022 powershell

Step 6: Configure Docker Daemon

Customize Docker daemon settings for your environment.

Create daemon.json (C:\ProgramData\Docker\config\daemon.json):

{
  "storage-driver": "windowsfilter",
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  },
  "dns": ["8.8.8.8", "8.8.4.4"]
}

Apply Configuration:

Restart-Service docker

Update Docker Engine

Update to the latest version while preserving containers and images.

Update Process:

# Check current version
docker version --format '{{.Server.Version}}'
 
# Stop Docker service
Stop-Service docker
 
# Backup current installation
Copy-Item "C:\Program Files\Docker" "C:\Program Files\Docker.backup" -Recurse
 
# Download and extract new version (same as Step 2)
# Copy new binaries to C:\Program Files\Docker
 
# Re-register service
& "C:\Program Files\Docker\dockerd.exe" --register-service
 
# Start Docker
Start-Service docker
 
# Verify new version
docker version

What's Preserved:

  • All containers (running and stopped)
  • All images
  • All volumes
  • All networks

Remove Docker Engine

Complete removal for clean reinstallation or system cleanup.

Removal Process:

# Stop Docker service
Stop-Service docker -Force
 
# Remove service registration
& sc.exe delete docker
 
# Remove Docker directories
Remove-Item "C:\Program Files\Docker" -Recurse -Force
Remove-Item "C:\ProgramData\Docker" -Recurse -Force
 
# Remove from PATH
$path = [Environment]::GetEnvironmentVariable("PATH", "Machine")
$newPath = ($path.Split(';') | Where-Object { $_ -notlike "*Docker*" }) -join ';'
[Environment]::SetEnvironmentVariable("PATH", $newPath, "Machine")
 
# Remove Docker virtual switches
Get-VMSwitch | Where-Object { $_.Name -like "*Docker*" } | Remove-VMSwitch -Force

Note: Reboot before reinstalling Docker.



Common Docker Commands

Container Management:

# List all containers
docker ps -a
 
# Start/stop container
docker start <container-id>
docker stop <container-id>
 
# Remove container
docker rm <container-id>
 
# Remove all stopped containers
docker container prune -f

Image Management:

# List images
docker images
 
# Pull image
docker pull mcr.microsoft.com/windows/servercore:ltsc2022
 
# Remove image
docker rmi <image-id>
 
# Remove unused images
docker image prune -f

Service Management:

# Check Docker service status
Get-Service docker
 
# Start/stop/restart Docker
Start-Service docker
Stop-Service docker
Restart-Service docker
 
# View Docker service logs
Get-EventLog -LogName Application -Source Docker -Newest 20


Troubleshooting

Common Issues:

SymptomPossible CauseSolution
Cannot connect to daemonService not runningRun Start-Service docker
Hyper-V not enabledFeature missingEnable Hyper-V feature and reboot
Permission deniedNot running as adminRun PowerShell as Administrator
Container mode unavailableContainers feature missingEnable Containers feature
Network connectivity issuesDocker NAT misconfiguredRestart Docker service

Diagnostic Commands:

# Check Docker info
docker info
 
# Check Docker service status
Get-Service docker
 
# Check Windows features
Get-WindowsOptionalFeature -Online | Where-Object {$_.FeatureName -match "Hyper-V|Containers"}
 
# Check Docker network
docker network ls
 
# Check Docker logs
Get-EventLog -LogName Application -Source Docker -Newest 50

Verification Checklist

Installation:

  • Hyper-V feature enabled
  • Containers feature enabled
  • Docker binaries installed
  • Docker service registered

Operation:

  • Docker service running
  • docker version shows client and server
  • docker run hello-world succeeds
  • Windows container images pull successfully

Configuration:

  • PATH includes Docker directory
  • daemon.json configured (if needed)
  • Service set to automatic start

References


Last Updated: February 2026