Hey fellow devs! π If you're looking to get started with Docker on Windows, you've come to the right place. I remember how confusing it was when I first tried to set everything up, so I've created this guide to help you avoid the headaches I encountered.
π Table of Contents
- Before We Begin
- Preparing Windows
- Checking Virtualization
- Quick WSL Version Check
- Installing Docker Desktop
- Setting Up Ubuntu with WSL
- Final Step: Connect Docker with WSL
- Testing Your Setup
- Troubleshooting Tips
- Conclusion
π οΈ Before We Begin
Let's ensure your Windows PC is ready for Docker. Here are a few things to check and enable.
System Requirements:
- Windows 10/11 Pro, Enterprise, or Education (64-bit)
- 4GB RAM minimum (8GB recommended)
- UEFI firmware with Secure Boot capability
- Virtualization support in your CPU
- Administrator access to your Windows machine
1. Preparing Windows
Search for Turn Windows features on or off
in the Start Menu, and enable the following:
- β Hyper-V
- β Windows Subsystem for Linux (WSL)
π Restart your computer after enabling these features.
2. Checking Virtualization
To verify virtualization is enabled:
- Open Task Manager β go to the Performance tab.
- Look at the bottom right for Virtualization.
If it says "Disabled":
- Restart and enter BIOS (usually
F2
orDel
). - Enable virtualization (
Intel VT-x
orAMD-V
). - Save and exit.
π Quick WSL Version Check
Open PowerShell and run:
wsl --status
If it shows Version 1, upgrade with:
wsl --set-default-version 2
π¦ Installing Docker Desktop
- Download Docker Desktop for Windows from the official site.
- Use AMD64 version (works for both Intel & AMD CPUs).
- Install with default settings and agree to the license.
β
Once installed, open PowerShell and run:
docker run hello-world
If you see Hello from Docker!
β you're all set!
π§ Setting Up Ubuntu with WSL
- Open Microsoft Store.
- Search Ubuntu.
- Install any LTS version (I recommend Ubuntu 22.04 LTS).
- Launch Ubuntu β Set a username and password.
To check WSL version:
wsl -l -v
β
Ensure it says VERSION 2
next to Ubuntu.
π Final Step: Connect Docker with WSL
- Open Docker Desktop.
- Go to:
Settings > Resources > WSL Integration
. - Enable integration with your Ubuntu version.
β Testing Your Setup (From Ubuntu)
In your Ubuntu terminal, run:
docker run hello-world
You should see the Docker success message.
π§― Troubleshooting Tips
- Restart your PC after enabling WSL and Hyper-V.
- Check BIOS virtualization settings.
- Upgrade to the latest WSL 2 version.
π You're Ready!
That's it! Docker is now running on your Windows system with WSL2 integration. If you run into any issues, feel free to comment below.
Happy containerizing π³
Top comments (0)