Skip to main content
Jorge Bernhardt Jorge Bernhardt
  1. Posts/

How to Install Docker on Windows Server

·316 words·2 mins· 100 views · 5 likes ·
Docker docker info docker run docker version

In this post, I want to show you how to install Docker on Windows Server 2016/2019. The process to install Docker in Windows Server is easy with the help of the PowerShell module of the OneGet provider.

Install Docker>

Install Docker #

To install the Docker-Microsoft PackageManagement Provider from the PowerShell Gallery. Run the following PowerShell commands as administrator.

Install-Module `
    -Name DockerMsftProvider `
    -Repository PSGallery `
    -Force

Install-Module
Once the installation of DockerMsftProvider is complete, Use the Install-Package cmdlet with the following syntax to install Docker.

Install-Package `
    -Name docker `
    -ProviderName DockerMsftProvider

Docker Windows Server
Important: The provider enables the container feature on their server. When the installation is complete, reboot the server. Run the following PowerShell command as administrator.

Restart-Computer `
    -Force
Verify the Docker installation>

Verify the Docker installation #

After installing the Docker package, you can run the following commands to verify that the installation was successful.

Windows Feature>

Windows Feature #

To verify that the container feature is enabled, we will use the cmdlet Get-WindowsFeature with the following syntax:

Get-WindowsFeature `
    -Name Containers

get-windowsfeature

Docker Version>

Docker Version #

To check the installed versions of docker, use the docker version command**.**

docker-version

Docker Properties>

Docker Properties #

And finally, to confirm the Docker client-engine communication is working fine, run the command docker info.

docker-info

Deploy a Test Container>

Deploy a Test Container #

Now that we have completed the installation and verified that everything is working correctly, we can run the first Windows container on Docker. Use the docker run command with the following syntax to download a sample image from the Docker Hub and deploy a container that runs a .Net “Hello World” application.

### Host version: Windows Server 2016
docker run microsoft/dotnet-samples:dotnetapp-nanoserver-sac2016

### Host version: Windows Server 2019
docker run microsoft/dotnet-samples:dotnetapp-nanoserver-1809

Docker Windows Server

Thanks for reading my post. I hope you find it useful.

If you want to know more about Windows containers, check out this link.