Step 1. Make sure you have installed Docker desktop and WSL 2
Step 2. Open up PowerShell and run the command below to list WSL available:
wsl --list --verbose
You should get something like the following screenshot:
Step 3. Run the following command to set Ubuntu-20.04 version 2 as default:
wsl --set-default Ubuntu-20.04 2
If you list the WSLs available again you should see the following:
Step 4. Open up Docker Desktop, go to Settings->Resources->WSL Integration. You should then check the Ubuntu 20.04 checkbox.
That’s it! Once you click on “Apply & Restart” you should be able to run docker commands in your Ubuntu 20.04 shells!
Hope that this has helped 🙂
One reply on “How To Fix docker could not be found With Ubuntu 20.04 WSL 2 On Windows 10”
[…] available and is the one that has worked for me for most projects. It requires you to install WSL 2, a Linux Distribution image and to Docker integrations. Once this is done, you can open a Linux shell of your choice in Windows 10 and run docker compose […]