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 🙂