Copied!
Laravel

Best Guide to Install Docker on Windows (WSL2 Setup Made Easy)

install-docker-on-windows
Shahroz Javed
Oct 15, 2025 . 31 views

Table Of Contents

 

Introduction

If you’re a Windows user who wants to use Docker like a pro, then this step-by-step guide will help you set up Docker with WSL2 easily. This modern setup ensures faster builds, full Linux compatibility, and zero hassle for Laravel, Node.js, or PHP developers.

💡 Related: Check our guide on How to Install Laravel on WSL2.

What is WSL2 and Why It’s Needed for Docker?

WSL2 (Windows Subsystem for Linux 2) lets you run a full Linux kernel inside Windows. Docker Desktop uses WSL2 to create Linux-based containers natively on Windows without needing a virtual machine or dual-boot setup.

⚠️ Note: Docker Desktop now requires WSL2 for Linux-based containers. Without WSL2, performance will drop significantly.

Install WSL2 on Windows

Follow these steps to install and enable WSL2 properly on your Windows system.

Step 1: Enable Required Features

Search for “Turn Windows features on or off” and enable:

Step 2: Set WSL2 as Default Version

Run PowerShell as Administrator and execute:
wsl --set-default-version 2

Step 3: Update WSL2 Kernel

Download and install the WSL2 kernel update from Microsoft:

http://aka.ms/wsl2kernel

Then, run the downloaded file: wsl_update_x64.msi

Step 4: Install a Linux Distribution

Choose your preferred Linux distro (e.g., Ubuntu, Debian, etc.) and install it via PowerShell:

wsl --list --online
wsl --install -d Ubuntu
wsl --list --verbose
wsl

Install Docker Desktop

Once WSL2 is ready, it’s time to install Docker Desktop. Visit the official Docker site and download the installer for Windows.

Step 1: Installation Options

Step 2: Complete Installation

After installation, open Docker Desktop and head to:

Settings > Resources > WSL Integration

Now check these options:

Verify Docker Setup

To confirm Docker is running correctly in your WSL2 environment, open your Linux terminal (Ubuntu or your chosen distro) and run:

docker version
docker run hello-world

If you see the “Hello from Docker!” message, congratulations — your Docker setup on Windows is complete!

Docker Hello World
Docker successfully running on Windows with WSL2

Troubleshooting Tips

Conclusion

You’ve successfully set up Docker on Windows using WSL2 — unlocking full Linux container power inside Windows. This setup is perfect for developers working with Laravel, Node.js, or any Docker-based projects.

17 Shares

Similar Posts