What You Need to Start with WSL

Historically, Windows has not been the favorite operative system for most developers. But with the arrival of WSL, things are changing. It allows us to run Linux and Windows at the same time. Therefore, it is possible to run Ubuntu in one window and Microsoft Excel in another. 😍

If you have not seen the post in which I talk about WSL and how to install it, you can find it here.

Now that you have WSL installed on your computer, you may be wondering how do I start using it? 🤔

Hi! I’m Ernesto, and in this post, I will show you how to install, in WSL, the mandatory tools that a web developer needs, like Git or Node. 😀

Install Git

To install Git in WSL, run this command:

If the distro you have installed is Ubuntu, you’ll notice that when you execute the git --version command to check the version, it is not the last one available.

To update to the last version, we need the PPA Ubuntu offers; add it by running the following command:

Remember that when you use sudo, you will have to enter your super-user password.

Once you added the PPA, check if there is any update and install it.

Now, if you check your Git version, it should be the last one.

Install Node JS

The recommended way to install Node in WSL and any Linux distro is through NVM (Node Package Manager).

If you are using Bash, install NVM by running this command:

If you are using Zsh, open the .zshrc file and add the nvm plugin.

If you are not sure whether you are using Bash or Zsh, run this command: echo $SHELL

The wonderful thing about NVM is that we can install more than one version of Node and use them as we want.

Install Node

Once you have NVM installed, you can install any version of Node you prefer.

By the time I wrote this blog, the last version of Node is 16.1.0.

You can change the version you want to use by running this command:

When you install NVM, you also install NPM. Check it by running the following:

Install MySQL

Before you install MySQL, make sure all your packages are up to date.

Once your packages are up to date, run this command to install MySQL:

You can check if the installation went well by running the following:

Before connecting, we have to run the MySQL service.

Now you can connect to MySQL.

If you want to exit MySQL, type exit and press enter

It is mandatory to have a password to protect your access to MySQL. To create one, first, you have to connect to MySQL and run this command:

Once you have your password, you can connect to MySQL by running this command:

You will have to write the password you just created. That is a better way to connect to MySQL.

MySQL connected

In this step, you will see all the magic that WSL can do. You will run an app installed in Windows (MySQL Workbench) and connect it with a MySQL server that is running in Linux. 🤯🤯

If you don’t have MySQL Workbench installed, you can download and install it here.

Now, open it, and create a new connection.

New MySQL Workbench connection

Enter the connection name and the password you created before by clicking the “Store in Vault” button.

Enter password

Now, to test the connection, click the “Test Connection” button.

MySQL Workbench connected

And that’s it! You are ready to use WSL with your projects. Just open your favorite code editor and start coding. 👩‍💻 👨‍💻

Conclusions

There are a lot more tools 🛠️ that a developer needs, but I wanted to show the basic ones. However, if you have doubts on how to install any of them, I recommend you search how to install it in Ubuntu or any other Linux distro. After all, you are running real Linux. 😉

Thanks for reading! 📖 If this post helped you, please give it a clap. 🖐 And let me know if you have any contribution, comment, doubt, or recommendation. It helps me a lot to improve my content. 😃

See you in the next post. 👋

Originally published at https://ernestoangulo.hashnode.dev.

Just someone who likes design 🎨 and code 💻. Systems Engineering student. https://dribbble.com/netosym

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store