| title | description |
|---|---|
Installation |
Install Bun with npm, Homebrew, Docker, or the official script. |
Bun ships as a single, dependency-free executable. You can install it via script, package manager, or Docker across macOS, Linux, and Windows.
After installation, verify with bun --version and bun --revision.
<CodeGroup>
```bash curl icon="globe"
curl -fsSL https://bun.com/install | bash
```
</CodeGroup>
<Note>
**Linux users** � The `unzip` package is required to install Bun. Use `sudo apt install unzip` to install the unzip package. Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. Use `uname -r` to check Kernel version.
</Note>
</CodeGroup>
<Warning>
Bun requires Windows 10 version 1809 or later.
</Warning>
For support and discussion, please join the **#windows** channel on our [Discord](https://bun.com/discord).
<Tab title="Package Managers">
<CodeGroup>
```bash npm icon="npm"
npm install -g bun # the last `npm` command you'll ever need
```
```bash Homebrew icon="/icons/homebrew.svg"
brew install oven-sh/bun/bun
```
```bash Scoop icon="terminal"
scoop install bun
```
</CodeGroup>
</Tab>
```bash Docker icon="docker"
docker pull oven/bun
docker run --rm --init --ulimit memlock=-1:-1 oven/bun
```
### Image Variants
There are also image variants for different operating systems:
```bash Docker icon="docker"
docker pull oven/bun:debian
docker pull oven/bun:slim
docker pull oven/bun:distroless
docker pull oven/bun:alpine
```
To check that Bun was installed successfully, open a new terminal window and run:
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 <Step title="Add the Bun directory to PATH">
Add this line to your configuration file:
```bash terminal icon="terminal"
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
```
</Step>
<Step title="Reload your shell configuration">
```bash terminal icon="terminal"
source ~/.bashrc # or ~/.zshrc
```
</Step>
</Steps>
</Tab>
<Tab title="Windows">
<Steps>
<Step title="Determine if the bun binary is properly installed">
```bash terminal icon="terminal"
& "$env:USERPROFILE\.bun\bin\bun" --version
```
If the command runs successfully but `bun --version` is not recognized, it means that bun is not in your system's PATH. To fix this, open a Powershell terminal and run the following command:
```bash terminal icon="terminal"
[System.Environment]::SetEnvironmentVariable(
"Path",
[System.Environment]::GetEnvironmentVariable("Path", "User") + ";$env:USERPROFILE\.bun\bin",
[System.EnvironmentVariableTarget]::User
)
```
</Step>
<Step title="Restart your terminal">
After running the command, restart your terminal and test with `bun --version`
```bash terminal icon="terminal"
bun --version
```
</Step>
</Steps>
</Tab>
Once installed, the binary can upgrade itself:
bun upgradeTo avoid conflicts with Homebrew, use `brew upgrade bun` instead.
Scoop users
To avoid conflicts with Scoop, use scoop update bun instead.
Bun automatically releases an (untested) canary build on every commit to main. To upgrade to the latest canary build:
# Upgrade to latest canary
bun upgrade --canary
# Switch back to stable
bun upgrade --stableThe canary build is useful for testing new features and bug fixes before they're released in a stable build. To help the Bun team fix bugs faster, canary builds automatically upload crash reports to Bun's team.
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:```bash terminal icon="terminal"
curl -fsSL https://bun.com/install | bash -s "bun-v1.3.3"
```
```powershell PowerShell icon="windows"
iex "& {$(irm https://bun.com/install.ps1)} -Version 1.3.3"
```
To download Bun binaries directly, visit the releases page on GitHub.
Standard Linux x64 binary For older CPUs without AVX2 Standard Windows binary For older CPUs without AVX2 Apple Silicon (M1/M2/M3) Intel Macs ARM64 Linux systemsFor distributions without glibc (Alpine Linux, Void Linux):
Bun has specific CPU requirements based on the binary you're using:
**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 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>
To remove Bun from your system:
```bash terminal icon="terminal" rm -rf ~/.bun ```<Tab title="Windows">
```powershell PowerShell icon="windows"
powershell -c ~\.bun\uninstall.ps1
```
</Tab>
<Tab title="Package Managers">
<CodeGroup>
```bash npm icon="npm"
npm uninstall -g bun
```
```bash Homebrew icon="/icons/homebrew.svg"
brew uninstall bun
```
```bash Scoop icon="terminal"
scoop uninstall bun
```
</CodeGroup>
</Tab>