Skip to content

Node.js and Bun backends

Deploy a Bun app on Enzonic

When the repository has a Bun lockfile, Deploy installs with bun install, builds with bun run build and runs the app on the bun1 runtime instead of Node.js. Frameworks detected on top (Hono, Express, Vite and others) keep their usual modes.

At a glance

What Enzonic Deploy does with a Bun project when you connect it. You can override any of it in the project settings.

Language
JavaScript / TypeScript
Detected from
bun.lock or bun.lockb in the project; The packageManager field naming bun
Build command
bun run build (if a build script exists)
Output
Depends on the framework
Runs as
Runtime bun1

Dependencies install with the package manager your lockfile names: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile, or bun install --frozen-lockfile. Node.js 18, 20, 22 and 24 are available. Deploy reads engines.node in package.json, then .nvmrc or .node-version, and uses Node.js 22 when nothing pins a version.

How it runs

  • Runtime bun1

    For servers and functions of projects whose package manager is Bun.

Deploy Bun step by step

  1. 1Commit bun.lock.
  2. 2Connect the repository and deploy.
index.ts
Bun.serve({
  port: Number(process.env.PORT ?? 3000),
  hostname: '0.0.0.0',
  fetch() {
    return new Response('Hello from Bun on Enzonic');
  },
});

Connect a database to Bun

Create a database on Enzonic Databases (or from the project's settings) and its connection string is added to the project's environment variables. This example uses PostgreSQL.

db.ts
import { SQL } from 'bun';

export const sql = new SQL(process.env.DATABASE_URL!);
const [{ now }] = await sql`select now()`;

Postgres projects get two variables: DATABASE_URL through the connection pooler for the app, and DATABASE_URL_UNPOOLED for migrations.

PostgreSQL on Enzonic DatabasesEvery database engine

Things to know

  • A lockfile that is out of date with package.json does not fail the build: Deploy warns and installs without --frozen-lockfile. Commit an updated lockfile for reproducible builds.

Plan limits that matter here

From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.

Plan limits that matter for Bun
LimitFreePro
Build minutes3,000/mo, 1 concurrent10,000/mo, 3 concurrent
Servers1 instance, 512 MB, sleeps after 15 min idle3 always-on, 2 GB
Bandwidth150 GB/mo2 TB/mo

Compare every plan

Related guides

Ship your Bun project tonight

Connect the repository and the build settings fill themselves in. Free plan, no card.

Start free