Windows Server supports running Docker containers — useful for organizations standardizing on Windows infrastructure while still wanting containerization's deployment and isolation benefits.
Windows Containers vs Linux Containers on Windows
Windows Server can run genuine Windows containers (using Windows-based images) directly — distinct from running Linux containers via WSL2/Docker Desktop on a Windows client machine; this guide covers native Windows Server container support.
Prerequisites
- Windows Server 2019/2022
- Administrator access
Step 1 — Install the Containers Feature
Install-WindowsFeature -Name Containers
Restart-Computer -Force
Step 2 — Install Docker
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerMsftProvider -Force
Restart-Computer -Force
Step 3 — Verify Docker Is Running
docker version
Step 4 — Pull and Run a Windows Container Image
docker pull mcr.microsoft.com/windows/servercore/iis
docker run -d -p 80:80 mcr.microsoft.com/windows/servercore/iis
Understanding Windows Container Base Image Options
| Base Image | Size/Compatibility |
|---|---|
| Nano Server | Smallest, most restrictive compatibility |
| Server Core | Larger, broader Windows API compatibility |
Choose based on your application's actual compatibility requirements — Nano Server images are much smaller but support a more limited subset of the full Windows API surface.
Building a Custom Windows Container Image
# Dockerfile
FROM mcr.microsoft.com/windows/servercore/iis
COPY ./website C:\inetpub\wwwroot
docker build -t mywebsite .
Docker Compose on Windows Server
Install-Module -Name DockerCompose
Docker Compose functionality is available for orchestrating multi-container Windows container applications, similar in concept to Linux Docker Compose usage.
Important Limitation: No Cross-Platform Container Compatibility
Windows containers run Windows-based images; they cannot run Linux container images directly (and vice versa) — if you need to run both, you'd need separate infrastructure or specific hybrid configurations, not a single unified container runtime handling both transparently.
When Windows Containers Make Sense
- Containerizing existing Windows-specific applications (.NET Framework applications not yet ported to cross-platform .NET)
- Organizations standardized on Windows infrastructure wanting container benefits without a full Linux migration
Common Errors
"no matching manifest for windows" when pulling an image — you're likely trying to pull a Linux-only image; verify you're using a genuinely Windows-based image tag/variant.
Continue Reading
- How to Deploy an ASP.NET Application on IIS
- How to Install Docker Engine on Ubuntu & Debian (Complete Guide)
- Windows VPS vs Linux VPS: Which Should You Choose?
Browse more articles in Windows Server Administration.