www.virtualizationhowto.com Open in urlscan Pro
188.114.97.3  Public Scan

Submitted URL: http://virtualizationhowto.com/2022/09/install-docker-on-windows-server-2022/
Effective URL: https://www.virtualizationhowto.com/2022/09/install-docker-on-windows-server-2022/
Submission: On August 22 via manual from US — Scanned from NL

Form analysis 4 forms found in the DOM

GET https://www.virtualizationhowto.com/

<form method="get" id="search" action="https://www.virtualizationhowto.com/">
  <input id="search-input" inputmode="search" type="text" name="s" title="Search for" placeholder="Search for">
  <button id="search-submit" type="submit">
    <span class="tie-icon-search tie-search-icon" aria-hidden="true"></span>
    <span class="screen-reader-text">Search for</span>
  </button>
</form>

POST #

<form action="#" method="post" accept-charset="utf-8" id="subscribe-blog-1" data-blog="84840788" data-post_access_level="everybody">
  <div id="subscribe-text">
    <p>Enter your email address to subscribe to this blog and receive notifications of new posts by email.</p>
  </div>
  <p id="subscribe-email">
    <label id="jetpack-subscribe-label" class="screen-reader-text" for="subscribe-field-1"> Email Address </label>
    <input type="email" name="email" required="required" value="" id="subscribe-field-1" placeholder="Email Address">
  </p>
  <p id="subscribe-submit">
    <input type="hidden" name="action" value="subscribe">
    <input type="hidden" name="source" value="https://www.virtualizationhowto.com/2022/09/install-docker-on-windows-server-2022/">
    <input type="hidden" name="sub-type" value="widget">
    <input type="hidden" name="redirect_fragment" value="subscribe-blog-1">
    <input type="hidden" id="_wpnonce" name="_wpnonce" value="4f6e4e8bfb"><input type="hidden" name="_wp_http_referer" value="/2022/09/install-docker-on-windows-server-2022/"> <button type="submit" class="wp-block-button__link"
      style="margin: 0px; margin-left: 0px;" name="jetpack_subscriptions_widget"> Subscribe </button>
  </p>
</form>

<form id="commentform" class="comment-form">
  <iframe title="Comment Form"
    data-src="https://jetpack.wordpress.com/jetpack-comment/?blogid=84840788&amp;postid=287115&amp;comment_registration=0&amp;require_name_email=1&amp;stc_enabled=0&amp;stb_enabled=1&amp;show_avatars=1&amp;avatar_default=mystery&amp;greeting=Leave+a+Reply&amp;jetpack_comments_nonce=1edccb809a&amp;greeting_reply=Leave+a+Reply+to+%25s&amp;color_scheme=light&amp;lang=en_US&amp;jetpack_version=13.7&amp;show_cookie_consent=10&amp;has_cookie_consent=0&amp;is_current_user_subscribed=0&amp;token_key=%3Bnormal%3B&amp;sig=c6e52a3fcdc69443315ebc43c736ca6a6fbe647d#parent=https%3A%2F%2Fwww.virtualizationhowto.com%2F2022%2F09%2Finstall-docker-on-windows-server-2022%2F"
    name="jetpack_remote_comment" style="width:100%; height: 430px; border:0;" class="jetpack_remote_comment lazyload" id="jetpack_remote_comment" sandbox="allow-same-origin allow-top-navigation allow-scripts allow-forms allow-popups"
    src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-load-mode="1" scrolling="no">
  </iframe>
  <!--[if !IE]><!-->
  <script>
    document.addEventListener('DOMContentLoaded', function() {
      var commentForms = document.getElementsByClassName('jetpack_remote_comment');
      for (var i = 0; i < commentForms.length; i++) {
        commentForms[i].allowTransparency = false;
        commentForms[i].scrolling = 'no';
      }
    });
  </script>
  <!--<![endif]-->
</form>

GET https://www.virtualizationhowto.com/

<form method="get" class="tie-popup-search-form" action="https://www.virtualizationhowto.com/">
  <input class="tie-popup-search-input " inputmode="search" type="text" name="s" title="Search for" autocomplete="off" placeholder="Search for">
  <button class="tie-popup-search-submit" type="submit">
    <span class="tie-icon-search tie-search-icon" aria-hidden="true"></span>
    <span class="screen-reader-text">Search for</span>
  </button>
</form>

Text Content

 * RSS
 * Facebook
 * X
 * LinkedIn
 * YouTube
 * GitHub
 * Discord
 * Search for

 * Services
 * Contact
 * About
   * Advertising
   * Disclaimer
   * Privacy
   * Vembu
 * Resources
   * E-books
 * Forum
 * Community

 * Menu


 * Search for

 * DevOps
 * Virtualization
 * Proxmox
 * VMware
 * Proxmox
 * Hyper-V
 * Kubernetes
 * Mini PC & Server
 * Home Lab
   * My home lab
   * Nested ESXi Lab Build Networking and Hardware
   * Self hosted
   * Supermicro VMware Home Lab
   * VMware NSX Home Lab Setup
 * Youtube

Home/Windows Server 2022/Install Docker on Windows Server 2022
Windows Server 2022


INSTALL DOCKER ON WINDOWS SERVER 2022

Install Docker on Windows Server 2022. A step-by-step guide to install Docker,
pull images and run your Windows containers
Brandon LeeSeptember 1, 2022Last Updated: March 13, 2024
7 minutes read
Install the module needed to install Docker from the Nuget Provider

Most organizations are looking at running containers in their organization.
However, much of what you read about containers revolves around Linux
containers. However, what if you want to run containers on Windows Server?
Windows Server Containers are a great way to run Windows applications with an
extremely small footprint. However, since Windows containers require a Windows
container host, we need to use a Windows Server container host to install Docker
so we can run Docker containers using Windows Docker images. Windows Server 2022
is the latest Windows Server operating system from Microsoft that enables
running Docker containers. Let’s look at how to install Docker on Windows Server
2022 and see the steps involved.




TABLE OF CONTENTS

 * What is Docker Engine and Docker Desktop?
 * What are container images?
 * Why run Docker containers on Windows Server?
 * Windows Server 2022 containers new features
   * Server 2022 Core image size reduction
   * Longer support cycle for Windows Server 2022 container images
   * Virtualized time zone
   * Application compatibility
   * IPv6 support
   * Improved Kubernetes experience
 * Solving docker container image kernel limitations
   * Windows Server 2022 supports WSL installed
 * Windows Server 2022 – Process isolation mode and Hyper-V isolation
 * Install Docker on Windows Server 2022
   * Install the Windows Server 2022 containers feature
   * Install Hyper-V Role in Windows Server 2022
 * Install DockerMsftProvider and install Docker
   * Pull Windows Container image for Docker
   * Run the Windows Docker Image
 * Wrapping Up

Check out the video of the process if you would rather see it in video form:




WHAT IS DOCKER ENGINE AND DOCKER DESKTOP?

Both the Docker engine and Docker desktop are widely used in the enterprise to
run business-critical container image applications. Docker provides the
container runtime that allows the container image applications to run on top of
the physical host machine.

The process to install Docker Desktop is performed using the Docker Desktop
installer and makes getting up and running with Docker containers very easy
using the Docker Desktop application.

You can also interact with Docker using the command prompt or a PowerShell
session to run Docker command parameters from the command prompt. Both the
Docker Desktop and Docker command prompt environments require a Docker
installation on your Windows Server host.





WHAT ARE CONTAINER IMAGES?

A container image is an image of all the requirements it takes to run an
application. A container image are much lighter weight than full virtual
machine. Virtual machines are full operating system installations


WHY RUN DOCKER CONTAINERS ON WINDOWS SERVER?

You may wonder why you would want to run Docker containers on Windows Server
containers. One reason is that to run Windows Containers, you need to run
Windows containers on Windows Server. This requirement is because containers
share the kernel of the container host. So you can’t run Linux Containers on
Windows Server and Windows containers on Linux.


WINDOWS SERVER 2022 CONTAINERS NEW FEATURES

Windows Server 2022 offers new container features that provide a great way to
run Docker containers with the latest features and enhancements when compared to
older Windows Server versions, such as Windows Server 2016. What are some of the
new Windows Server 2022 container features?


SERVER 2022 CORE IMAGE SIZE REDUCTION

The container image size is extremely important. The smaller the container
image, the faster, more agile, and easier it is to run the containers. In
Windows Server 2022, the Server Core container image RTM layer at GA is 2.76 GB
uncompressed. This is a major improvement over Windows Server 2019 which was
3.47 GB uncompressed container size. It represents a 33% smaller footprint.


LONGER SUPPORT CYCLE FOR WINDOWS SERVER 2022 CONTAINER IMAGES

Five years of support and an additional five years of extended support is now
offered for all Windows server 2022 containers.


VIRTUALIZED TIME ZONE

Windows Server 2022 containers support virtualized time zone configuration
separate from the host. This virtualized time zone support is included in the
instance for each container.




APPLICATION COMPATIBILITY

You can use Group Managed Service Accounts with Windows containers to use Active
Directory authentication.


IPV6 SUPPORT

IPv6 is now supported with Kubernetes in Windows.


IMPROVED KUBERNETES EXPERIENCE

Microsoft is continuing to improve the Kubernetes implementation with Windows
containers. Windows Server 2022 provides more restrictive subnets and multiple
subnets for each Windows worker node.


SOLVING DOCKER CONTAINER IMAGE KERNEL LIMITATIONS

You can solve some of these limitations by running a container host as a virtual
machine. Regardless of whether the physical host is running Windows Server or
Linux, you can run a hypervisor such as Hyper-V or Linux with Proxmox, XCP-NG,
KVM, etc to run virtual machines of either variety.

You can also use nested virtualization if you want to have the capabilities of a
Windows hypervisor or Linux hypervisor, regardless of what operating system your
physical host is running. However, you must have enabled nested virtualization
to benefit from this capability.


WINDOWS SERVER 2022 SUPPORTS WSL INSTALLED

Now, with Windows Server 2022, you can have WSL installed in a supported way
without any hacks to get it to work. This provides another way to work with
Linux containers using your Windows Server 2022 host.


WINDOWS SERVER 2022 – PROCESS ISOLATION MODE AND HYPER-V ISOLATION

Running containers with Process Isolation mode is the traditional way that
containers run. Even though they share the host operating system kernel, each
container is isolated through namespace, resource control, and other process
isolation technologies.

One of the cool benefits of running Docker container images on Windows Server
2022 with Hyper-V isolation is the added security benefits from the Hyper-V
role. The Hyper-V isolation mode offers enhanced security.



In isolation mode, each container runs inside of a highly optimized virtual
machine that effectively gets its own kernel. This isolation enables
hardware-level isolation between each container and container host.


INSTALL DOCKER ON WINDOWS SERVER 2022

The process to install Docker on Windows Server 2022 will include the following
steps:

 1. Install the Windows Server 2022 containers feature
 2. Install Hyper-V in Windows Server 2022
 3. Install DockerMsftProvider and Docker
 4. Pull Windows container image for Docker
 5. Run the Windows Docker image


INSTALL THE WINDOWS SERVER 2022 CONTAINERS FEATURE

Using the features wizards found in Server Manager, we can install the
containers feature in Windows Server 2022 to run containers natively in Windows.
The process is fairly straightforward. Run the Add roles and Features Wizard
from Windows Server 2022.

Beginning the Add Roles and Features wizard




On the Features screen, place a check next to the Containers feature.

Installing the containers feature




Confirm the installation.

Confirm the containers installation


The containers installation is successful. You will be prompted to reboot your
Windows Server 2022 host.

Successful installation of the containers feature in Windows Server 2022





INSTALL HYPER-V ROLE IN WINDOWS SERVER 2022

Next, for using Hyper-V isolation, we will need to have the Hyper-V role
installed. Let’s quickly look at the Hyper-V role installation. On the Server
Roles screen in Server Manager, place a check next to the Hyper-V role. Note you
can also use the new Windows Admin Center to install roles in your Windows
Server 2022 machine.

Place a check next to the Hyper V role


It will bring up the Add features that are required for Hyper-V.

Add the Hyper V remote administration tools


Now we have the check placed next to Hyper-V, click Next.

Role and remote administration tools selected


Next, there will be a few screens of Hyper-V specific configuration.

Beginning the wizard to configure the Hyper V Role

You can go ahead and create the default Hyper-V virtual switch.


Create the default Hyper V Virtual Switch

Decide if you want to allow live migration.

Allow Virtual Machine migration


Configure the default storage location for Hyper-V virtual machines. Here, I am
accepting the default settings.

Default virtual machine storage configuration


Confirm the installation of the Hyper-V role and role features.

Confirm the Hyper V role installation


You will be prompted to reboot after the role is successfully installed.

Reboot the server after installing the Hyper V role



INSTALL DOCKERMSFTPROVIDER AND INSTALL DOCKER

***Note*** DockerMsftProvider is now deprecated. However, leaving the below for
posterity

Use the command found in the documentation here instead:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1

Deprecated steps below:

Next, we will install the Docker provider and install Docker itself. We can use
just a couple of commands from the Powershell session to install the module and
package needed. We need to be in an administrator prompt. The order of
operations is we need to first install the Provider and then we can install
Docker from the provider.



Install-Module -Name DockerMsftProvider -Repository PSGallery -Force

This command will prompt you to install the Nuget provider in order to install
the module.

Install the module needed to install Docker from the Nuget Provider


To install Docker, we can use the following command:

Install-Package -Name docker -ProviderName DockerMsftProvider

You will see the message that the package is not marked as trusted. You will
need to allow the installation.

Installing Docker from the Nuget provider


Next, we need to restart Windows Server 2022. You can do that from the
PowerShell session using the Restart-computer cmdlet.


PULL WINDOWS CONTAINER IMAGE FOR DOCKER

After the Server 2022 host reboots, we can pull the Windows container image in a
PowerShell session or Windows Command Prompt:

docker pull mcr.microsoft.com/windows/servercore:ltsc2022

Pull the latest Windows Server 2022 LTSC image



RUN THE WINDOWS DOCKER IMAGE

Finally, let’s run the Windows Docker image in Windows Server 2022. This is a
simple Docker run command. You can first list out your images using the docker
images ls command and then run the container interactively with the following:

List the Windows container images using docker images ls and running it
interactively

Running commands inside the container


WRAPPING UP

The process of installing Docker in Windows Server 2022 is straightforward. We
just need to install a role and feature and then pull the module and package
from the command line. After that, we can successfully pull the latest Docker
image for Server Core and then run our container. From this point forward, it is
straightforward to run your Docker containers in Windows.




LIKE THIS:

Like Loading...
Brandon LeeSeptember 1, 2022Last Updated: March 13, 2024
7 minutes read



SUBSCRIBE TO VIRTUALIZATIONHOWTO VIA EMAIL 🔔

Enter your email address to subscribe to this blog and receive notifications of
new posts by email.

Email Address

Subscribe


BRANDON LEE

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com
and has over two decades of experience in Information Technology. Having worked
for numerous Fortune 500 companies as well as in various industries, He has
extensive experience in various IT segments and is a strong advocate for open
source technologies. Brandon holds many industry certifications, loves the
outdoors and spending time with family. Also, he goes through the effort of
testing and troubleshooting issues, so you don't have to.
 * Website




RELATED ARTICLES


IN-PLACE UPGRADE WINDOWS SERVER 2008 R2 TO WINDOWS SERVER 2022

June 14, 2021


INSTALL WINGET IN WINDOWS SERVER 2022 – NO APPLICABLE APP LICENSES ERROR

November 18, 2021


AUTOMATED WINDOWS SERVER 2022 PACKER BUILD

June 3, 2021


WINDOWS SERVER 2022 IS THE NEXT WINDOWS SERVER OPERATING SYSTEM

January 22, 2021


8 COMMENTS

 1. IWanttobeHere says:
    October 19, 2022 at 2:48 am
    
    Thanks for the information. Awesome.
    
    Loading...
    
    Reply
 2. Martin says:
    May 22, 2023 at 8:51 am
    
    Thank’s for the very good guide.
    When i Pull Windows Container image for Docker, then i get always the error:
    
    “docker : Error response from daemon: Get “https://mcr.microsoft.com/v2/”:
    context deadline exceeded
    In Zeile:1 Zeichen:1
    + docker pull mcr.microsoft.com/windows/servercore:ltsc2022″
    
    Have anyone a idea ?
    My Proxy_Settings are correct.
    
    Thanks for Help.
    
    Loading...
    
    Reply
    1. Warchoon says:
       July 17, 2023 at 7:41 am
       
       this address no longer exists. See my comment for instructions.
       
       Loading...
       
       Reply
       1. brandon.lee says:
          July 24, 2023 at 11:30 am
          
          Warchoon,
          
          Thank you for the update!
          
          Brandon
          
          Loading...
          
          Reply
 3. Warchoon says:
    July 17, 2023 at 7:37 am
    
    DockerMsftProvider is deprecated.
    This is a new Docker installation guide
    https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce#windows-server-1
    
    Loading...
    
    Reply
 4. SRam says:
    December 1, 2023 at 2:52 pm
    
    Hi,
    I don’t get your last statement “From this point forward, it is
    straightforward to run your Docker containers in Windows.”. How do you mean
    it? One runs containers in this Windows container? how?
    
    Loading...
    
    Reply
 5. Marek says:
    June 30, 2024 at 6:14 am
    
    It you can install Rancher Desktop which supports Windows Server 2022 and is
    free to use.
    
    Rancher Desktops’s installer does all the steps mentioned in the article
    automatically.
    
    And has the same features as Docker, even used the same commands.
    
    Loading...
    
    Reply
    1. Brandon Lee says:
       June 30, 2024 at 9:09 pm
       
       Marek,
       
       Great shout out for Rancher Desktop. I think it is also a great solution
       and makes things easier as well.
       
       Brandon
       
       Loading...
       
       Reply


LEAVE A REPLYCANCEL REPLY



This site uses Akismet to reduce spam. Learn how your comment data is processed.


© Copyright 2024, All Rights Reserved  | 
Close
 * DevOps
 * Virtualization
 * Containers
 * Kubernetes
 * Proxmox
 * Hyper-V
 * VMware
 * Services
   * About
   * Advertising
   * Contact
   * Disclaimer
   * Resources
   * E-books
 * Youtube




Close
Search for
%d
Virtualization Howto
Toestemming voor gegevens en cookies
Om een persoonlijkere gebruikerservaring te bieden, gebruiken wij en onze
217 partner partners
technologie zoals cookies om apparaatinformatie op te slaan en/of te openen.
Door op "Accepteren" te klikken, stemt u in met het gebruik van deze
technologieën waarmee wij en
onze partners
persoonlijke gegevens zoals IP-adres, unieke ID en browsegegevens op deze site
kunnen verwerken.
Om uw toestemmingsvoorkeuren te beheren, klikt u op de knop "Instellingen
beheren". U kunt uw toestemmingsvoorkeuren op elk moment intrekken of bijwerken
door op de link ‘Privacy-instellingen bijwerken’ onderaan de website te klikken.
Wij gebruiken uw gegevens voor het volgende: Informatie op een apparaat opslaan
en/of openen; Beperkte gegevens gebruiken om advertenties te selecteren;
Profielen maken voor gepersonaliseerde advertenties; Profielen gebruiken om
gepersonaliseerde advertenties te selecteren; Profielen maken om inhoud te
personaliseren; Profielen gebruiken om gepersonaliseerde inhoud te selecteren;
Advertentieprestaties meten; Inhoudsprestaties meten; Inzicht krijgen in
doelgroepen door middel van statistieken of combinaties van gegevens uit
verschillende bronnen; Diensten ontwikkelen en verbeteren; Beperkte gegevens
gebruiken om inhoud te selecteren; Zorgen voor beveiliging, fraude voorkomen en
detecteren en fouten verhelpen; Advertenties en inhoud leveren en presenteren;
Privacykeuzes opslaan en communiceren.
Instellingen beheren
Accepteren

Update de privacy-instellingen