Get started: Prep Windows for containers

This tutorial describes how to:

Prerequisites

Windows Server

To run containers on Windows Server, you need a physical server or virtual machine running Windows Server (Semi-Annual Channel), Windows Server 2019, or Windows Server 2016.

For testing, you can download a copy of Windows Server 2019 Evaluation or a Windows Server Insider Preview.

Windows 10

To run containers on Windows 10, you need the following:

  • One physical computer system running Windows 10 Professional or Enterprise with Anniversary Update (version 1607) or later.
  • Hyper-V should be enabled.

Note

Starting with the Windows 10 October Update 2018, we no longer disallow users from running a Windows container in process-isolation mode on Windows 10 Enterprise or Professional for dev/test purposes. See the FAQ to learn more.

Windows Server Containers use Hyper-V isolation by default on Windows 10 in order to provide developers with the same kernel version and configuration that will be used in production. Learn more about Hyper-V isolation in the Concepts area of our docs.

Install Docker

The first step is to install Docker, which is required for working with Windows containers. Docker provides a standard runtime environment for containers, with a common API and command-line interface (CLI).

For more configuration details, see Docker Engine on Windows.

To install Docker on Windows Server, you can use a OneGet provider PowerShell module published by Microsoft called the DockerMicrosoftProvider. This provider enables the containers feature in Windows and installs the Docker engine and client. Here's how:

  1. Open an elevated PowerShell session and install the Docker-Microsoft PackageManagement Provider from the PowerShell Gallery.

    Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
    

    If you're prompted to install the NuGet provider, type Y to install it as well.

  2. Use the PackageManagement PowerShell module to install the latest version of Docker.

    Install-Package -Name docker -ProviderName DockerMsftProvider
    

    When PowerShell asks you whether to trust the package source 'DockerDefault', type A to continue the installation.

  3. After the installation completes, restart the computer.

    Restart-Computer -Force
    

If you want to update Docker later:

  • Check the installed version using:
Get-Package -Name Docker -ProviderName DockerMsftProvider
  • Find the current version using:
Find-Package -Name Docker -ProviderName DockerMsftProvider
  • When you're ready, upgrade using:
Install-Package -Name Docker -ProviderName DockerMsftProvider -Update -Force
  • Then, followed with:
Start-Service Docker

Next steps

Now that your environment has been configured correctly, follow the link to learn how to run a container.