---
title: Upgrade Bun to the latest version
sidebarTitle: Upgrade Bun
description: Upgrade Bun with the built-in bun upgrade command or install a specific version.
mode: center
---

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

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

`bun upgrade` downloads and installs the latest release of [aphrody-labs/bun](https://github.com/aphrody-labs/bun/releases), checks it against the release's `SHA256SUMS.txt`, and replaces the currently installed version. Set `APHRODY_BUN_REPO` to download releases from another repository.

<Note>To see the current version of Bun, run `bun --version`.</Note>

---

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

`bun upgrade --canary` installs the release tagged `canary`. When the repository has no such release, the command reports that no canary build exists.

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

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

To install a specific version, pass a version or an exact release tag to the install script:

<Tabs>
  <Tab title="macOS & Linux">
    ```bash terminal icon="terminal" curl -fsSL https://bun.aphrody.app/install.sh | bash -s bun-v1.4.5 ```
  </Tab>
  <Tab title="Windows">
    ```powershell PowerShell icon="windows" & ([scriptblock]::Create((irm https://bun.aphrody.app/install.ps1)))
    -Version 1.4.5 ```
  </Tab>
</Tabs>

---

## Package manager users

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

<Tip>
  **npm users** <br />
  Use `npm install -g @aphrody/bun-runtime@latest` instead.
</Tip>

---

## See also

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