Goglides Dev 🌱

Cover image for Complete Guide to Installing Ubuntu with WSL on Windows 10/11 and Docker Desktop
Sanjog Pandey
Sanjog Pandey

Posted on

Complete Guide to Installing Ubuntu with WSL on Windows 10/11 and Docker Desktop

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):

  1. Register for a DockerHub account by visiting https://hub.docker.com/signup.

  2. Download and install all pending Windows OS updates.

  3. Run the WSL install script by opening PowerShell as Administrator and running the command wsl --install. This will enable and install all required features as well as install Ubuntu.
    Image description

  4. Reboot your computer

  5. 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.
    Image description
    Official documentation:
    https://docs.microsoft.com/en-us/windows/wsl/install#install-wsl-command

  6. 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.

  7. Navigate to the Docker Desktop installation page and click the "Docker Desktop for Windows" button at https://docs.docker.com/desktop/install/windows-install/.
    Image description

  8. Double-click the Docker Desktop Installer from your Downloads folder

  9. Click "Yes" if warned.
    Image description

  10. Click "Close" when you see the "Installation succeeded" message.
    Image description

  11. Double-click the Docker Desktop icon on your Desktop

  12. Accept the Docker Service Agreement

  13. 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.
    Image description

  14. Open your distro by using the Windows Search feature in the toolbar, typing the name of your distribution (by default, it is Ubuntu), and clicking Open.
    Image description

  15. Check that Docker is working by using the terminal for your distro and running the dockercommand. If all is well, you should see some helpful instructions in the output.
    Image description

  16. 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.
    Image description

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.

Top comments (1)

Collapse
 
bart97coder profile image
Bart97coder

A really great guide. I've been using Windows 11 for some time now and I highly recommend it to anyone because Windows 11 offers much better options. And if someone is looking for a cheap license, I recommend this system: royalcdkeys.com/products/windows-1...