> ## Documentation Index
> Fetch the complete documentation index at: https://bun.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://bun.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://bun.manicule.dev/api/mcp.
> Every agent surface: https://bun.manicule.dev/.well-known/llms-manifest.json

# Installation (/installation)

<!-- agent-signals: reading_time_min: 5 · est_tokens: 2582 · updated: 2026-08-02 -->
Related: [Welcome to Bun](/index.md), [Quickstart](/quickstart.md), [TypeScript](/typescript.md), [TypeScript 6 and 7](/typescript-6.md), [Feedback](/feedback.md)

> 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.

<Tip>After installation, verify with `bun --version` and `bun --revision`.</Tip>

## Installation

<Tabs>
  <Tab title="macOS & Linux">
    <CodeGroup>
```bash title="curl" icon="globe"
curl -fsSL https://bun.com/install | bash
```
    </CodeGroup>

<Note>**Linux users**  The `unzip` package is required to install Bun (`sudo apt install unzip`). Kernel version 5.6 or higher is recommended; Bun runs on kernels as old as 3.10 (RHEL 7) with graceful degradation of newer syscalls. Use `uname -r` to check your kernel version.</Note>
  </Tab>

  <Tab title="Windows">
    <CodeGroup>
```powershell title="PowerShell" icon="terminal"
powershell -c "irm bun.sh/install.ps1|iex"
```
    </CodeGroup>

<Warning>Bun requires Windows 10 version 1809 or later.</Warning>

    For support and discussion, join the **#windows** channel on the [Discord](https://bun.com/discord).
  </Tab>

  <Tab title="Package Managers">
    <CodeGroup>
```bash title="npm" icon="npm"
npm install -g bun # the last `npm` command you'll ever need
```

```bash title="Homebrew" icon="/icons/homebrew.svg"
brew install oven-sh/bun/bun
```

```bash title="Scoop" icon="terminal"
scoop install bun
```
    </CodeGroup>
  </Tab>

  <Tab title="Docker">
    Bun provides a Docker image that supports both Linux x64 and arm64.

    ```bash icon="docker" title="Docker"
    docker pull oven/bun
    docker run --rm --init --ulimit memlock=-1:-1 oven/bun
    ```

    ### Image Variants

    Bun also publishes image variants for different operating systems:

    ```bash icon="docker" title="Docker"
    docker pull oven/bun:debian
    docker pull oven/bun:slim
    docker pull oven/bun:distroless
    docker pull oven/bun:alpine
    ```
  </Tab>
</Tabs>

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

```bash icon="terminal" title="terminal" 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
```

<Warning>If you've installed Bun but are seeing a `command not found` error, you may have to manually add the installation
directory (`~/.bun/bin`) to your `PATH`.</Warning>

<Accordion title="Add Bun to your PATH">
  <Tabs>
    <Tab title="macOS & Linux">
      <Steps>
        <Step title="Determine which shell you're using">
          ```bash icon="terminal" title="terminal" terminal
          echo $SHELL
          # /bin/zsh  or /bin/bash or /bin/fish
          ```
        </Step>

        <Step title="Open your shell configuration file">
          * For bash: `~/.bashrc`
          * For zsh: `~/.zshrc`
          * For fish: `~/.config/fish/config.fish`
        </Step>

        <Step title="Add the Bun directory to PATH">
          Add this line to your configuration file:

          ```bash icon="terminal" title="terminal" terminal
          export BUN_INSTALL="$HOME/.bun"
          export PATH="$BUN_INSTALL/bin:$PATH"
          ```
        </Step>

        <Step title="Reload your shell configuration">
          ```bash icon="terminal" title="terminal" terminal
          source ~/.bashrc  # or ~/.zshrc
          ```
        </Step>
      </Steps>
    </Tab>

    <Tab title="Windows">
      <Steps>
        <Step title="Determine if the bun binary is properly installed">
          ```bash icon="terminal" title="terminal" terminal
          & "$env:USERPROFILE\.bun\bin\bun" --version
          ```

          If the command runs successfully but `bun --version` is not recognized, bun is not in your system's PATH. To fix this, open a PowerShell terminal and run the following command:

          ```bash icon="terminal" title="terminal" terminal
          [System.Environment]::SetEnvironmentVariable(
            "Path",
            [System.Environment]::GetEnvironmentVariable("Path", "User") + ";$env:USERPROFILE\.bun\bin",
            [System.EnvironmentVariableTarget]::User
          )
          ```
        </Step>

        <Step title="Restart your terminal">
          Restart your terminal and test with `bun --version`.

          ```bash icon="terminal" title="terminal" terminal
          bun --version
          ```
        </Step>
      </Steps>
    </Tab>
  </Tabs>
</Accordion>

***

## Upgrading

Once installed, the binary can upgrade itself:

```bash icon="terminal" title="terminal" terminal
bun upgrade
```

<Tip>
  **Homebrew users** <br />
  To avoid conflicts with Homebrew, use `brew upgrade bun` instead.

  **Scoop users** <br />
  To avoid conflicts with Scoop, use `scoop update bun` instead.
</Tip>

***

## Canary Builds

[→ View canary build](https://github.com/oven-sh/bun/releases/tag/canary)

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

```bash icon="terminal" title="terminal" 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.

<Tabs>
  <Tab title="Linux & macOS">
    To install a specific version, pass the git tag to the install script:

    ```bash icon="terminal" title="terminal" terminal
    curl -fsSL https://bun.com/install | bash -s "bun-v1.3.3"
    ```
  </Tab>

  <Tab title="Windows">
    On Windows, pass the version number to the PowerShell install script:

    ```powershell icon="windows" title="PowerShell"
    iex "& {$(irm https://bun.com/install.ps1)} -Version 1.3.3"
    ```
  </Tab>
</Tabs>

***

## Direct Downloads

To download Bun binaries directly, visit the [releases page on GitHub](https://github.com/oven-sh/bun/releases).

### Latest Version Downloads

<CardGroup cols="2">
<Card icon="/_assets/832523c337a86f6ea2a901e34e1963ea9e985010e288c102f3a76428b3bc0880" title="Linux x64" href="https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64.zip">Standard Linux x64 binary</Card>

<Card icon="/_assets/832523c337a86f6ea2a901e34e1963ea9e985010e288c102f3a76428b3bc0880" title="Linux x64 Baseline" href="https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64-baseline.zip">For older CPUs without AVX2</Card>

<Card icon="/_assets/d58949e432aaa5e17b85e5e6f22ec0ce77bedf7c9ea6d99114de68bbab4279e3" title="Windows x64" href="https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64.zip">Standard Windows binary</Card>

<Card icon="/_assets/d58949e432aaa5e17b85e5e6f22ec0ce77bedf7c9ea6d99114de68bbab4279e3" title="Windows x64 Baseline" href="https://github.com/oven-sh/bun/releases/latest/download/bun-windows-x64-baseline.zip">For older CPUs without AVX2</Card>

<Card icon="/_assets/d58949e432aaa5e17b85e5e6f22ec0ce77bedf7c9ea6d99114de68bbab4279e3" title="Windows ARM64" href="https://github.com/oven-sh/bun/releases/latest/download/bun-windows-aarch64.zip">Windows on ARM (Snapdragon, etc.)</Card>

<Card icon="/_assets/35be2e27ec71687630f03d6b80043d11daa521dd8b607dab5ea268a8e6fd707a" title="macOS ARM64" href="https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-aarch64.zip">Apple Silicon (M1/M2/M3)</Card>

<Card icon="/_assets/35be2e27ec71687630f03d6b80043d11daa521dd8b607dab5ea268a8e6fd707a" title="macOS x64" href="https://github.com/oven-sh/bun/releases/latest/download/bun-darwin-x64.zip">Intel Macs</Card>

<Card icon="/_assets/832523c337a86f6ea2a901e34e1963ea9e985010e288c102f3a76428b3bc0880" title="Linux ARM64" href="https://github.com/oven-sh/bun/releases/latest/download/bun-linux-aarch64.zip">ARM64 Linux systems</Card>
</CardGroup>

### Musl Binaries

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

* [Linux x64 musl](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64-musl.zip)
* [Linux x64 musl baseline](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-x64-musl-baseline.zip)
* [Linux ARM64 musl](https://github.com/oven-sh/bun/releases/latest/download/bun-linux-aarch64-musl.zip)

<Note>Bun's glibc binaries require glibc 2.17 or newer. If you encounter an error like `bun:
  /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_... not found`, try using the musl binary. Bun's install script
automatically chooses the correct binary for your system.</Note>

***

## CPU Requirements

CPU requirements depend on which binary you're using:

<Tabs>
  <Tab title="Standard Builds">
    **x64 binaries** target the Haswell CPU architecture (AVX and AVX2 instructions required)

    | Platform | Intel Requirement               | AMD Requirement    |
    | -------- | ------------------------------- | ------------------ |
    | x64      | Haswell (4th gen Core) or newer | Excavator or newer |
  </Tab>

  <Tab title="Baseline Builds">
    **x64-baseline binaries** target the Nehalem architecture for older CPUs

    | Platform     | Intel Requirement               | AMD Requirement    |
    | ------------ | ------------------------------- | ------------------ |
    | x64-baseline | Nehalem (1st gen Core) or newer | Bulldozer or newer |

<Warning>Baseline builds are slower than regular builds. Use them only if you encounter an "Illegal
Instruction" error.</Warning>
  </Tab>
</Tabs>

<Note>Bun does not support CPUs older than the baseline target, which requires the SSE4.2 extension. Bun requires macOS 13.0
or later.</Note>

***

## Uninstall

To remove Bun from your system:

<Tabs>
  <Tab title="macOS & Linux">
    ```bash icon="terminal" title="terminal" terminal
    rm -rf ~/.bun
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell icon="windows" title="PowerShell"
    powershell -c ~\.bun\uninstall.ps1
    ```
  </Tab>

  <Tab title="Package Managers">
    <CodeGroup>
```bash title="npm" icon="npm"
npm uninstall -g bun
```

```bash title="Homebrew" icon="/icons/homebrew.svg"
brew uninstall bun
```

```bash title="Scoop" icon="terminal"
scoop uninstall bun
```
    </CodeGroup>
  </Tab>
</Tabs>
