LinuxCommandLibrary

bun-upgrade

Upgrade the Bun runtime

TLDR

Upgrade to the latest stable version

$ bun upgrade
copy

Upgrade to the latest canary build
$ bun upgrade --canary
copy

Switch back to the latest stable version
$ bun upgrade --stable
copy

SYNOPSIS

bun upgrade [version] [--verbose] [--help]

PARAMETERS

version
    Specific version to upgrade to (e.g., '1.1.0', 'canary'); defaults to latest stable

--verbose, -v
    Enable verbose logging during download and installation

--help
    Display help information and exit

DESCRIPTION

Bun is an incredibly fast JavaScript runtime, bundler, transpiler, and package manager built from scratch using the JavaScriptCore engine from WebKit.

It serves as a drop-in replacement for Node.js, npm, vite, and more, offering superior speed and lower memory usage.

The bun upgrade command (invoked as bun upgrade) self-updates the Bun installation to the latest stable release for the current platform. It automatically detects the architecture (x64/arm64), downloads the prebuilt binary from official servers, verifies integrity, and replaces the existing binary with minimal downtime.

This is ideal for developers tracking rapid Bun releases, which include frequent performance enhancements, new ES modules support, and compatibility improvements. By default, it upgrades to the latest stable; specify a version for precise control, including canary builds for previews.

Usage requires an internet connection and write permissions to the Bun install path (typically ~/.bun/bin/bun or system-wide).

CAVEATS

Supported only on macOS (Intel/Apple Silicon), Linux x64, and WSL; not Windows native. Requires internet and write access to install directory. May prompt for sudo on system installs. Self-hosts check integrity but verify downloads manually if concerned.

INSTALL PATH

Typically /usr/local/bin/bun (system) or ~/.local/share/bun/bin/bun (user). Check with bun --version.

DOWNGRADE/REVERT

No built-in downgrade; reinstall prior version manually via curl -fsSL https://bun.sh/install | bash -s "old.version".

HISTORY

Introduced in Bun 0.1.0 (September 2022) by Jarred Sumner at Oven. Evolved with Bun's growth from experiment to production runtime, now used by millions. Tracks Bun's weekly releases since 2023 stable channel launch.

SEE ALSO

bun(1), node(1), npm(1), curl(1)

Copied to clipboard