Installing Docker CE on Windows Server 2019: A Step-by-Step Guide
In this article, we will provide a detailed guide on how to install Docker Community Edition (CE) on Windows Server 2019. Docker CE is a popular platform for developing, shipping, and running applications inside containers. With Docker CE, you can easily create, deploy, and manage applications on your Windows Server 2019 machine.
Before You Begin
Before you begin, you should ensure that your Windows Server 2019 machine meets the following requirements:
- 64-bit Windows 10 Pro, Enterprise, or Education (1607 Anniversary Update, build 14393 or later)
- Hyper-V and Containers features enabled
- 4 GB of RAM (8 GB recommended)
- 1 CPU (2 CPUs recommended)
- At least 20 GB of free disk space
Installing Docker CE
To install Docker CE on Windows Server 2019, follow these steps:
Step 1: Install the Docker Package Provider
The Docker package provider makes it easy to install and update Docker on your Windows Server 2019 machine.
> Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
> Register-PackageSource -Name DockerMain -Location <https://packages.docker.com/rhel/7/x86_64/stable> -ProviderName NuGet -Force
> Install-Package -Name docker -ProviderName NuGet -Scope CurrentUser
Step 2: Enable Virtual Machine Platform and WSL
Docker requires Virtual Machine Platform and WSL (Windows Subsystem for Linux) to be enabled on your Windows Server 2019 machine.
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
> wsl --install
Step 3: Start the Docker Service
After installing Docker and enabling Virtual Machine Platform and WSL, start the Docker service.
> Start-Service docker
Step 4: Verify Docker Installation
To verify that Docker CE is installed and running on your Windows Server 2019 machine, run the following command:
> docker --version
You should see output similar to the following:
Docker version 20.10.17, build 100c701
Using Docker CE on Windows Server 2019
Now that you have Docker CE installed on your Windows Server 2019 machine, you can start creating and deploying containers.
Step 1: Pull an Image
The first step in using Docker CE is to pull an image from a registry.
> docker pull nginx
Step 2: Run a Container
After pulling an image, you can run a container from that image.
> docker run -d -p 80:80 nginx
Step 3: View Running Containers
To view a list of running containers, use the following command:
> docker ps
Step 4: Stop a Running Container
To stop a running container, use the following command:
> docker stop <container\_id>
In this article, we provided a detailed guide on how to install Docker CE on Windows Server 2019. We covered the following topics:
- Requirements for installing Docker CE on Windows Server 2019
- How to install the Docker Package Provider
- How to enable Virtual Machine Platform and WSL
- How to start the Docker service
- How to verify Docker installation
- How to use Docker CE on Windows Server 2019