RuntimePackage ManagerBundlerTest RunnerLinterFormatterGuidesReferenceBlogFeedback

Installation

Install Bun with npm, Homebrew, Docker, or the official script.

Overview

Bun ships as a single, dependency-free executable. Install it with the install script, a package manager, or Docker on macOS, Linux, and Windows.

Installation

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

To check that Bun was installed successfully, open a new terminal window and run:

terminal
bun --version
# Output: 1.x.y

# See the precise commit of `oven-sh/bun` that you're using
bun --revision
# Output: 1.x.y+b7982ac13189
Add Bun to your PATH
  1. Determine which shell you're using
    terminal
    echo $SHELL
    # /bin/zsh  or /bin/bash or /bin/fish
    
  2. Open your shell configuration file
    • For bash: ~/.bashrc
    • For zsh: ~/.zshrc
    • For fish: ~/.config/fish/config.fish
  3. Add the Bun directory to PATH

    Add these lines to your configuration file:

    terminal
    export BUN_INSTALL="$HOME/.bun"
    export PATH="$BUN_INSTALL/bin:$PATH"
    
  4. Reload your shell configuration
    terminal
    source ~/.bashrc  # or ~/.zshrc
    

Upgrading

Once installed, the binary can upgrade itself:

terminal
bun upgrade

Canary Builds

-> View canary build

Bun automatically releases an (untested) canary build on every commit to main. To upgrade to the latest canary build:

terminal
# Upgrade to latest canary
bun upgrade --canary

# Switch back to stable
bun upgrade --stable

Use a canary build to test new features and bug fixes before they reach a stable release. To help the Bun team fix bugs faster, canary builds automatically upload crash reports.


Installing Older Versions

Since Bun is a single binary, you can install older versions by re-running the installer script with a specific version.

To install a specific version, pass the git tag to the install script:

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

Direct Downloads

To download Bun binaries directly, visit the releases page on GitHub.

Latest Version Downloads

Musl Binaries

For distributions without glibc (Alpine Linux, Void Linux):


CPU Requirements

Bun ships a single x64 binary per platform. It targets the Nehalem microarchitecture (SSE4.2) and selects AVX2/AVX-512 code paths at runtime when the CPU supports them, so there is no separate "baseline" download to choose.

PlatformIntel RequirementAMD Requirement
x64Nehalem (1st gen Core) or newerBulldozer or newer

Uninstall

To remove Bun from your system:

terminal
rm -rf ~/.bun