How to Install Ubuntu on WSL in Windows (Step-by-Step Guide)

Learn how to install and run Ubuntu on Windows using Windows Subsystem for Linux (WSL).

Prerequisites

  • Windows 10 (version 2004+) or Windows 11
  • WSL enabled on your system

Step-by-Step Installation

  1. Open the Start Menu and search for Microsoft Store.
  2. In the Store, search for Ubuntu.
  3. Select your preferred version (e.g., Ubuntu 20.04 or 22.04).
  4. Click on Get and wait for the download and installation to complete.
  5. Once installed, open Ubuntu from the Start Menu.
  6. Complete the initial setup by creating a username and password.

Useful WSL Commands

  • List all installed WSL distributions:
    wsl --list --verbose
  • Set default Ubuntu version:
    wsl -s Ubuntu-20.04
  • Launch a specific distribution:
    wsl -d Ubuntu-20.04

Additional Tips

  • Use wsl --install for a one-command installation (Windows 11 recommended).
  • Keep your Ubuntu updated using: sudo apt update && sudo apt upgrade
  • You can install multiple Ubuntu versions and switch between them easily.