How to Install Docker CE on a Windows Server VM

Have you run into a roadblock when you tried to install the Community Edition (CE) of Docker on a Windows Server VM? This quick step-by-step guide resolved that problem for you!

Docker Desktop is available for installation on Windows 10 or Windows 11. However, you cannot install the Docker Desktop on a Windows Server. This is the problem that this article solves.

The article is divided into two sections. Section one walks you through deploying Docker CE on a Windows Server VM.

After that, we will cover the steps to configure Docker to be run by non-admins in section two.

  1. Create a folder called “Docker” on drive C:\ (or any other drive on the server).
  2. Then, search “powershell”, right-click “Windows PowerShell” and select “Run as Administrator.
How to Install Docker CE on a Windows Server VM
  1. When the PowerShell console opens, run these three commands.

Your VM will restart during the installation!

cd C:\Docker

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

The first command changes the directory to the “Docker” folder you created in step 1. Meanwhile, the second command downloads the Microsoft script that installs Docker CE on a Windows Server VM while the third command runs the script.

  1. When the VM restarts, the Docker installation will continue. After installation, it displays the information shown in the second screenshot below.
How to deploy Docker CE on a Windows Server VM
  1. You can run docker commands on the same PowerShell console, like “docker images.” However, in some instances, if non-administrators run docker commands, they may receive the “Open \.\pipe\docker_engine: Access Denied” error.

    In the next section, I will discuss the steps that fix this error.

Open \.\pipe\docker_engine: Access Denied

Installing Docker with the above steps does not install some Docker components such as buildx and docker-compose. The final section of this article documents the steps to Install Docker Compose standalone (not part of the CE edition installed above) on a Windows Server VM.

How to Fix the “Open \.\pipe\docker_engine: Access Denied” Docker Error

As explained in this article – Using the #Docker Named Pipe as a Non-Admin for #WindowsContainers – Docker on Windows requires running CMD or PowerShell as administrator to run Docker commands.

Apparently, this is a known issue and it has to do with how Docker for Windows configures permission in the named pipe, “\.\pipe\docker_engine.”

Follow the steps below to fix the “Open .\pipe\docker_engine: Access Denied” Docker error on Windows.

  1. Open the daemon.json file located in the path, C:\ProgramData\docker\config.

You need to open this file as administrator. One easy way to do this is using Notepad++. If you do not have Notepad++, copy the file to another location, and update it with the steps outlined below. Then, replace the file in C:\ProgramData\docker\config.

Before updating the daemon.json, make a copy!

  1. Replace the content of daemon.json with the following code and save the file:

If you copied daemon.json to a different location, remember to replace the copy in C:\ProgramData\docker\config with your updated copy.


    "hosts": [
        "tcp://127.0.0.1:2376",
        "npipe://"
    ]
  1. Once you’ve updated the daemon.json file, restart the “Docker Engine” service by running the command.
Get-Service "Docker Engine" | Restart-Service
  1. The final step is to create an environment variable called DOCKER_HOST. This variable defines the location of the docker engine as configured in the daemon.json file.

    To create a DOCKER_HOST environment variable:
    a) Search env and select “Edit the system environment variables.”

How to Fix the "Open \.\pipe\docker_engine: Access Denied" Docker Error

b) Then, on the “Advanced” tab of System Properties, click “Environment Variables”

c) Finally, follow the numbering in the screenshots below to create the

c) Finally, follow the numbering in the screenshots below to create the DOCKER_HOST environment variable.

How to Install Docker CE on a Windows Server VM - create the DOCKER_HOST environment variable.

Install Docker Compose Standalone on a Windows Server VM

Earlier, I hinted that installing the Docker CE on a Windows Server VM does not include some Docker components like “docker-compose.”

We’ll fix that problem by installing Docker Compose Standalone with the steps below:

  1. Open PowerShell as administrator by searching “powershell” right-clicking “Windows PowerShell” and selecting “Run as administrator.”
How to Install Docker CE on a Windows Server VM - Install Docker Compose Standalone  on a Windows Server VM
  1. Once PowerShell opens, enable TLS1.2 – a GitHub requirement.
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  1. After that, create the Docker folder in Program Files with this PowerShell command:
New-Item -Name Docker -Path $Env:ProgramFiles -ItemType Directory
  1. Then, run this command to download the latest version of Docker Compose.
 Start-BitsTransfer -Source "https://github.com/docker/compose/releases/download/v2.24.5/docker-compose-windows-x86_64.exe" -Destination $Env:ProgramFiles\Docker\docker-compose.exe
  1. Finally, to make the docker-compose.exe command available, add it to the PATH environment variable. Use steps 4 a) and b) in the previous section to open Environment Variables.

Then, on the “Systems variable” section, highlight the “Path” environment variables and click Edit.

Add $Env:ProgramFiles\Docker\docker-compose.exe to the PATH env variable

Finally, follow the numbering in the screenshot below to add “%ProgramFiles%\Docker\” to the PATH environment variable.

Now you can run the docker-compose.exe command!

    Frequently Asked Questions

    1. Is it Possible to Install Docker on Windows Server

    Yes, you can install Docker on a Windows Server by downloading and running the Microsoft PowerShell script built for this purpose, install-docker-ce.ps1.

    2. How to Install Docker Compose on Windows Server?

    To install Docker-Compose on a Windows Server, follow the steps in this Official Document, Install Compose standalone.

    3. What is Docker CE?

    Docker CE stands for Docker Community Edition. It is the free Docker version – maintained by the Docker community – that you can deploy to Windows Server.

    4. How Do I know if Docker CE is Installed?

    To check if the Docker Community Edition is available on a Windows server, open a CMD or PowerShell and run “docker –version”. If Docker is available on the server, the command should display the Docker version.

    5. Is Docker CE the Same as Docker Desktop?

    No, there is a difference between Docker CE (Community Edition) and Docker Desktop. Firstly, Docker Desktop can only be installed on Windows 10 or Windows 11 while Docker CE runs on Windows Server.

    Also, Docker CE does not install some Docker components like Docker Compose while the Desktop Edition does.

    Trying to navigate the world of Docker on Windows can be challenging. With this article, we hope that we’ve reduced that problem by 1!

    If we did and you like to share your thoughts or even ask additional questions, use the Comment form towards the end of this page.

    Thank you for reading!

    Other Useful Resources

    1. Overview of Docker Desktop
    2. Install server and client binaries on Windows
    3. Using the #Docker Named Pipe as a Non-Admin for #WindowsContainers
    4. Install Compose standalone

Next Post

Best Phone 2024: The 10 Best Smartphones You Can Buy

2024 is upon us, and new phones are already being announced left, right and centre. The smartphone market moves fast, and there’s seems to be almost no break between launches these days. So how can you possibly decide which is the best choice for you? Your first decision will be […]
Best Phone 2024: The 10 Best Smartphones You Can Buy

You May Like