Installing Docker For Windows

  1. Installing Docker For Windows 10 Pro
  2. Install Docker For Windows On D Drive
  3. Installing Docker For Windows 10
  4. Install Docker For Windows Home
  5. Installing Docker For Windows Server 2016
  6. Install Docker For Windows Server 2019

In this post, I describe how to install WSL 2 to serve as the backend for Docker Desktop for Windows. Previously I've always worked with Linux in a Virtual Machine using something like VMWare or Virtual Box, but I decided to give Docker Desktop a try, and was pleasantly surprised by the experience!

I'll start by describing how to install WSL 2 based on the install documents, then show how to install Docker Desktop. Finally, I show the the experience of running a container and how it looks in Docker Desktop.

Installing WSL2

The Windows Subsystem for Linux (WSL) is a way to run a full Linux environment on your Windows machine, without having to install a 'heavier' virtual machine, such as Virtual Box, VM Ware, or Hyper-V. WSL 2 also provides a mechanism for running Docker (with Linux containers) on your Windows machine. We'll install it as a prerequisite for Docker Desktop for Windows.

If you're running Windows Home, WSL 2 is the only way to run Docker Desktop. On Windows Pro, you can also use Hyper-V, but that is deprecated now, so WSL 2 is the way to go in all cases.

Download and Install Docker Manually. If you want to install Docker the manual way, head on over to the Docker Desktop downloads page and then click on ‘Download for Windows (Stable)’ button to download the installer file. Then, go to your downloads folder and double click on ‘Docker Desktop Installer’ setup file to initiate the. First, download docker for windows using this link. Double click the installer that you just downloaded to run the docker installer. When given the option, make sure “ enable Hyper-V Windows Features ” option is selected on the Configuration page. Just follow the installer to finish installing docker. 1 – Install Docker on Windows 7/8/10 Home. A – Download the Docker Toolbox executable. B – Run the Docker Toolbox installer for Windows. C – Run the Docker Quickstart for Windows. 2 – Install Docker on Windows 10 Pro and Enterprise. A – Check your virtualization settings. B – Create an account on Docker Hub.

1. Install WSL 1

We'll start by installing WSL 1 by enabling the WSL feature.

Open PowerShell as Administrator (I hit the Start key, type powershell and hit ctrl+shift+enter to open an elevated command prompt). Run the following, to enable WSL 1

You should see the following:

That enables WSL, but we're going to enable the newer WSL 2 version, which Docker Desktop can use to run the VM it needs to run containers.

2. Enable the Virtual Machine feature

How to install docker on Windows. We can install docker on any operating system like Windows, Linux, or Mac.Here, we are going to install docker-engine on Windows.The main advantage of using Docker on Windows is that it provides an ability to run natively on Windows without any kind of virtualization. Install Docker Windows Server 2016 Install pre-release builds. If you’re interested in trying out a pre-release build, you can download releasecandidates from the Compose repository release page on GitHub.Follow the instructions from the link, which involves running the curl commandin your terminal to download the binaries.

WSL 2 uses a lightweight VM, so you need to enable the Virtual Machine feature available in Windows 10 version 1903 and higher. In the same, elevated command prompt, run:

You should see something like the following:

3. Restart

Time to restart your machine to ensure everything is registered correctly.

4. Install the WSL 2 update

Download the WSL2 Linux kernel update package for x64 machines and install it.

Note, if you see the following error when running the update, make sure you've restarted your machine afer installing the WSL 1 and VM features:

The installer runs very quickly, and hopefully you'll see a confirmation screen, something like the following:

5. Set WSL 2 as your default version

This is an easy step, just run wsl --set-default-version 2 in any PowerShell window:

6. (Optional) Install a Linux distribution

We actually don't need to install a Linux distribution to use Docker Desktop, but if you want to shell into Linux directly, you'll need to install one. You can install a distribution directly from the Microsoft Store.

The first time you launch the distribution, the distribution will extract and install, and you'll need to set a username and password.

7. (Optional) Add to Windows Terminal

If you're using Windows Terminal (you should be!) you can configure it to open your WSL distribution. The easiest way to do this is to open up the settings.json file and reset it. You can do this by deleting the contents of the file—Terminal will automatically repopulate it with the defaults, which will include a tab for WSL.

Obviously you won't want to lose your setting customisations, so make sure to backup the contents of the file first!

You're looking for WSL in the profiles list—add that to you profile list, and you'll be able to quickly open up your WSL instance from Windows Terminal!

That's the prerequisite starter for Docker Desktop covered, so now lets get to the main course!

Installing Docker Desktop for Windows

1. Download and Install

Head to the Docker Desktop website and download the Installer for Windows.. This is a hefty ~500MB, but once it's finished, run the installer.

On the first screen, ensure you keep 'Install required components for WSL 2' checked:

After clicking OK, the installer will unpack a whole load of files:

Before finally prompting you to log out of your Windows account to complete the installation:

2. Logout and back in

The Docker Desktop installer will automatically log you out of your Windows account on completion. When you sign back in, you'll get a notification that Docker is starting the Linux Containers WSL 2 backend. Eventually, the main Docker Desktop window will pop up, and offer you a tutorial

3. Give it a try!

With Docker Desktop installed, you now have the docker command available in your command prompt:

Now it's installed, let's take it for a spin!

Trying out Docker Desktop for Windows

For simplicity, we'll run one of the .NET 5.0 sample apps available on DockerHub:

This is a simple Razor Pages app, packaged in a Docker image, and ready to run. You can see the Dockerfile for the app here. When you run the above command Docker will pull the image, run it and start listening:

If you navigate to http://localhost:8000/, you'll see the app running there—a Linux container, running on Windows 🤯

The interesting thing, which I didn't realise until I installed it, is that Docker Desktop for Windows installs a very nice UI for managing your containers!

If you click on the my-sample container row, you'll see the logs for the container:

You can also inspect the environment variables, view stats about the container, or click CLI to open a shell inside (exec into) the container! You can do all these things from the command line obviously, and if you're automating things, that's definitely the right option. For casual or local development, personally I find you can't beat a nice GUI!

Summary

In this post I described how to Install WSL, upgrade it to WSL 2, and how to install Docker Desktop. This requires a restart of Windows and a logout which is a bit annoying, but otherwise it went very smoothly. The Docker Desktop UI also looks very handy, in particular the ability to exec into a container—I'm always getting the CLI command wrong, so that will be very unseful!

In this blog, I will show you how to install Docker version 19 in Windows 10. We will be using community edition (CE) as this is a free version. You can use this edition to install it on your personal computer to learn and build application around it. Knowledge of Docker is a must if you want to build Cloud Native Microservices based applications.

With Docker EE, your Windows nodes can join swarms that are managed by Docker Universal Control Plane (UCP). When you have Docker EE installed on Windows Server 2016 and you have a UCP manager node provisioned, you can join your Windows worker nodes to a swarm. Install Docker EE. Docker EE for Windows requires Windows Server 2016. Congratulations, Docker Installation on Windows is now done, and now, you are ready to build and run Docker images and containers on the Docker ecosystem. Uninstall Docker Desktop Tool Suppose you want to uninstall Docker Desktop from your Windows Home machine, follow the steps mentioned below. Install Compose on Windows Server. Follow these instructions if you are running the Docker daemon and client directly on Microsoft Windows Server and want to install Docker Compose. Start an “elevated” PowerShell (run it as administrator). Search for PowerShell, right-click, and choose Run as administrator.

Install Docker Windows 10

There are other platforms for building container based application. But over the years, Docker has become the industry standard for building container based application using Kubernetes for orchestration. As such, Docker skill is must for IT professionals.

Lets get started

Prerequisites: Docker requires Hyper-V enabled in Windows 10. Without this Docker will not run after you install Docker. To enable Hyper-V in Windows, please follow my post here

Please note that Docker needs Hyper-V only in Windows 10. It will not work with VMware Workstation or Virtual Box. You can refer to the docker documentation

Docker consumes a lot of RAM. I can feel the performance issue after I run Docker on my 8 GB RAM Laptop. You can still work, it wont create major problems. I think, on a 16 GB RAM machine, you should not feel the performance issue.

8 GB machines works for me, so its OK.

Step 1 – Download Docker

Officially Docker installer, community edition can be downloaded from Docker Store. You will have to create an account to be able to download it. Having an account for Docker is a very good things. It allows you to download docker images in the future.

If you dont want to create an account, this is the direct link to Download Docker Installer.

You can also reach the Docker Store download page from the Docker official page. Go to the Docker Official home Page.

Click on Products-> Docker Desktop on the menu bar. This will take you to the docker desktop product page.

Docker Desktop Product Webpage

Click on Download Desktop for Mac and Windows.

The installer file for windows is around 914 MB.

Step 2 – Run the installer

Double click on the downloaded installer file to start the installation wizard. You will see Windows UAC – User Access Control asking for permission to allow the program to run. Click yes to continue.

Docker Installation – Windows User Access Control

Now you will see Docker installer downloading additional files required. If you dont have internet connection, installer will move on to the next step. Wait for the process to complete and you will see the configuration screen.

Step 3 – Configuration Settings

In this dialog box you will be asked if you want to create desktop icon for Docker. I leave this checked. Second option is if you want to use Linux or Windows Container. This option can be changed later on. I leave it as default, that is unchecked.

Containers run on your host operating system which can be Linux or Windows. Ideally you can run Linux container on Linux OS and Windows container on Windows OS. This could be a problem in development machines if you want to develop Linux container based application on Windows.
To get around this, Docker allow users to create both Linux and windows container on the same windows machine without having to switch between OS platforms. To achieve this, Docker provides a Linux VM for Hyper-V called MobyLinuxVM as a part of installation process. This VM runs Linux container and your Windows 10 host runs Windows Containers. You cannot run both Windows and Linux Containers at the same time. That is why Docker allows you to switch between Windows and Linux container.
With this you can run both Linux and Windows Containers side by side as a part of the same Docker Installation for Windows.

Click OK to start the installation. Wait for the installation to complete.

Docker Installation progress

Once the installation completes, click on Close and restart to complete the installation.

Step 4 – Run Docker

Once the system restarts, run Docker by double clicking the icon created on the desktop or from start menu. You will see a docker icon appear on your windows task bar. If you hover your mouse over it, it will say “Docker is Starting”. You will see a warning asking your permission to start the docker service. Click Start to continue and wait for docker service to start.

Installing Docker For Windows 10 Pro

Docker Service not running warning

Once docker service starts for the first time, you will see a welcome screen asking you to login to Docker Hub. Enter the docker hub credentials you have created and click on sign in. This is optional but it is highly recommended that you do it.

Windows

Docker Desktop welcome screen

Step 5 – Disable Start Docker at Startup

By default, docker will automatically start when you turn on/login to your computer. Since Docker requires a lot of RAM, I don’t recommend this. We can start docker manually when we want to use it.

Install Docker For Windows On D Drive

To disable starting docker at startup, right click on the docker Icon in the task bar. Click on Settings, under General Tab, uncheck, Start Docker when you login.

Click on apply and restart to make the changes. This will restart the docker service again (I will not restart Windows, only the docker service).

Step 6 – Check the version of Docker Installed

Most of the time you will be working with command line to work with Docker. Let this be your first command to check Docker version and see what you get.
Open Powershell or command prompt and enter the command:
docker version
You should see something like this.

Docker Version Check – Windows Command Line

That’s it for now.

Whats Next
You can start your Docker Journey by learning about the command you can execute in your computer terminal.

Good luck.

Installing Docker For Windows 10

Estimated reading time: 7 minutes

You can run Compose on macOS, Windows, and 64-bit Linux.

Prerequisites

Docker Compose relies on Docker Engine for any meaningful work, so make sure youhave Docker Engine installed either locally or remote, depending on your setup.

  • On desktop systems like Docker Desktop for Mac and Windows, Docker Compose isincluded as part of those desktop installs.

  • On Linux systems, first install theDocker Enginefor your OS as described on the Get Docker page, then come back here forinstructions on installing Compose onLinux systems.

  • To run Compose as a non-root user, see Manage Docker as a non-root user.

Install Compose

Follow the instructions below to install Compose on Mac, Windows, Windows Server2016, or Linux systems, or find out about alternatives like using the pipPython package manager or installing Compose as a container.

Install a different version

The instructions below outline installation of the current stable release(v1.28.6) of Compose. To install a different version ofCompose, replace the given release number with the one that you want. Composereleases are also listed and available for direct download on theCompose repository release page on GitHub.To install a pre-release of Compose, refer to the install pre-release buildssection.

Install Compose on macOS

Windows

Docker Desktop for Mac includes Compose alongwith other Docker apps, so Mac users do not need to install Compose separately.For installation instructions, see Install Docker Desktop on Mac.

Install Compose on Windows desktop systems

Docker Desktop for Windows includes Composealong with other Docker apps, so most Windows users do not need toinstall Compose separately. For install instructions, see Install Docker Desktop on Windows.

If you are running the Docker daemon and client directly on MicrosoftWindows Server, follow the instructions in the Windows Server tab.

Install Compose on Windows Server

Follow these instructions if you are running the Docker daemon and client directlyon Microsoft Windows Server and want to install Docker Compose.

  1. Start an “elevated” PowerShell (run it as administrator).Search for PowerShell, right-click, and chooseRun as administrator. When asked if you want to allow this appto make changes to your device, click Yes.

  2. In PowerShell, since GitHub now requires TLS1.2, run the following:

    Then run the following command to download the current stable release ofCompose (v1.28.6):

Note: On Windows Server 2019, you can add the Compose executable to $Env:ProgramFilesDocker. Because this directory is registered in the system PATH, you can run the docker-compose --version command on the subsequent step with no additional configuration.

  1. Test the installation.

Install Compose on Linux systems

Install Docker Windows Server

On Linux, you can download the Docker Compose binary from theCompose repository release page on GitHub.Follow the instructions from the link, which involve running the curl commandin your terminal to download the binaries. These step-by-step instructions arealso included below.

For alpine, the following dependency packages are needed:py-pip, python3-dev, libffi-dev, openssl-dev, gcc, libc-dev, rust, cargo and make.

  1. Run this command to download the current stable release of Docker Compose:

    To install a different version of Compose, substitute 1.28.6with the version of Compose you want to use.

    If you have problems installing with curl, seeAlternative Install Options tab above.

  2. Apply executable permissions to the binary:

Note: If the command docker-compose fails after installation, check your path.You can also create a symbolic link to /usr/bin or any other directory in your path.

For example:

  1. Optionally, install command completion for thebash and zsh shell.

  2. Test the installation.

Alternative install options

Install using pip

For alpine, the following dependency packages are needed:py-pip, python3-dev, libffi-dev, openssl-dev, gcc, libc-dev, rust, cargo, and make.

Compose can be installed frompypi using pip. If you installusing pip, we recommend that you use avirtualenv because many operatingsystems have python system packages that conflict with docker-composedependencies. See the virtualenvtutorial to getstarted.

If you are not using virtualenv,

Install Docker For Windows Home

pip version 6.0 or greater is required.

Install as a container

Compose can also be run inside a container, from a small bash script wrapper. Toinstall compose as a container run this command:

Install Docker Windows Server 2016

Installing Docker For Windows Server 2016

Install pre-release builds

Install Docker For Windows Server 2019

If you’re interested in trying out a pre-release build, you can download releasecandidates from the Compose repository release page on GitHub.Follow the instructions from the link, which involves running the curl commandin your terminal to download the binaries.

Pre-releases built from the “master” branch are also available for download athttps://dl.bintray.com/docker-compose/master/.

Pre-release builds allow you to try out new features before they are released,but may be less stable.

Upgrading

If you’re upgrading from Compose 1.2 or earlier, remove ormigrate your existing containers after upgrading Compose. This is because, as ofversion 1.3, Compose uses Docker labels to keep track of containers, and yourcontainers need to be recreated to add the labels.

If Compose detects containers that were created without labels, it refusesto run, so that you don’t end up with two sets of them. If you want to keep usingyour existing containers (for example, because they have data volumes you wantto preserve), you can use Compose 1.5.x to migrate them with the followingcommand:

Alternatively, if you’re not worried about keeping them, you can remove them.Compose just creates new ones.

How To Install Docker Windows 10 Home

Uninstallation

To uninstall Docker Compose if you installed using curl:

To uninstall Docker Compose if you installed using pip:

Got a “Permission denied” error?

If you get a “Permission denied” error using either of the abovemethods, you probably do not have the proper permissions to removedocker-compose. To force the removal, prepend sudo to either of the abovecommands and run again.

Where to go next

compose, orchestration, install, installation, docker, documentation