Docker Installation Guide on Windows Using PowerShell

Docker Installation Guide on Windows Using PowerShell

Overview

This document provides a guide on how to install Docker on a Windows machine. Ensure that Hyper-V for containers is enabled in the "Windows add features" setting before starting the installation process.

Step 1: Check If Your Windows OS Supports Hyper-V

Step 2: Enable Hyper-V feature

To enable Hyper-V on Windows, use the following steps:

  1. Open 'Control Panel' on your computer.

  2. Click on 'Programs'.

  3. Under the 'Programs and Features' section, click on 'Turn Windows features on or off'.

  4. In the 'Windows Features' window, locate 'Hyper-V'.

  5. Expand it by clicking on the '+' icon or the arrow next to it.

  6. To enable all the features of Hyper-V, tick on all the checkboxes under 'Hyper-V'. If you specifically want to enable 'Hyper-V for containers', tick on 'Hyper-V Platform' and 'Hyper-V Services'.

  7. Click on 'OK'. Windows will apply the changes and may ask to restart your computer.

Step 4 : Uninstall Existing DockerMsftProvider If DockerMsftProvider exists, you need to uninstall it first. Open your PowerShell as an admin and run the following command: Uninstall-Module -Name DockerMsftProvider -Force This command will forcefully remove DockerMsftProvider if it exists in your machine.

Step 5: Install DockerProvider Module

Once you have uninstalled DockerMsftProvider, the next step is to install DockerProvider. DockerProvider will allow you to install Docker. Execute the following command in PowerShell: Install-Module -Name DockerProvider -Repository PSGallery -Force This command will forcefully install DockerProvider from the PowerShell Gallery.

Step 6: Download and Install Docker When the DockerProvider is installed, you can now download and install Docker. Run the following command in your PowerShell: Install-Package -Name Docker -ProviderName DockerProvider This command will install Docker using DockerProvider.

Step 7: Reboot Your Machine After installing Docker, you would need to reboot your machine to complete the installation. Run the following command in PowerShell to forcefully restart your machine:

Restart-Computer -Force