This article is based on information originally published via TechTarget covering Docker on Windows Server 2016.
Why Docker on Windows Server?
Windows Server 2016 introduced native support for Windows Containers, but to package, deliver, and manage container images effectively, Docker is required. Docker is not bundled with Windows Server 2016 — it must be downloaded and installed separately before you can create or run containers. Once in place, Docker becomes the primary runtime and toolchain for container workloads on Windows Server.
Key use cases include running isolated application workloads, managing microservices, and supporting CI/CD pipelines — all on familiar Windows Server infrastructure.
Docker Architecture: Client and Engine
Docker uses a client-server architecture. On Windows Server, this means two main components are installed:
- Docker Engine (
dockerd.exe) — the daemon process that builds and runs containers. - Docker Client (
docker.exe) — the command-line tool used to issue instructions to the Docker Engine.
The Docker client communicates with the daemon over a local socket or across a network connection, allowing remote management of Docker hosts — including Windows Server 2016 virtual machines.
Configuring Docker on Windows Server
After installation, Docker on Windows Server typically requires configuration to match your environment. Common configuration tasks include:
- Setting the port number Docker uses to accept incoming network connections
- Enabling TLS for secured daemon connections
- Defining storage and disk paths for container image layers
There are two primary ways to apply this configuration:
1. The daemon.json Configuration File
The preferred method is editing (or creating) the daemon configuration file at:
C:\ProgramData\docker\config\daemon.jsonCode language: CSS (css)
If this file does not exist, you can create it. A minimal example enabling a specific host binding might look like:
{
"hosts": ["tcp://0.0.0.0:2376", "npipe://"],
"tlsverify": true,
"tlscacert": "C:\\ProgramData\\docker\\certs.d\\ca.pem",
"tlscert": "C:\\ProgramData\\docker\\certs.d\\server-cert.pem",
"tlskey": "C:\\ProgramData\\docker\\certs.d\\server-key.pem"
}Code language: JSON / JSON with Comments (json)
2. The sc config Command
Alternatively, the Windows sc config command can be used from an elevated command prompt to pass Docker Engine flags directly to the service definition. This approach is useful for scripted or automated deployments where a configuration file is not practical.
Container Orchestration with Docker Swarm Mode
Windows Server 2016 supports Docker Swarm mode, which enables:
- Clustering — grouping multiple Docker host systems into a single, manageable pool
- Workload scheduling — distributing container workloads across nodes automatically
- High availability — handling node failures by redistributing container tasks
Swarm mode makes Docker a viable orchestration tool for teams not yet adopting Kubernetes, particularly in Windows-centric environments. Docker host systems can also be provisioned on Windows Server 2016 VMs and accessed or managed remotely using the Docker client.
Container Image Automation with Dockerfiles
One of Docker’s most important features for DevOps workflows is container image automation. Container images are defined as code, making them reproducible, version-controlled, and easy to update. This is a cornerstone of continuous integration (CI) pipelines.
Docker provides two key components for image automation:
- Dockerfile — a plain-text file containing the instructions needed to define a container image, including the base image, file copies, environment variables, and the startup command.
- docker build — the Docker Engine command that reads a specified Dockerfile and produces a runnable container image.
A basic Windows Server-based Dockerfile example:
# Use the official Windows Server Core base image
FROM mcr.microsoft.com/windows/servercore:ltsc2016
# Set the working directory
WORKDIR /app
# Copy application files
COPY . .
# Define the entry point
CMD ["myapp.exe"]Code language: PHP (php)
Build the image from this Dockerfile with:
docker build -t myapp:latest .Code language: CSS (css)
Managing Docker with Windows PowerShell
Docker on Windows Server integrates with Windows PowerShell through a dedicated module that extends PowerShell’s capabilities to manage Docker Engine. This allows administrators to:
- Provision and configure containers using PowerShell scripts
- Combine Docker management tasks with other PowerShell administrative workflows
- Automate container lifecycle operations within existing Windows management frameworks
To use this module, the following prerequisites apply:
- A supported version of Windows, Windows Server, or Nano Server
- PowerShell 5 or PowerShell 6 (PowerShell Core)
- One or more Docker containers available to manage
Install the Docker PowerShell module from the PowerShell Gallery:
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Summary
Docker on Windows Server 2016 provides a complete platform for building, running, and managing Windows containers. From initial installation and daemon configuration through Dockerfile-driven image automation, Swarm-based orchestration, and PowerShell integration, Docker gives DevOps teams a consistent container toolchain on Windows infrastructure. While newer Windows Server releases and tooling (such as containerd) have since evolved the ecosystem, the fundamentals covered here remain relevant for teams working in Windows-centric environments.