{"id":743,"date":"2026-09-12T23:23:01","date_gmt":"2026-09-12T23:23:01","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=743"},"modified":"2026-09-12T23:23:01","modified_gmt":"2026-09-12T23:23:01","slug":"docker-containers-windows-server-wsl2-hyperv-isolation","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/","title":{"rendered":"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Windows Server can run containers, but the rules are different from the Linux world most Docker documentation assumes. There are two completely separate runtimes with different kernels, two isolation modes with different compatibility guarantees, and a Windows Server host has no Docker Desktop \u2014 you install the engine directly. This guide covers what actually works on a Windows Server VPS, how WSL2 fits in, and when Hyper-V isolation is mandatory rather than optional.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Container workloads drive a specific hardware profile: you need nested virtualization enabled and enough RAM to hold both the images and the build cache. If you are provisioning for this, our <a href=\"https:\/\/windows-vps.org\/\">Windows VPS guide<\/a> covers what to look for, and <a href=\"https:\/\/windows-vps.org\/blog\/windows-vps-for-remote-development-teams-setup-guide\/\">our guide to Windows VPS for remote development teams<\/a> covers the build-agent side.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Two container worlds on one host<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th><\/th><th>Windows containers<\/th><th>Linux containers (via WSL2)<\/th><\/tr><\/thead><tbody><tr><td>Kernel<\/td><td>Shared Windows kernel (process isolation) or its own kernel in a utility VM (Hyper-V isolation)<\/td><td>Microsoft&#8217;s Linux kernel in a lightweight Hyper-V utility VM<\/td><\/tr><tr><td>Base images<\/td><td><code>mcr.microsoft.com\/windows\/servercore<\/code>, <code>nanoserver<\/code>, <code>dotnet\/framework\/aspnet<\/code><\/td><td>Any Linux image (<code>alpine<\/code>, <code>debian<\/code>, <code>ubuntu<\/code>)<\/td><\/tr><tr><td>Image size<\/td><td>Nano Server ~100\u2013300 MB, Server Core ~1.2\u20135 GB<\/td><td>Alpine ~5 MB, Debian ~120 MB<\/td><\/tr><tr><td>Docker Desktop<\/td><td>Not supported on Windows Server<\/td><td>Not supported on Windows Server<\/td><\/tr><tr><td>Run with<\/td><td>Docker Engine (native Windows service) or containerd<\/td><td><code>docker<\/code> inside a WSL2 distribution, integrated with Windows Docker Engine<\/td><\/tr><tr><td>Host requirement<\/td><td>Containers + Hyper-V features<\/td><td>WSL2 (Server 2022\/2025) + nested virtualization<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The key point: <strong>Docker Desktop is not licensed or supported on Windows Server.<\/strong> On Server you install the Docker Engine service natively, or run the Linux engine inside a WSL2 distribution. Anything that says &#8220;install Docker Desktop&#8221; in a Windows Server tutorial is either wrong or is silently installing an unsupported configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing the Windows container runtime<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. Enable the required features (Hyper-V is needed for Hyper-V isolation and WSL2)\nEnable-WindowsOptionalFeature -Online -FeatureName Containers -All -NoRestart\nEnable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart\nEnable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -All -NoRestart\n# Reboot\n\n# 2. Install the Docker Engine (moby) via the Microsoft-published package\nInstall-Module -Name DockerMsftProvider -Repository PSGallery -Force\nInstall-Package -Name docker -ProviderName DockerMsftProvider -Force\nStart-Service docker\n\n# 3. Verify\ndocker version\ndocker info --format '{{.OSType}} \/ {{.Isolation}} \/ {{.ServerVersion}}'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On a VPS, step 0 is verifying that the host allows nested virtualization. Hyper-V and Hyper-V isolation both need the <code>vmx<\/code>\/<code>svm<\/code> exposure flag. If <code>Get-ComputerInfo | Select HyperVRequirement*<\/code> reports a missing hypervisor or the <code>VirtualizationFirmwareEnabled<\/code> flag is false, your provider has not enabled nested virtualisation and Hyper-V isolation simply will not start. Process isolation still works in that case, which is why it is the fallback for constrained environments.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Process isolation vs Hyper-V isolation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This is the single most misunderstood part of Windows containers.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Process isolation<\/strong> \u2014 containers share the host&#8217;s Windows kernel. Fast to start (sub-second), low memory overhead, but the <em>host OS build must match or be newer than the image<\/em>. You cannot run a <code>ltsc2019<\/code> image on a Server 2022 host with process isolation. Mismatched versions fail with <code>0xc0000135<\/code> or a &#8220;no matching image for OS version&#8221; error.<\/li><li><strong>Hyper-V isolation<\/strong> \u2014 each container gets its own kernel in a minimal utility VM. Starts in a few seconds and costs a few hundred MB of extra RAM, but it lets an older image run on a newer host, and it gives a stronger security boundary for untrusted code.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Explicit isolation mode\ndocker run --isolation=process   -d --name web1 mcr.microsoft.com\/windows\/servercore:ltsc2022\ndocker run --isolation=hyperv    -d --name web2 mcr.microsoft.com\/windows\/servercore:ltsc2019\n\n# Check the host's default and supported isolation\ndocker info --format '{{json .Isolation}}'\n\n# Match image tag to your host build\n[System.Environment]::OSVersion.Version   # e.g. 10.0.20348 = Server 2022 -&gt; ltsc2022<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A practical rule: use process isolation on a modern single-version fleet for speed and memory efficiency, and use Hyper-V isolation when you need to run legacy base images, when tenants are mutually untrusted, or when a container is exposed to untrusted input.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Running Linux containers with WSL2<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WSL2 on Windows Server is available on Server 2022 and Server 2025 (Server 2019 only has WSL1, which is not suitable for Docker). Once installed, you can run the Linux engine inside the distribution and have it act as the Docker context for your Windows shell.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Install WSL2 with a distribution (Server 2022+ \/ 2025)\nwsl --install -d Ubuntu-22.04\nwsl --set-default-version 2\nwsl --update\n\n# Inside the distribution, install the Linux engine\nwsl -d Ubuntu-22.04 -- bash -lc \"curl -fsSL https:\/\/get.docker.com | sh &amp;&amp; sudo usermod -aG docker \\$USER\"\n\n# Expose it to Windows Docker clients via a context\ndocker context create wsl-linux --docker \"host=tcp:\/\/127.0.0.1:2375\"\ndocker context use wsl-linux\ndocker run --rm hello-world<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Two caveats dominate real deployments. First, WSL2 requires the same nested-virtualization support as Hyper-V isolation, so it will not start on many budget VPS plans. Second, the Linux engine inside WSL2 stores its images in the distribution&#8217;s virtual disk, which grows on demand and does not shrink automatically:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Reclaim space when the WSL2 virtual disk balloons\nwsl --shutdown\nOptimize-VHD -Path \"$env:LOCALAPPDATA\\Packages\\CanonicalGroupLimited*\\LocalState\\ext4.vhdx\" -Mode Full<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Windows container gotchas that cost hours<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Image size.<\/strong> A Server Core base image is over 1 GB, and a full .NET Framework app image can reach 5\u20138 GB. Plan disk accordingly and prune aggressively with <code>docker system prune -a<\/code>.<\/li><li><strong>No <code>-v<\/code> host volume semantics like Linux.<\/strong> Bind mounts work, but the container user&#8217;s permissions must match the host ACL, or you get access-denied inside the container.<\/li><li><strong>Layer cache is build-version sensitive.<\/strong> Building a <code>ltsc2022<\/code> image on a <code>ltsc2019<\/code> host fails at the FROM layer. Pin your base image tags and pin your host build.<\/li><li><strong>Networking.<\/strong> The default NAT network only exposes published ports. For container-to-container traffic on a VPS, use a user-defined network and reference containers by name, exactly as on Linux.<\/li><li><strong>Server Core as the build base.<\/strong> Use a multi-stage Dockerfile \u2014 a <code>nanoserver<\/code> runtime stage on top of a <code>servercore<\/code> build stage can cut the final image by an order of magnitude.<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code># Multi-stage: big build stage, small runtime stage\nFROM mcr.microsoft.com\/dotnet\/sdk:8.0-windowsservercore-ltsc2022 AS build\nWORKDIR \/src\nCOPY . .\nRUN dotnet publish -c Release -o \/app\n\nFROM mcr.microsoft.com\/dotnet\/aspnet:8.0-nanoserver-ltsc2022\nCOPY --from=build \/app \/app\nENTRYPOINT [\"dotnet\", \"C:\\\\app\\\\MyApp.dll\"]<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Choosing the right approach<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Scenario<\/th><th>Recommended approach<\/th><\/tr><\/thead><tbody><tr><td>.NET Framework \/ full-trust Windows app<\/td><td>Windows container, process isolation, Server Core base<\/td><\/tr><tr><td>Modern .NET 6\/8 Linux-targeted service<\/td><td>Linux container on WSL2 (or move to a Linux VPS)<\/td><\/tr><tr><td>Untrusted or third-party code<\/td><td>Windows container with Hyper-V isolation<\/td><\/tr><tr><td>Legacy base image on a new host<\/td><td>Hyper-V isolation<\/td><\/tr><tr><td>VPS without nested virtualisation<\/td><td>Windows containers, process isolation only<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If your stack is mixed, the pragmatic pattern on a Windows VPS is to run Windows containers natively for the .NET Framework services and keep Linux containers in WSL2 for the supporting tooling, rather than trying to force one runtime to do both. Before you commit, verify nested virtualisation support with your provider \u2014 that single detail decides whether Hyper-V isolation and WSL2 are available at all, and it is worth confirming in writing before you compare Windows VPS options on price alone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Related: <a href=\"https:\/\/windows-vps.org\/blog\/how-to-deploy-a-net-application-on-windows-vps-complete-tutorial\/\">How to deploy a .NET application on a Windows VPS<\/a> and <a href=\"https:\/\/windows-vps.org\/blog\/iis-application-pools-windows-vps-configuration\/\">IIS application pool configuration<\/a> for when containers are not the right answer.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Windows Server can run containers, but the rules are different from the Linux world most Docker documentation assumes. There are two completely separate runtimes with different kernels, two isolation modes with different compatibility guarantees, and a Windows Server host has no Docker Desktop \u2014 you install the engine directly. This guide covers what actually works &#8230; <a title=\"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/\" aria-label=\"Read more about Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-743","post","type-post","status-publish","format-standard","hentry","category-tutorials-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers - Windows VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers\" \/>\n<meta property=\"og:description\" content=\"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-12T23:23:01+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/\",\"name\":\"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-09-12T23:23:01+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers - Windows VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/","og_locale":"en_US","og_type":"article","og_title":"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers","og_description":"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers","og_url":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-09-12T23:23:01+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"windows-vps","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/","url":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/","name":"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-09-12T23:23:01+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/docker-containers-windows-server-wsl2-hyperv-isolation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"Running Docker Containers on Windows Server: WSL2, Hyper-V Isolation, and Linux Containers"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=743"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/743\/revisions"}],"predecessor-version":[{"id":746,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/743\/revisions\/746"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}