> ## Documentation Index
> Fetch the complete documentation index at: https://bun.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade Bun to the latest version

Bun upgrades itself with the built-in `bun upgrade` command.

```bash terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun upgrade
```

`bun upgrade` downloads and installs the latest stable version of Bun, replacing the currently installed version. If you're on a canary build, `bun upgrade` installs the latest canary build instead.

> [!NOTE]
>
> To see the current version of Bun, run `bun --version`.

***

## Verify the upgrade

After upgrading, verify the new version:

```bash terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun --version
# Output: 1.x.y

# See the exact commit of the Bun binary
bun --revision
# Output: 1.x.y+abc123def
```

***

## Upgrade to canary builds

Canary builds are published automatically from the `main` branch once a commit's CI tests pass. They're useful for trying new features or verifying bug fixes before a release.

```bash terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun upgrade --canary
```

> [!WARNING]
>
> Canary builds are not recommended for production use. They may contain bugs or breaking changes.

***

## Switch back to stable

If you're on a canary build and want to return to the latest stable release:

```bash terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
bun upgrade --stable
```

***

## Install a specific version

To install a specific version of Bun, use the install script with a version tag:

> [tab] macOS & Linux
>
> ```bash terminal icon="terminal" theme={"theme":{"light":"github-light","dark":"dracula"}}
> curl -fsSL https://bun.sh/install | bash -s "bun-v1.3.3"
> ```

> [tab] Windows
>
> ```powershell PowerShell icon="windows" theme={"theme":{"light":"github-light","dark":"dracula"}}
> iex "& {$(irm https://bun.sh/install.ps1)} -Version 1.3.3"
> ```

***

## Package manager users

If you installed Bun with a package manager, upgrade with that package manager instead of `bun upgrade` to avoid conflicts.

> [!TIP]
>
> **Homebrew users** \\
>
> Use `brew upgrade bun` instead.
>
> **Scoop users** \\
>
> Use `scoop update bun` instead.

***

## See also

* [Installation](https://bun.com/docs/installation.md) — Install Bun for the first time
* [Update packages](https://bun.com/docs/pm/cli/update.md) — Update dependencies to latest versions


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.