# Upgrade Bun to the latest version (/docs/guides/util/upgrade)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 524 · updated: 2026-07-28 -->
Related: [Detect when code is executed with Bun](/docs/guides/util/detect-bun.md), [Get the current Bun version](/docs/guides/util/version.md), [Hash a password](/docs/guides/util/hash-a-password.md), [Generate a UUID](/docs/guides/util/javascript-uuid.md), [Encode and decode base64 data](/docs/guides/util/base64.md), [Compress and decompress data with gzip](/docs/guides/util/gzip.md)

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

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

`bun upgrade` downloads and installs the latest stable version of Bun, replacing the currently installed version.

<Note>
  To see the current version of Bun, run 

  `bun --version`

  .
</Note>

***

## Verify the upgrade [#verify-the-upgrade]

After upgrading, verify the new version:

```bash terminal icon="terminal"
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 [#upgrade-to-canary-builds]

Canary builds are released on every commit to the `main` branch. They're untested, but useful for trying new features or verifying bug fixes before a release.

```bash terminal icon="terminal"
bun upgrade --canary
```

<Warning>
  Canary builds are not recommended for production use. They may contain bugs or breaking changes.
</Warning>

***

## Switch back to stable [#switch-back-to-stable]

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

```bash terminal icon="terminal"
bun upgrade --stable
```

***

## Install a specific version [#install-a-specific-version]

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

<Tabs>
  <Tab title="macOS & Linux">
    ```bash terminal icon="terminal"
    curl -fsSL https://bun.sh/install | bash -s "bun-v1.3.3"
    ```
  </Tab>

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

***

## Package manager users [#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** <br />
  Use `brew upgrade bun` instead.

  **Scoop users** <br />
  Use `scoop update bun` instead.
</Tip>

***

## See also [#see-also]

* [Installation](/installation) — Install Bun for the first time
* [Update packages](/pm/cli/update) — Update dependencies to latest versions
