Introduction
Ubuntu is one of the most popular Linux distributions used by developers. It is commonly used for software development, servers, cloud computing, DevOps, Docker, and many other technologies.
If you are using Windows, you don't necessarily need to remove Windows or create a dual-boot setup to use Ubuntu.
Windows provides a feature called WSL (Windows Subsystem for Linux) that allows you to run Ubuntu directly inside Windows.
In this blog, we will understand what WSL is, why developers use Ubuntu on Windows, and how to install Ubuntu 24.04 LTS using WSL 2 step by step.
1. What is Ubuntu?
Ubuntu is a Linux distribution based on Debian.
It provides a Linux operating system environment that developers can use for writing and running applications.
Ubuntu is widely used for:
- Software development
- Python and Django development
- FastAPI development
- Web servers
- Cloud computing
- DevOps
- Docker
- Linux administration
For example, if you are learning Python, you can install Python and run your applications directly inside Ubuntu.
2. Can We Install Ubuntu on Windows?
Yes.
Traditionally, if someone wanted to use Linux and Windows on the same computer, they might use dual boot, where both operating systems are installed separately.
But Windows provides a simpler option called:
Windows Subsystem for Linux (WSL)
With WSL, you can run a Linux distribution such as Ubuntu directly from Windows.
You don't need to:
- Remove Windows
- Create a separate partition
- Set up traditional dual boot
The basic setup looks like:
3. What is WSL?
WSL stands for Windows Subsystem for Linux.
It allows you to run a Linux environment inside Windows.
You can open Ubuntu from Windows and use Linux commands such as:
You can also install development tools and run applications inside Ubuntu.
For example:
or:
This makes WSL very useful for developers who use Windows but want access to a Linux development environment.
4. What is WSL 2?
There are different versions of WSL, but WSL 2 is the modern version and is commonly recommended for development.
WSL 2 provides a more complete Linux environment and is also commonly used by tools such as Docker Desktop.
Our setup looks like:
For our Docker installation, we also used this same WSL 2 setup.
5. Check Whether WSL is Already Installed
Before installing Ubuntu, we should check whether WSL is available.
Open PowerShell and run:
If WSL isn't installed, Windows will tell you that it needs to be installed.
You can install it using:
After installation, Windows may ask you to restart the computer.
6. Check Available Linux Distributions
Once WSL is installed, we can see which Linux distributions are available.
Run:
You may see options such as:
For this guide, we will use:
Ubuntu 24.04 LTS
7. Install Ubuntu 24.04 LTS
To install Ubuntu 24.04, run:
Windows will download and install Ubuntu.
You may see messages similar to:
Ubuntu will then start for the first time.
8. Create Your Ubuntu Username and Password
During the first launch, Ubuntu will ask you to create a Linux user.
You may see:
Enter the username you want to use.
For example:
Then Ubuntu will ask for a password:
Important
When entering your password in the Linux terminal, nothing will appear on the screen.
You won't see:
or any characters.
This is normal. Type the password and press Enter.
After confirmation, your Ubuntu user account will be created.
9. Open Ubuntu
Once Ubuntu is installed, you can launch it using:
You can also open Ubuntu from the Windows Start menu.
When Ubuntu starts, you will see a terminal similar to:
This means you are now inside the Ubuntu environment.
10. Verify Ubuntu Installation
We can check the installed WSL distributions from PowerShell using:
Our system showed:
The important part is:
This confirms that Ubuntu is running using WSL 2.
11. Check the Ubuntu Version
Inside Ubuntu, you can check the Ubuntu version using:
You should see information indicating that you are using:
This is useful when you want to confirm exactly which Ubuntu version is installed.
12. Basic Linux Commands
Now that Ubuntu is installed, you can start using basic Linux commands.
Check your current location
pwd shows the current directory.
List files
This displays files and folders in the current directory.
Create a folder
This creates a folder called myproject.
Move into a folder
Move back
Clear the terminal
These are some of the basic commands you'll frequently use while working in Ubuntu.
13. Access Windows Files from Ubuntu
One useful feature of WSL is that Ubuntu can access your Windows drives.
For example, your Windows C: drive is available inside Ubuntu through:
For example:
You can then access Windows folders.
Your Windows user folder might be available through:
This is why you may see a terminal location such as:
The /mnt/c directory represents your Windows C: drive.
14. Installing Software in Ubuntu
Ubuntu has a package manager called APT.
You can use it to install many software packages.
First, update the package information:
Then you can install packages.
For example, to install Git:
You can also install other development tools depending on your requirements.
For example:
The sudo command allows you to execute commands with administrator privileges.
Ubuntu may ask for your Linux password when using sudo.
15. WSL vs Virtual Machine vs Dual Boot
It's useful to understand the difference between these approaches.
| Method | How it works |
|---|---|
| Dual Boot | Windows and Linux are installed separately |
| Virtual Machine | Linux runs inside virtualization software |
| WSL 2 | Linux environment runs directly through Windows' WSL system |
For many Windows developers, WSL 2 is convenient because you can access Linux tools without leaving Windows.
For example:
You can work with both Windows and Linux tools on the same computer.
16. Ubuntu and Docker
WSL 2 is also important when working with Docker on Windows.
Our Docker setup looks like:
This is one reason we installed Ubuntu and WSL 2 before setting up Docker Desktop.
However, Ubuntu is not required just to use every Docker feature on Windows. Docker Desktop manages much of the underlying setup for you.
17. Common Problems
WSL is not installed
If you see:
run:
Then restart Windows if requested.
No Linux distributions are installed
If:
doesn't show Ubuntu, install it with:
Ubuntu isn't using WSL 2
Check:
If Ubuntu is showing version 1, you can convert it to WSL 2 using:
Then verify again:
Forgot your Ubuntu password
Your Ubuntu password is separate from your Windows password.
If you forget it, you can reset it using the WSL root account. This is a slightly more advanced recovery process, so it's better to keep your Linux password safely remembered.
18. Useful WSL Commands
Here are some useful commands you can remember.
Check WSL status
List installed distributions
List available distributions
Start Ubuntu
Shut down WSL
Stop a specific distribution
These commands are enough for basic WSL management.
19. Complete Installation Process
The complete Ubuntu installation process can be summarized as:
Conclusion
Ubuntu is a popular Linux distribution used extensively in software development and server environments.
Windows users can run Ubuntu without dual booting by using Windows Subsystem for Linux (WSL).
The basic setup is:
Once Ubuntu is installed, you can use Linux commands, install development tools, work with Python and other programming languages, and use tools such as Git and Docker.
For developers using Windows, WSL 2 + Ubuntu is a very useful environment to learn, especially if you are planning to work with backend development, Linux servers, cloud technologies, DevOps, or Docker.
And in our own setup, we successfully reached:
which confirms that Ubuntu 24.04 LTS is successfully installed and running on WSL 2.