Bun is a fast JavaScript runtime that ships as a single binary with zero dependencies. It includes a package manager, test runner, and bundler in one tool. You can install Bun on macOS, Linux, and Windows through several methods.

This guide covers every way to install Bun, platform-specific requirements, and how to keep it updated.

What Is Bun?

Bun is an all-in-one JavaScript runtime built using Zig and JavaScriptCore. It handles package installs, runs scripts, bundles code, and executes tests without extra tooling.

After you install Bun, run bun --version in a fresh terminal to confirm the setup. Run bun --revision to see the exact build hash.

How to Install Bun on macOS and Linux

The fastest way to install Bun on macOS and Linux uses a one-line curl command:

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

This downloads the correct binary and places it in ~/.bun/bin.

Linux users need unzip before running the script. If it’s missing, install it with sudo apt install unzip.

Check your kernel version with the uname command (uname -r). Bun works best on kernel 5.6 or above, though 5.1 is the minimum.

How to Install Bun on Windows

Windows users can install Bun through PowerShell:

powershell -c "irm bun.sh/install.ps1|iex"

Bun requires Windows 10 version 1809 or later. Scoop users can run scoop install bun instead.

Install Bun with Package Managers

Beyond the curl script, you can install Bun through npm, Homebrew, Scoop, or Docker.

Operating SystemMethodCommand
macOSHomebrewbrew install oven-sh/bun/bun
WindowsScoopscoop install bun
Any platformnpmnpm install -g bun
ContainersDockerdocker pull oven/bun

If bun returns “command not found” after setup, add ~/.bun/bin to your PATH manually.

Upgrading Bun

Once you install Bun, the binary can update itself:

bun upgrade

Homebrew users should run brew upgrade bun instead. Scoop users should use scoop update bun.

Canary Builds

Bun publishes an untested canary build on every commit to main. Run bun upgrade --canary to try it, and bun upgrade --stable to switch back.

Installing an Older Version of Bun

Pass a version tag to the install script to grab a specific release:

curl -fsSL https://bun.com/install | bash -s "bun-v1.3.3"

Pre-built binaries for every release are on the GitHub releases page.

Choosing the Right Bun Binary

Bun distributes different builds for each platform. Standard x64 builds (Linux, Windows) need an AVX2-capable processor. If you get an “Illegal Instruction” error, use the baseline build that only requires SSE4.2.

macOS ARM64 builds target Apple Silicon (M1 and newer). macOS x64 builds cover older Intel Macs. Linux ARM64 builds work on 64-bit ARM boards and servers.

Distributions without glibc (like Alpine) need the musl variant. The install script picks the right one automatically. If you see a GLIBC_2.29 not found error, download the musl build from the releases page manually. macOS 13.0 or later is required regardless of chip type.

Uninstalling Bun

On macOS and Linux, delete the entire installation directory with rm:

rm -rf ~/.bun

Windows users should remove the .bun folder from their home directory and clean up any related PATH entries.

FAQs

Does Bun work on all Linux distributions?

Bun works on most Linux distributions with glibc. Alpine and similar musl-based distros need the musl binary variant, which the installer selects automatically.

Can I install Bun alongside Node.js?

Yes. Bun installs into its own directory at ~/.bun and does not interfere with existing Node.js installations on your system.

What should I do if “bun” returns command not found?

Add ~/.bun/bin to your shell’s PATH variable. Open your .bashrc or .zshrc file, add the export line, then reload with source.

How often does Bun release updates?

Bun pushes canary builds on every commit to main. Stable releases happen regularly, and you can update with a single bun upgrade command.

Is Bun free to use?

Bun is open source and released under the MIT license. You can use it in personal and commercial projects at no cost.

Willie has over 15 years of experience in Linux system administration and DevOps. After managing infrastructure for startups and enterprises alike, he founded Command Linux to share the practical knowledge he wished he had when starting out. He oversees content strategy and contributes guides on server management, automation, and security.