Technical Anshu
Tutorials Blog
🐳 Setup Order

Install WSL 2 Before Docker Desktop to Avoid the Common Setup Errors

Nearly every 'Docker Desktop failed to install' story has the same plot: Docker went in first, WSL was half-configured, and three tools ended up blaming each other. Install the foundation first and the whole setup becomes boring - which is what you want.

✍️ Technical Anshu🪟 Windows 10 / 11⏱️ 7 minute read
🎥 Watch the full install in the video - WSL 2 setup and the first container, step by step

This page is the order, and only the order, with the reason for each step. Virtualisation, then WSL 2, then one finished distro, then Docker Desktop. Each layer is tested before the next one goes on, so if something fails you know exactly which layer owns the problem. If you are on an older Windows build where wsl --install does not exist, the manual route is here too.

The install order that works - tick them off in sequence
✅ 1. Virtualisation Enabled in BIOS - checked in Task Manager
✅ 2. wsl --install run as Administrator, PC restarted
✅ 3. Ubuntu first run finished - Linux user created
✅ 4. wsl -l -v shows VERSION 2 for the distro
✅ 5. Only now - Docker Desktop installed
❌ Docker first, WSL later - the order that generates error emails
Five green ticks in this order and Docker Desktop normally starts first try
1

Step 1 to 3 - Virtualisation, WSL, Distro First Run

  1. In Task Manager, Performance tab, confirm Virtualization: Enabled. If disabled, enter BIOS or UEFI setup and switch on Intel VT-x or AMD SVM, then recheck
  2. Open PowerShell as Administrator and run wsl --install. This enables the required Windows features, downloads the WSL 2 kernel and installs Ubuntu
  3. Restart when it finishes. Then launch Ubuntu once and complete its first-run setup - choose a Linux username and password and wait until you see the Linux prompt

Why finish the distro? A half-created distro is the most common hidden cause of Docker Desktop hanging at its first start.

2

Step 4 - Confirm Everything Is Version 2

  1. Run wsl -l -v and read the VERSION column - it must say 2
  2. If a distro shows 1, run wsl --set-version Ubuntu 2 (use your distro's exact name from the list)
  3. Run wsl --set-default-version 2 so future distros install as version 2 automatically
  4. Run wsl --update once so the kernel is current before Docker ever looks at it
3

The Manual Route for Older Windows Builds

On older Windows 10 builds the one-command install may not exist. The manual equivalent, in order:

  1. dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  2. dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  3. Restart, then install Microsoft's WSL 2 kernel update package (wsl_update_x64.msi) from Microsoft's WSL documentation
  4. Run wsl --set-default-version 2, then install a distro from the Microsoft Store and finish its first run

Skip the kernel package and you get the famous error telling you the WSL 2 installation is incomplete - because it literally is.

4

Step 5 - Docker Desktop, Last

Now install Docker Desktop from docker.com, keeping Use WSL 2 instead of Hyper-V ticked. Sign out and back in when it asks - Docker adds you to the docker-users group, and Windows only applies group membership at sign-in.

Then open Docker Desktop settings, go to Resources, then WSL Integration, and switch on your distro. That is what makes the docker command work inside Ubuntu as well as in PowerShell.

🔴 The order is the fix. If Docker is already installed on a broken WSL base, do not keep reinstalling Docker. Fix WSL underneath it - distro finished, version 2, kernel updated - and Docker usually starts working with no reinstall at all.

🎥 Watch the Complete Process in the Video

The video follows this exact order on screen - watch it once and your own install will feel routine.

▶️ Watch Full Video
❓ Frequently Asked Questions

What happens if I installed Docker Desktop before WSL?

Docker Desktop will usually complain that WSL 2 is not installed or not configured, or sit at the starting screen. Leave Docker installed, set up WSL 2 properly (distro finished, version 2, kernel updated), restart, and try again - reinstalling Docker is rarely necessary.

wsl --install says it is not recognised. What now?

Your Windows build is older or WSL was never enabled. Use the manual route on this page: enable the two Windows features with DISM, restart, install the WSL 2 kernel update package from Microsoft, set the default version to 2, then install a distro from the Store.

Why does Docker Desktop ask me to sign out after installing?

Installing adds your account to the docker-users group, which controls who may talk to the Docker engine. Windows applies group membership when you sign in, so the sign-out is how the permission actually arrives.

This guide is based on the Technical Anshu Docker on WSL 2 video • Stuck on any step? Ask in the video comments — you will get a reply there 🙏