Setting up WSL for the first time? This blog post is for you.

I am a EEE undergraduate junior from VIT Chennai. I dabble in everything from web development all the way to embedded systems, and I plan to document my learnings here.
Windows is a great operating system, but when it comes to DX (developer experience) nothing can really beat Linux. Thankfully, Windows provides us with a way for us to use a Linux terminal within the OS without having to do anything fancy like dual-booting. Many aspiring devs have asked me for a tutorial for my exact WSL setup, so in this blog post, I'll be explaining how to setup WSL (Windows Subsystem for Linux) on your Windows PC and optimize it for web development.
Prerequisites.
You will require a bit of Linux know-how and basic Linux commands for this. But nothing a chatGPT search can't teach!
Installing the WSL Ubuntu terminal environment
Windows has made it very easy to install the Ubuntu terminal environment. Simply go to the Microsoft store, search for Ubuntu, and install it.

Once that's done, you will have to open it and set up the OS. If everything is set up properly, you should be greeted with a bash terminal and will be asked to provide a username and password for the Ubuntu OS. The password will NOT be visible when you type it out, that's for privacy reasons, and is perfectly okay. I suggest you choose a password that's short, safe and easy to type out quick, saves a ton of time when trying to execute sudo tasks. Once you type out your password, hit enter.

If you're facing an issue with this step, and the terminal is closing immediately after opening, or if its giving you an error, its mostly an error with the virtualization on your computer. You will have to access the BIOS and enable virtualization manually. Here's a link to get you started on that: How to enable virtualization on Windows

The bios looks like this. It may look different for your laptop/PC, but its important that you find the section that enables/disables the virtualization and turn it on.
Installing the essential packages
Good job on making it this far! Let's now install the essential packages for web development.
First off, its important for us to run sudo apt update and sudo apt upgrade. This will fetch the latest package repositories and then upgrade all the packages to their latest versions. This process will take a while.
Once that's done, its time for us to install the essential packages for web development.
sudo apt-get install -y curl- This install the curl (client URL) package.sudo apt install git- This installs Git on the system, the version control manager.sudo apt-get install -y nodejs- This installs the nodejs package.sudo apt install npm- This install the node package manager.
You're basically set. But you may require more packages later on, in which case, don't hesitate to look up the command to install the package on the internet. Look for the installation section in the documentation for detailed help on how to install them.
Starting to code
To begin coding, you can use these following commands to navigate the file directories of the Ubuntu subsystem:
cd foldername- To change the working directory to the foldercd ..- To change the working directory to the parent foldermkdir foldername- To make a new folder/directoryrmdir foldername- To remove the folder/directory
Once you make a directory for your project, change your working directory to that folder using cd project. If you have VS code already installed, simply execute code . to open the project directory on VS code. If you’re doing this for the first time, VS Code will ask you if it can install the support extension for the remote WSL terminal, for which you should click ‘install’ to.
If the installation of that VS Code extension is successful, you should be able to see the Ubuntu terminal instead of the usual Powershell or Windows command line terminal at the bottom when you press ctrl + ` .
That’s it!
You have yourself a shiny new Linux terminal within Windows, which you can use as your default for all your programming projects.



