An Ubuntu server
Basic knowledge of the command-line interface
Step 1: Update Package List
First, let's make sure your server's package list is up-to-date. Run the following command:
sudo apt update
Step 2: Install Node.js and npm
Bun relies on Node.js and npm, so we need to install them first. Run the following command to install both Node.js and npm:
sudo apt install nodejs npm
Step 3: Verify Node.js and npm Installation
To confirm that Node.js and npm are successfully installed, you can run:
node -v npm -v
The above commands should return the installed versions of Node.js and npm, respectively.
Step 4: Install Bun
Once Node.js and npm are installed, you can go ahead and install Bun globally using the following command:
npm install -g bun
Step 5: Check Bun Installation
To verify that Bun has been installed correctly, run:
This command should return the installed version of Bun, confirming that the installation was successful.
For more details and usage guidelines, you can always check the official Bun documentation.