Docker Desktop installation (Windows)
Table of Contents
install Docker Desktop for Windows with WSL2 backend.
Prerequisites
- WSL version 1.1.3.0 or later (previously installed)
1. Docker Desktop installation
Download and install Docker Desktop for Windows from here
2. Install interactively
Install the Docker Desktop WSL 2 backend using the interactive installation:
-
Double-click Docker Desktop Installer.exe to run the installer.
-
Ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected.
-
If your system only supports one of the two options, you will not be able to select which backend to use.
-
Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
-
When the installation is successful, select Close to complete the installation process.
2.1 Additional steps for non-admin users
If your admin account is different to your user account, you must add the user to the docker-users group:
- Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users.
- Right-click to add the user to the group.
- Sign out and sign back in for the changes to take effect.
3. Configure Docker Desktop
- Start Docker Desktop from the Windows Start menu.
- Select Settings to configure Docker Desktop (the gear).
- Ensure that “Use the WSL 2 based engine” is checked in Settings > General, if not, check it and click Apply & Restart.
Select from your installed WSL 2 distributions which you want to enable Docker integration on (Ubuntu-22.04 or Ubuntu) by going to: Settings > Resources > WSL Integration.
Now docker commands work from Windows using the new WSL 2 engine.
To test it, open a Ubuntu terminal and run:
docker --version
And run a test container:
docker run hello-world
4. GPU support (optional)
GPU support is only available in Docker Desktop for Windows with the WSL2 backend.
With Docker Desktop version 3.1.0 and later, WSL 2 GPU Paravirtualization (GPU-PV) on NVIDIA GPUs is supported. To enable WSL 2 GPU Paravirtualization, you need:
- A machine with an NVIDIA GPU
- Beta drivers from NVIDIA supporting WSL 2 GPU Paravirtualization
- Update WSL 2 Linux kernel to the latest version using wsl –update from an elevated command prompt
- Make sure the WSL 2 backend is turned on in Docker Desktop
To validate that everything works as expected, run the following command to run a short benchmark on your GPU:
docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark
The following displays after downloading the image and running the container:
5. Next steps
Install VS Code and the Dev-Containers extensions to use Docker with VS Code, follow the instructions