Skip to main content
Vercel is a cloud platform for building, deploying, and scaling apps.
The Bun runtime is in Beta. Some features are not yet supported — for example, automatic source maps, byte-code caching, and metrics on node:http/https.
Bun.serve is not supported on Vercel Functions. Use Bun with frameworks supported by Vercel, like Next.js, Express, Hono, or Nitro.

1

Configure Bun in vercel.json

To enable the Bun runtime for your Functions, add a bunVersion field in your vercel.json file:
vercel.json
{
	"bunVersion": "1.x"
}
Vercel automatically detects this configuration and runs your application on Bun. The value must be "1.x"; Vercel handles the minor version internally.For best results, match your local Bun version with the version used by Vercel.
2

Next.js configuration

If you’re deploying a Next.js project (including ISR), update your package.json scripts to use the Bun runtime:
package.json
{
	"scripts": {
		"dev": "bun --bun next dev", 
		"build": "bun --bun next build"
	}
}
The --bun flag runs the Next.js CLI under Bun. Bundling (with Turbopack or Webpack) is unchanged.
With these scripts, both local development and builds use Bun.
3

Deploy your app

Connect your repository to Vercel, or deploy from the CLI:
terminal
# Using bunx (no global install)
bunx vercel login
bunx vercel deploy
Or install the Vercel CLI globally:
terminal
bun i -g vercel
vercel login
vercel deploy
Learn more in the Vercel Deploy CLI documentation →
4

Verify the runtime

To confirm your deployment uses Bun, log the Bun version:
https://mintcdn.com/bun-1dd33a4e/JUhaF6Mf68z_zHyy/icons/typescript.svg?fit=max&auto=format&n=JUhaF6Mf68z_zHyy&q=85&s=7ac549adaea8d5487d8fbd58cc3ea35bindex.ts
console.log("runtime", process.versions.bun);
runtime 1.3.3
See the Vercel Bun Runtime documentation for feature support →

  • Fluid compute: Both Bun and Node.js runtimes run on Fluid compute and support the same core Vercel Functions features.
  • Middleware: To run Routing Middleware with Bun, set the runtime to nodejs:
https://mintcdn.com/bun-1dd33a4e/JUhaF6Mf68z_zHyy/icons/typescript.svg?fit=max&auto=format&n=JUhaF6Mf68z_zHyy&q=85&s=7ac549adaea8d5487d8fbd58cc3ea35bmiddleware.ts
export const config = { runtime: "nodejs" };