
Linux
How to install Bun in Debian & Linux distro?
Install the Bun all-in-one JavaScript runtime & toolkit in the Linux distro.
On September 8, 2023, Bun 1.0 was rolled out, and now Bun is stable and ready for production.
You can install Bun locally in your system in various ways. You can install Bun with curl in your Linux distro and use the node package manager (NPM, yarn, and PNPM).
The most common way to install a bun is with a Curl script, but we discuss every possible way so that you can install a bun very easily in your Linux distro.
Requirement
Before installing the Bun, You need to install two command line tools or software.
Please skip this section if both software are already installed in your system.
- Unzip
- Curl
Unzip
Unzip is required to install the Bun in Linux or Linux distro. It means without Unzip, you can not install the Bun.
You can install the unzip with the following command.
sudo apt-get install unzip
Run the following command to verify whether the unzip is installed in your system.
unzip -v
Curl
If the curl command is not installed in your system, then first install the curl command with the following command.
sudo apt-get install curlRun the following command to verify whether the curl is installed in your system.
curl -v
Installation
- Curl
- Node Package Manager
Curl
You can install Bun with a curl command. Paste the following command in your terminal. It is installed with the latest version of Bun.
curl -fsSL https://bun.sh/install | bash
Command output looks like this.
$ curl -fsSL https://bun.sh/install | bash
######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun
Added "~/.bun/bin" to $PATH in "~/.bashrc"
To get started, run:
source /home/gitpod/.bashrc
bun --helpYou can also install a Specific version of Bun with the following command.
# to install a specific version
curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"Command output looks like this.
$ curl -fsSL https://bun.sh/install | bash -s "bun-v1.0.0"
######################################################################## 100.0%
bun was installed successfully to ~/.bun/bin/bun
Run 'bun --help' to get startedError Unzip is required
if you find an error, unzip is required to install the bun. in that case, install unzip with the following command and rerun your bun installation command.
sudo apt-get install unzip
Node Package Manager
The second way is to install Bun using the node package manager. To install the Bun, run the following command.
The following command installs the latest version of Bun in your system.
npm install -g bun
Command output looks like this.
$ npm uninstall -g bun
removed 3 packages in 254msInstall the specified version of the Bun with the NPM command.
npm install -g bun@1.0.0## Note
You can not install a bun with yarn and pnpm.
How do I update Bun?
Even if you use NPM or curl command to install the Bun, you just run the following command to update the Bun.
$ bun upgradeCommand output looks like this.
$ bun upgrade
bun v1.0.2 is out! You're on 1.0.0
[2.05s] Upgraded.
Welcome to bun v1.0.2!
Report any bugs:
https://github.com/oven-sh/bun/issues
What's new:
https://github.com/oven-sh/bun/releases/tag/bun-v1.0.2
Changelog:
https://github.com/oven-sh/bun/compare/bun-v1.0.0...bun-v1.0.2How do you remove the Bun in the Linux distro?
To remove or uninstall the Bun. It depends on the bun installation. For example, if you use NPM, you need a different command, or if you use the curl command, you need another one.
Based on installation, you require a different command to uninstall Bun.
- With curl
- NPM
With curl
If you install Bun with the curl command. To uninstall the Bun, run the following command.
sudo rm -rf ~/.bunNPM
If you use NPM to install Bun, run the following command: uninstall Bun.
npm uninstall -g bun
Conclusion
Bun's all-in-one JavaScript runtime & toolkit launch with vital revolution feature. Similar to Deno.
Everything depends on community adoption, and now Bun is an excellent alternative to Node.js.
You can share and follow me on Twitter and LinkedIn. I write tons of articles related to frontend development and Linux.
If you are interested in those topics, follow me on Medium, officialrajdeepsingh.dev, join the Linux and frontend web publication, and sign up for my free newsletter.






