Ubuntu on Windows Subsystem for Linux (WSL) allows Windows 10/11 users to run Ubuntu, a popular Linux distribution, within the Windows environment. This gives users access to a Linux terminal and the ability to install and run Linux software without needing a separate machine or virtual machine.
To start with Ubuntu on WSL, users must first enable and install WSL on their Windows 10/11 computer. They can then install Ubuntu via the Microsoft Store or run the WSL install script in PowerShell. After installing Ubuntu, users can access it via the Windows Command Prompt or the Windows PowerShell by typing "ubuntu".
Once inside Ubuntu, users can install Linux software using Ubuntu's package manager, APT, or by downloading and compiling software from source code. They can also access their Windows files and folders from within Ubuntu using the /mnt/ directory.
Here are step-by-step instructions on how to install Docker Desktop on Windows 10 or 11, provided that your computer supports the Windows Subsystem for Linux (WSL):
Register for a DockerHub account by visiting https://hub.docker.com/signup.
Download and install all pending Windows OS updates.
Reboot your computer
Set a username and password in Ubuntu. After the reboot, Windows will auto-launch your new Ubuntu OS and prompt you to set a username and password.
If for some reason Windows did not prompt you to create a distribution or you simply would like to create a new one, you can do so by running the command
wsl --install -d Ubuntu.
Navigate to the Docker Desktop installation page and click the "Docker Desktop for Windows" button at https://docs.docker.com/desktop/install/windows-install/.
Double-click the Docker Desktop Installer from your Downloads folder
Double-click the Docker Desktop icon on your Desktop
Accept the Docker Service Agreement
Ensure that WSL Integration is enabled by clicking the Settings Gear icon in Docker Desktop, choosing Resources, and finally WSL Integration. Make sure that the "Enable Integration with my default WSL distro" is checked. Also, if you are using multiple distributions, make sure that these additional distros are toggled on.
Log in to Docker by using the terminal for your distro and running the docker login command. You will be prompted to enter the username and password (or your Personal Access Token) you created earlier when registering for a DockerHub account. Once you see "Login Succeeded," the setup is complete and you are free to continue.
As we've seen, installing Docker Desktop on Windows 10/11 with Ubuntu using WSL involves a number of steps, including registering for a DockerHub account, installing all pending Windows OS updates, running the WSL install script, setting a username and password in Ubuntu, manually installing a distribution if needed, installing Docker Desktop, enabling WSL integration in Docker Desktop, opening the Ubuntu distribution, checking that Docker is working, and logging in to Docker. Following these steps carefully should ensure a successful installation of Docker Desktop on Windows 10/11 with Ubuntu using WSL.