How to install WSL2 and Ubuntu on Windows

Mukul Srinivas
1 min read · August 3, 2023

Pre-requisites:
- Windows 10 or Windows 11 version 1903 or later
- Administrator privileges
STEPS:
- Open PowerShell or Command Prompt as administrator.
- Run the following command to enable WSL2:
wsl --install
- Restart your computer.
- Run the following command to install Ubuntu:
wsl –install -d Ubuntu
- Open the Microsoft Store and search for “Ubuntu.”
- Click on the “Ubuntu” app and click on “Install.”
- Once the installation is complete, open the “Ubuntu” app.
- You will be prompted to create a user account.
- Enter a username and password, and then click on “Create.”
- You will now be logged into your Ubuntu environment.
- To verify that WSL2 and Ubuntu are installed correctly, run the following command:
wsl --list --verbose
- You should see the following output:
NAME STATE VERSION
Ubuntu Running 2
- To start using Ubuntu, run the following command:
wsl Ubuntu
- You will now be in a command prompt in your Ubuntu environment.
- You can start using Ubuntu by running any Linux command.
Congratulations! You have now successfully installed WSL2 and Ubuntu on Windows.
Additional Tips:
- You can also install other Linux distributions on Windows using WSL2.
- To learn more about WSL2, visit the Microsoft documentation:
https://learn.microsoft.com/en-us/windows/wsl/ - To learn more about Ubuntu, visit the Ubuntu website: https://ubuntu.com/
M