
Setup Docker environment on Windows
How to run Docker Desktop on Window systems with WSL 2
π Introduction
On Windows 10 and 11, you can access Docker via Docker Desktop and the Windows Subsystem for Linux (WSL). Docker Desktop is available on Windows, macOS, and Linux, and itβs known to accelerate productivity by simplifying the process of configuring complex application environments.
The Windows Subsystem for Linux lets Windows users run Linux distributions on Windows without having to dual-boot or configure a dedicated virtual machine. Windows users can directly access the Linux command-line tools, applications, utilities without additional installation overhead, developing cross-platform applications without worrying about dedicated hardware or leaving the Windows ecosystem.
π§ͺ Prequisites
- Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11
- Hardware Virtualization Technology (VT-x) enabled in BIOS
- Microsoft Hyper-V and Containers features enabled
π οΈ Steps
1. Enable WSL 2
- Open PowerShell as an administrator and run the following command to enable the Windows Subsystem for Linux feature:
- Restart your computer to apply the changes.
- See more at https://learn.microsoft.com/en-us/windows/wsl/install
2. Setup Docker Desktop
- Go to the Docker Desktop download page and click on the Download for Windows button.
- Run the installer and follow the installation instructions.
- Once the installation is complete, you will be prompted to log in to your Docker account. If you don't have an account, you can create one for free.
- Check system-wide context status:
- Launch Docker Desktop from the Start menu, and navigate to Settings > General.
- Ensure that the Use WSL 2 based engine option is selected.
- Select from your installed WSL 2 distributions which you want to enable Docker integration on by going to: Settings > Resources > WSL Integration.
- Enable the Enable integration with my default WSL distro option.
- Click on Apply & Restart.
3. Enable Docker Engine on Daemon
- Press
Win + R
to open the Run dialog box. - Type
services.msc
and press Enter. - Scroll down to find and right-click to the Docker Desktop Service, then choose Start option to start the service.
Here are a few helpful Docker commands to know:
- You can also check the status of the Docker service by running the following command in PowerShell or Command Prompt:
- If the service is running, you should see the status as Running.
- If the service is not running, you can start it by running:
- List information for a specific command with:
π Related posts
Want to update?
Subscribe to my blog to receive the latest updates from us.