How to set up Bun JS in Windows Via WSL (2024)

I understand that setting up a new workflow and technology stack can be a daunting and challenging task, especially if you are not familiar with the tools and systems involved. That’s why I’m creating this tutorial to provide you with a step-by-step guide on how to get started with Bun J.S. effortlessly. Bun J.S. is a powerful JavaScript framework that can help you build fast and scalable applications, but getting it up and running can be a bit of a hassle.

In this tutorial, I will be using Linux as a subsystem on Windows 11 (WSL) to demonstrate the installation process. However, if you’re using a Mac or Linux machine, you can skip this part and jump straight into the installation process. Unfortunately, Bun J.S. doesn’t have good native support for Windows at the moment, which is why we need to access a Linux terminal before we can install it. By following this tutorial, you will learn how to set up your development environment, install all the necessary tools and dependencies, and create a basic Bun J.S. application. Whether you’re a seasoned developer or a beginner, this tutorial will help you get started with Bun J.S. in no time.

Installing WSL and Debian

Before we can install Bun, we need to setup a distribution of Linux as a subsystem. For this tutorial, I will be using Debian. To do this, run your command prompt as an administrator and paste the following line :

wsl --install -d Debian

Once the installation is done and you are prompted to do so, you can now restart your PC.

Configure Debian

Upon restarting the Debian installation should finish and you should be directed to enter in a username and password. These can be whatever you want, but they must be remembered. If this does not happen upon restart, type Debian in the start menu and select the application from there.

Setup Debian for Bun

Open up a fresh command prompt window, and type WSL. You should be logged into Debian as your created username. We still need a few things before we can install bun. First, update and upgrade.

sudo apt update && sudo apt upgrade

Next, install curl.

sudo apt update && sudo apt-get install curl

Lastly, install unzip

sudo apt install unzip

Installing Bun

You can now install Bun via CURL at the command line.

curl -fsSL https://bun.sh/install | bash

Using Bun

Inside of this Debian user’s system, create a new folder called bun. Create a JavaScript file. You can now run the file using the Bun command. For example if my file was test.js :

bun test.js


As a web developer, you can benefit greatly from using BunJS in Windows via WSL (Windows Subsystem for Linux). This combination provides a seamless development environment by making use of the robustness and familiarity of Linux-based tools and the convenience of the Windows operating system.

Throughout this guide, we’ve explored the step-by-step process of installing and configuring BunJS within the WSL environment. From setting up WSL to installing Bun and initializing a Bun project.

Bun is a robust JavaScript framework that truly offers a wide range of powerful features that make the development process much more efficient, allowing developers to focus on building advanced applications. You now have access to many of the advantages of using Bun JS.

The most significant advantage of using BunJS is its zero-configuration setup. With this feature, you can start working on their projects right away without having to spend time configuring their environment. This saves a lot of time and effort in comparison to Node.

Another advantage to using Bun is its integrated hot module replacement. This feature enables developers to make changes to their code without having to refresh the page manually. This not only saves time but also makes the development process much more seamless and intuitive.BunJS is also known for its seamless integration with popular JavaScript frameworks like React and Vue.js.

Resources :

Scroll to Top