You are on page 1of 1

CentOS Ubuntu Fedora Debian Rocky FreeBSD Openstack Windows About Us Contact us Terms

A liates Disclosure

HOW TO AUTOMATION VIRTUALIZATION CONTAINERS DATABASES ELECTRONICS BOOKS COURSES 

HIRE US

Home  Windows  Run Docker Containers on Windows Server 2019

Windows Containers Docker How To Windows server Windows Tips

Run Docker Containers on Windows Server 2019


By Josphat Mutai - November 21, 2023  261339  22

In this tutorial, we will look at how you can con gure your
Windows server 2019 to run Docker containers. Docker has
been a game changer in Applications containerization and the
whole microservices design and deployment patterns. Docker
makes it easy to build, ship and run images containing
applications with their dependencies and avoid crazy

dependency issues common with the use of Virtual Machines.

Docker engine is what powers docker containers. It was


originally written for Linux but a lot of work has been done to
enable Windows and macOS users to run Docker containers.

One pre-requisite is the installation of a Windows server. This


can be on a Virtual Machine running on-premise, a Physical
server deployment or a Cloud instance running in Azure. You
can refer to our installation guide below.

How to Install Windows Server 2019 Step by Step


Ads by
How to run Docker Containers on Stop seeing this ad

Windows Server 2019 Why this ad?

Before you can use the Windows Containers to run multiple


isolated applications your system, you’ll need to enable the
containers feature and install Docker on Windows Server
2019.

Recent Posts

How to Restore Old


Photos with AI Photo
Restoration
Modi ed date: November
20, 2023

7 Feature-rich Smart
Thermostats to Elevate
your Home
Modi ed date: November
14, 2023

HiBob Minimizes Data


Security Vulnerabilities
with Cloud Solutions
Modi ed date: November
13, 2023

Fedora 39 Released –
Steps of Installing it in
your computer
Modi ed date: November
11, 2023

Step 1: Enable the containers feature Keeping HRIS Data


Clean: Best Practices for
The rst step is to enable the Windows Server 2019 Data Hygiene
Modi ed date: November
containers feature. Open PowerShell as Administrator. 10, 2023

Meshery – Tool to
Manage Kubernetes and
Applications
Modi ed date: November
11, 2023

9 Best Kubernetes UI
Management Tools
Modi ed date: November
7, 2023

What Is Azure Cost


Optimization?
Modi ed date: November
6, 2023

Run the following commands.

WindowsOptionalFeature -Online -FeatureName Containers

Accept by pressing the y key in your keyboard.

Step 2: Install Docker Engine on Windows Server


2019

Once the Containers feature is enabled on Windows Server


2019, install the latest Docker Engine and Client by running
the command below in your PowerShell session.

In this guide we install Docker Community Edition (CE) which


provides a standard runtime environment for containers with
a common API and command-line interface (CLI). Microsoft
Windows Server team created a powershell script that
More Content
enables you to con gure system environment for running
containerized workloads. Install VMware vSphere
ESXi 7 on Intel NUC
10/11
Modi ed date:
September 30, 2022

How To Setup Flarum


discussion forum on
Ubuntu 22.04
Modi ed date: May 12,
2023

How To Install
Nouvelles options de sécurité PostgreSQL 12 on
Debian 12/10/9
Découvrez de nouvelles façons de gérer la con dentialité de Modi ed date: August 23,
2023
Facebook. Ouvrez Facebook
Semaphore – Manage
Ansible Tasks from A
Web UI
Modi ed date: April 20,
2022

How To Install Ifcon g


on RHEL 8 / CentOS 8
Linux
Modi ed date: April 29,
2020
Let’s download the script.
Recover Deleted Files
with EaseUS Data
dows-Containers/Main/helpful_tools/Install-DockerCE/in Recovery Wizard
Modi ed date:
September 9, 2020

After it’s available locally let’s use it to install Docker CE:


Install oVirt Guest Agent
on CentOS 8 | RHEL 8
Modi ed date:
.\install-docker-ce.ps1 September 16, 2023

How To Install Redis on


Expected output from command execution in PowerShell. Ubuntu
22.04|20.04|18.04
Modi ed date: January
19, 2022

How To Install and Use


AWS CLI on Linux
Modi ed date: August 20,
2023

Perform Proper Rsyslog


When the installation is complete, reboot the computer. Logs Rotation using
logrotate
Modi ed date: October 3,
2023

Books

Best Cybersecurity
Books To Read in 2023
Modi ed date: July 19,
2023

Best Books To Learn


Cloud Computing in
2023
Modi ed date: August 22,
2023

Best Books To Learn


NoSQL & MongoDB
Databases in 2023
Modi ed date: November
17, 2023

Top Certi ed
Information Security
Manager (CISM) study
Restart-Computer -Force
books
Modi ed date: July 19,
2023
Installed Docker version can be checked with the commands
Best Google Cloud
below: Certi cation Guides &
Books for 2023
Modi ed date: August 22,
PS C:\Users\Administrator> docker version 2023

Client: Best Books To Learn


HTML & HTML5 in 2023
Version: 24.0.7
Modi ed date: June 19,
2023
API version: 1.43
Go version: go1.20.10 Best Books To Master R
Programming in 2023
Git commit: afdd53b Modi ed date:
September 23, 2023
Built: Thu Oct 26 09:08:44 2023
OS/Arch: windows/amd64 Best CompTIA CySA+
(CS0-002) Certi cation
Context: default Study Books 2023
Modi ed date: November
4, 2023

Server: Docker Engine - Community Top Best Android


Engine: Programming Books
2023
Version: 24.0.7 Modi ed date: July 6,
2023
API version: 1.43 (minimum version 1.24)
Best Books To Learn
Go version: go1.20.10 Redis and Memcached
Git commit: 311b9ff Caching in 2023
Modi ed date: October 7,
Built: Thu Oct 26 09:07:37 2023 2023

OS/Arch: windows/amd64 Best Books For


Learning CI/CD
Experimental: false Pipelines in 2023
Modi ed date:
September 26, 2023
To manually start the service run:
Best Books To Learn
Operating Systems in
2023
Start-Service Docker
Modi ed date: August 23,
2023

To stop Docker service execute; Best FreeBSD Books To


Read in 2023
Modi ed date: October
10, 2023
Stop-Service Docker
Best Books To Learn C#
and .NET Programming
Step 3: Run Docker Container in 2023
Modi ed date: July 12,
2023
Start Docker Daemon before you start running and managing
Best Books To Learn
Docker Containers. Blockchain and
Cryptocurrency
Technologies in 2023
Start-Service Docker Modi ed date: July 19,
2023

Best Books To Learn


After starting Docker Engine service, Download the pre- Tomcat|Jboss|Jetty web
created .NET sample image from the Docker Hub registry: servers in 2023
Modi ed date: October 7,
2023

docker run --rm mcr.microsoft.com/dotnet/samples Best Penetration Testing


Books for 2023
Modi ed date: August 28,
You can quickly run a container with a pre-built .NET Docker 2023

image, based on the ASP.NET Core sample. Best Books To Learn


Data Security &
Encryption in 2023
docker run -it --rm -p 8000:8080 --name aspnetcore_sa Modi ed date:
September 23, 2023

Best LPIC-1 and LPIC-2


Microsoft repository contains several base images, see certi cation study books
2023
Container base images for more details. Let’s see how you can Modi ed date:
September 21, 2023
download and install the base image:
Best C/C++
Programming Books for
docker pull mcr.microsoft.com/windows/nanoserver:ltsc Beginners 2023
Modi ed date:
September 21, 2023

Step 4: Running Linux Containers Best Books To Learn


WordPress Development
in 2023
Enable Nested Virtualization if you’re running Docker Modi ed date: August 23,
2023
Containers using Linux Virtual Machine running on Hyper-V.
Best Project
Management
Get-VM WinContainerHost | Set-VMProcessor -ExposeVirt Professional (PMP)
Certi cation Books
2023
Modi ed date:
Enable LinuxKit system for running Linux containers September 23, 2023

Best Books To Learn


[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED Spring Boot
Development in 2023
Modi ed date: November
4, 2023
Restart Docker Service after the change.
Top RHCSA / RHCE
Certi cation Study
Restart-Service docker Books 2023
Modi ed date: August 22,
2023

Enable Experimental Features in Docker daemon.conf Best Books To Learn


Kafka & Apache Spark
in 2023
$configfile = @” Modi ed date:
September 21, 2023

Best Kubernetes Study


{
books for 2023
Modi ed date: June 14,
2023
“experimental”: true
Best Arduino and
Raspberry Pi Books For
2023
}
Modi ed date:
September 21, 2023

“@ Best Books to learn Web


Development – PHP,
HTML, CSS,
JavaScript...
$configfile|Out-File -FilePath C:\ProgramData\docker\
Modi ed date: June 19,
2023

Since Linux Containers need a Linux kernel, we need to Best Books To Help You
Start an Online Business
deploy LCOW for it to run : in 2023
Modi ed date: July 19,
2023

Invoke-WebRequest -Uri "https://github.com/linuxkit/l


Best Apache and Nginx
Expand-Archive release.zip -DestinationPath "$Env:Pro reference Books for
2023
Modi ed date:
September 23, 2023

···
Pull a test docker image.

···

> docker run -it --rm ubuntu /bin/bash


root@1440a7fef7e0:/# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/term
UBUNTU_CODENAME=jammy

root@1440a7fef7e0:/# exit
exit

To Switch back to running Windows containers, run:

[Environment]::SetEnvironmentVariable("LCOW_SUPPORTED

Enjoy running Linux and Windows containers on Windows


Server 2019. Drop us a comment in case of any issues.

Books For Learning Kubernetes Administration;

Best Kubernetes Study books

Also check:

How to install Applications from Windows command line

How to Allow ICMP Echo Reply on Windows Server 2019

How to enable Remote Desktop Protocol (RDP) on Windows


Server 2019

How to run Linux on Windows Server 2019 with WSL

YOU CAN SUPPORT OUR WORK


WITH A CUP OF COFFEE

As we continue to grow, we would wish


to reach and impact more people who
visit and take advantage of the guides
we have on our blog. This is a big task
for us and we are so far extremely
grateful for the kind people who have
shown amazing support for our work
over the time we have been online.

Thank You for your support as we work


to give you the best of guides and
articles. Click below to buy us a coffee.

TAGS windows server 2019

Previous article Next article

How To Install ArangoDB on Set Strong Password Policy on


Ubuntu 20.04/18.04 Ubuntu / Debian Linux

Josphat Mutai
https://computingforgeeks.com/

Founder of Computingforgeeks. Expertise in


Virtualization, Cloud, Linux/UNIX Administration,
Automation,Storage Systems, Containers, Server
Clustering e.t.c.

 

···

···

RELATED ARTICLES MORE FROM AUTHOR

How To Databases Windows server

Install Windows Service Install SQL Server 2019 Con gure NTP Server in
Update Services (WSUS) Developer Edition on Windows Server
on Windows server 2019 Windows Server 2019 2019/2022

How To How To Windows

How To add DNS Reverse How To add FTP Site on Install and Con gure FTP
Lookup Zone in Windows Windows Server 2019 Server on Windows
Server 2019 Server 2019

How To Windows Windows server

Con gure OpenSSH Con gure iSCSI Initiator Install and Con gure
Server on Windows on Windows Server 2019 iSCSI Target on Windows
Server 2019 Server 2019

 

22 COMMENTS

vamsidhar July 29, 2021 At 7:49 am

How is this different from using Docker Desktop for


Windows ?
Reply

Josphat Mutai July 31, 2021 At 12:54 pm

This is a better approach for server edition


Reply

khalyl August 1, 2021 At 7:37 pm

I had to use this link to pull the image


mcr.microsoft.com/dotnet/samples:dotnetapp-
nanoserver-1809
Reply

Josphat Mutai August 2, 2021 At 4:54 pm

Thanks for sharing the note, we’ve updated the


text in the article.
Reply

Sjors August 9, 2021 At 5:18 pm

Hi Josphat,

It gives back the error below, but 10.0.17763 is the


latest Windows Server 2019 right?

PS C:\Users\Administrator> docker run


mcr.microsoft.com/dotnet/samples:dotnetapp-
nanoserver-2009
Unable to find image
‘mcr.microsoft.com/dotnet/samples:dotnetapp-
nanoserver-2009’ locally
dotnetapp-nanoserver-2009: Pulling from
dotnet/samples
docker: a Windows version 10.0.19042-based image
is incompatible with a 10.0.17763 host.
See ‘docker run –help’.
Reply

Sjors August 9, 2021 At 11:19 pm

Thank you for providing the list, I didn’t see it..


Reply

Sjors August 9, 2021 At 11:46 pm

Get-VM WinContainerHost | Set-VMProcessor -


ExposeVirtualizationExtensions $true gives the
respons:

Get-VM : The term ‘Get-VM’ is not recognized as the


name of a cmdlet, function, script file, or operable
program.
Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ Get-VM WinContainerHost | Set-VMProcessor -
ExposeVirtualizationExtens …
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-VM:String) [],
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

What am I doing wrong?


Reply

m todd August 18, 2021 At 7:46 am

The Hyper-V Module for Windows PowerShell is


not installed.
Reply

Alex November 11, 2021 At 11:09 am

PS C:\Users\Administrator> docker run -it –rm ubuntu /bin/bash


Unable to find image ‘ubuntu:latest’ locally
latest: Pulling from library/ubuntu
7b1a6ab2e44d: Extracting [==================================================>] 28.57MB/28.57MB
C:\Program Files\Docker\docker.exe: failed to register layer: failed to start service utility VM (applydiff
14bdd1b0a2720d4917a811d0cbef7c71ce996a1e0f867197586ccacfe74e6cc3): container
14bdd1b0a2720d4917a811d0cbef7c71ce996a1e0f867197586ccacfe74e6cc3_svm encountered an error during CreateContainer: failure in a Windows system call:
The request is not supported. (0x32) extra info:
{“SystemType”:”container”,”Name”:”14bdd1b0a2720d4917a811d0cbef7c71ce996a1e0f867197586ccacfe74e6cc3_svm”,”Layers”:null,”HvPartition”:true,”HvRuntime”
{“ImagePath”:”C:\\Program Files\\Linux
Containers”,”LinuxInitrdFile”:”initrd.img”,”LinuxKernelFile”:”bootx64.efi”},”ContainerType”:”linux”,”TerminateOnLastHandleClosed”:true}.
See ‘C:\Program Files\Docker\docker.exe run –help’.
Reply

Josphat Mutai June 6, 2022 At 2:57 pm

Did you get it to work?


Reply

tony November 17, 2022 At 10:35 pm

I have the same problem. Did you get any clue?


Reply

Atanu April 13, 2022 At 5:09 pm

In the linux container part along with restarting the


docker service, the machine restart is also required.
Atleast in my case it worked after that.

Restart-Service docker
Restart-Computer -Force

Thanks.
Reply

Josphat Mutai April 13, 2022 At 7:49 pm

Noted with thanks.


Reply

tony November 17, 2022 At 10:34 pm

I have the same problem to Alex, who has any


solution?
Reply

Mike Jarosch June 1, 2023 At 11:45 pm

Are these instructions still valid given transition of support? Is this


now installing an older version? Do we need to be licensed for
this now?
https://techcommunity.microsoft.com/t5/containers/updates-
to-the-windows-container-runtime-support/ba-p/2788799
Reply

Lucas June 27, 2023 At 3:28 pm

This howto is deprecated, see


https://github.com/OneGet/MicrosoftDockerProvider
and
https://learn.microsoft.com/en-
us/virtualization/windowscontainers/quick-start/set-
up-environment?tabs=dockerce#windows-server-1
Reply

Zbynek August 22, 2023 At 8:55 pm

Hi, I’m trying to follow your guide to run Linux based


docker on the Win server 2019. When I try pull or run
ubuntu:latest I get error:
docker : Error response from daemon: missing
signature key

Please help.
I already restarted the docker service as well as the
machine several times.
Trying it as an Administrator…
Thanks.
Reply

Klinsmann Öteyo August 27, 2023 At 10:35 am

Try pulling an image from the Microsoft


Container Registry
Reply

Bill September 3, 2023 At 5:16 am

Can you have both Windows & Linux docker containers


running at the same time on Server 2019? I can see
here its one or the other or have I missed a section?
Reply

Klinsmann Öteyo September 3, 2023 At 12:51 pm

Hello @Bill,
We only have the Linux container running on
Windows.
Reply

Jozef November 20, 2023 At 3:03 pm

Hi, on W2019 I am unable to pass the very first step :


C:\Users\Administrator> Install-Package -Name docker -ProviderName DockerMsftProvider
WARNING: Cannot find path
‘C:\Users\ADMINI~1\AppData\Local\Temp\2\DockerMsftProvider\DockerDefault_DockerSearchIndex.json’
because it does not exist.
WARNING: Cannot bind argument to parameter ‘downloadURL’ because it is an empty string.
WARNING: The property ‘AbsoluteUri’ cannot be found on this object. Verify that the property exists.
WARNING: The property ‘RequestMessage’ cannot be found on this object. Verify that the property exists.
Install-Package : No match was found for the specified search criteria and package name ‘docker’. Try
Get-PackageSource to see all available registered package sources.
At line:1 char:1
+ Install-Package -Name docker -ProviderName DockerMsftProvider
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package],
Exception
+ FullyQualifiedErrorId :
NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

Any ideas how to proceed?


Reply

Josphat Mutai November 21, 2023 At 4:40 pm

Please check updated article. It should work.


Reply

LEAVE A REPLY

Comment:

Name:*

Email:*

Website:

Save my name, email, and website in this browser for the next
time I comment.

Post Comment

Sponsored Content

Getting a MBA Here's What Download


Degree in the USA Unsold Dubai Villas 16,000+
Might be Easier Might Cost You In Woodworking
MBA Degrees | Dubai Villas | Search TedsWoodworking
Search Ads Ads

Check Out Our More People Treatment That


Recommendations Switching To VoIP Might Help You
Curated Just for Phones (Take A Against Knee Pain
DiscoveryFeed VOIP Phones | Search Knee Pain Treatment
Ads | Search Ads

Recommended by

···

FEATURED POSTS HOT PICKS POPULAR CATEGORY

Install Flatcar Container How To Install PHP 7.4


How To 2967
Linux on VMware ESXI / on Ubuntu
vCenter 20.04|18.04|16.04 Linux Tutorials 1907
Modi ed date: Modi ed date: October
September 15, 2023 25, 2023 Tech 909

News 732
Deploy Kubernetes Can’t Delete a File or
Cluster using VMware Folder in Windows 10? Ubuntu 519
Photon OS Force Delete...
Modi ed date: Modi ed date: November
CentOS 452
September 15, 2023 30, 2022
Tips & Tricks 337
How To Send WordPress How To Install AnyDesk Dev 312
Noti cations on Email on Ubuntu
Using Gmail 22.04|20.04|18.04 Debian 307
Modi ed date: Modi ed date: November
September 15, 2023 17, 2023

Install and Use How To Install Python


Books
KubeSphere on existing 3.10 on Ubuntu
Kubernetes cluster 22.04|20.04|18.04
Modi ed date: November Modi ed date: Best Books To Learn
8, 2023 September 21, 2023
Rust Programming in
2023
Install and Con gure How To Install Node.js
Modi ed date: August 22,
Trae k Ingress 14 on Ubuntu 2023
Controller on 22.04|20.04|18.04
Kubernetes Modi ed date: October Best Java Programming
23, 2023
Modi ed date: August 18, Books for 2023
2023
Modi ed date: August 25,
Join Ubuntu 2023
Top Smart Plug Power 20.04|18.04 / Debian 10
Strips To Buy in 2023 To Active Directory (AD) Best Books To Learn
Modi ed date: domain Ruby Programming in
September 15, 2023
Modi ed date: October 4, 2023
2022
Modi ed date: August 28,
How To Run Ansible 2023
AWX on Kubernetes / Install MariaDB 10.6 on
OpenShift Cluster Ubuntu 18.04 and Best Project
Modi ed date: August 19, CentOS 7 Management
2023
Modi ed date: October 3, Professional (PMP)
2022
Certi cation Books
Con gure NFS as
2023
Kubernetes Persistent Install Node.js 12 on
Modi ed date:
Volume Storage Ubuntu / Debian / Linux September 23, 2023
Modi ed date: August 21, Mint
2023
Modi ed date: August 19, Best Cybersecurity
2023
Books To Read in 2023
How To Deploy Multi-
Modi ed date: July 19,
Node OKD 4 Cluster How To Install PHP 7.4 2023
using Fedora CoreOS on Debian 10 / Debian 9
Modi ed date: November Modi ed date:
5, 2023 September 7, 2023

ABOUT US FOLLOW US

ComputingForGeeks is a technology blog


    
covering Linux/Windows/Unix server
con gurations, networking, Cloud,
Container solutions, Security systems,
Virtualization, Automation, DevOps,
Development guides and trending stu in
Technology.

Contact us: computingforgeeks@gmail.com

CentOS Ubuntu Fedora Debian Rocky FreeBSD Openstack Windows About Us Contact us Terms
A liates Disclosure

© 2014-2022 - ComputingforGeeks - Home for *NIX Enthusiasts

You might also like