skip to Main Content

Is it possible to install docker CE on windows server 2019?

Hi everyone, I’m trying to install docker on windows server 2019 to run some containers required at my work. I followed the instructions at https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/set-up-environment?tabs=dockerce#windows-server-1 using the Docker CE / Mobby option

Once docker was installed, I tried to download and run a test container with the following command: docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022
However, I get the following error:

error during connect: this error may indicate that the docker daemon
is not running: Post
"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.47/images/create?fromImage=mcr.microsoft.com%2Fwindows%2Fnanoserver&tag=ltsc2022":
open //./pipe/docker_engine: The system cannot find the file
specified.

I tried restarting docker with restart-service *docker*. But I get the following error:

restart-service : Failed to start service ‘Docker Engine (docker)’.

I don’t know what else to do or how to fix the problem, I tried uninstalling docker but I couldn’t find an uninstall command

I hope someone can help me please. Thanks for reading

3

Answers


  1. first check if docker is running In powershell run

    Get-Service docker
    

    if its stopped start it

    Start-Service docker
    

    if docker still dont start make sure the containers feature is installed

    Install-WindowsFeature -Name containers
    

    Then restart the server.

    also try pulling a different nanoserver version like ltsc2019 instead

    docker pull mcr.microsoft.com/windows/nanoserver:ltsc2019
    

    if none of this works you might need to uninstall and reinstall docker

    Uninstall-Package -Name docker -ProviderName DockerMsftProvider
    Install-Package -Name docker -ProviderName DockerMsftProvider
    

    good luck:)

    Login or Signup to reply.
  2. Please find the below link and follow the given steps.

    How to install Docker on Windows Server and Containerize an IIS web Server in Docker? Part:1

    About Docker :

    Docker is one of the light weight and isolated environment, we can easily managed the containerized application. The biggest focus of docker is we can run a multiple application on docker containers in single platform.

    Developers can deploy various services and applications within separate containers on a single host without concerns regarding conflicting libraries or dependencies.

    Advantage of Docker:

    1. Portability

    2. Isolation

    3. Resource Efficiency

    4. Scalability

    5. Faster development and deployment

    Note: Use the power-shell to install Docker in Windows server OS, Docker desktop only support for Windows client OS.

    Docker installation on Windows server:

    Step 1: Open the Server manager on your Windows server and install the Container feature and Hyper-V. (once completed the installation Restart the computer)

    Step 2: Next, open the Power-shell run as administrator.

    Step 3: Run the below command on Power-Shell to download the docker script.

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

    Step 4: Then run the script using the following below command to install Docker.

    .install-docker-ce.ps1

    Step 5: Docker installation requires a restart, so your Windows Server will automatically reboot in a few moments.

    Step 6: Now Docker will be installed in your server after restarting.

    Step 7: To confirm that Docker Engine is installed, run the docker version command.

    Step 8: Run the below command to verify that the installed Docker engine is working fine.

    docker run hello-world

    Now get a response from Docker!!

    Login or Signup to reply.
  3. Uninstall Docker on Windows Server

    Uninstall-Package and Uninstall-Module cmdlets to remove the Docker module use the below command :

    Uninstall-Package -Name docker -ProviderName DockerMsftProvider
    Uninstall-Module -Name DockerMsftProvider

    Next Clean up Docker data and system components use the below command:

    Get-HNSNetwork | Remove-HNSNetwork

    *Then remove Docker’s default networks on Windows Server use the below command:

    Get-ContainerNetwork | Remove-ContainerNetwork

    Finally, remove Docker’s program data from your system use the below command:

    Remove-Item "C:ProgramDataDocker" -Recurse

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search