2.6 KiB
Bun ships as a single executable that can be installed a few different ways.
{% callout %} Windows users — Bun does not currently provide a native Windows build. We're working on this; progress can be tracked at this issue. In the meantime, use one of the installation methods below for Windows Subsystem for Linux.
Linux users — Kernel version 5.6 or higher is strongly recommended, but the minimum is 5.1. {% /callout %}
{% codetabs %}
$ curl -fsSL https://bun.sh/install | bash # for macOS, Linux, and WSL
$ npm install -g bun # the last `npm` command you'll ever need
$ brew tap oven-sh/bun # for macOS and Linux
$ brew install bun
$ docker pull oven/bun:edge
$ docker run --rm --init --ulimit memlock=-1:-1 oven/bun:edge
{% /codetabs %}
Upgrading
Once installed, the binary can upgrade itself.
$ bun upgrade
{% callout %}
Homebrew users — To avoid conflicts with Homebrew, use brew upgrade bun instead.
{% /callout %}
Bun automatically releases an (untested) canary build on every commit to main. To upgrade to the latest canary build:
$ bun upgrade --canary
Completions
Shell auto-completion should be configured automatically when Bun is installed.
If not, run the following command. It uses $SHELL to determine which shell you're using and writes a completion file to the appropriate place on disk. It's automatically re-run on every bun upgrade.
$ bun completions
To write the completions to a custom location:
$ bun completions > path-to-file # write to file
$ bun completions /path/to/directory # write into directory