How to Install Docker on Windows Server

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 ImageSize/Compatibility
Nano ServerSmallest, most restrictive compatibility
Server CoreLarger, 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

Browse more articles in Windows Server Administration.

  • docker on windows server, windows containers, windows server containerization, docker windows installation
  • 0 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

İlgili diğer dökümanlar

How to Connect to a Windows VPS via Remote Desktop (RDP)

Remote Desktop Protocol (RDP) provides full graphical access to a Windows Server VPS, letting you...

How to Secure RDP on a Windows VPS

RDP's default configuration (standard port, password authentication, unlimited login attempts)...

How to Create a New Administrator User on Windows Server

Using only the built-in Administrator account for all management tasks is risky. Creating a...

How to Install Windows Updates on a Windows VPS

Keeping Windows Server updated is essential for security and stability. This guide covers...

How to Configure Windows Firewall on a Windows VPS

Windows Defender Firewall controls which network connections are allowed to and from your server....