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
- 1Commit bun.lock.
- 2Connect the repository and deploy.
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.
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 engineThings 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.
| Limit | Free | Pro |
|---|---|---|
| Build minutes | 3,000/mo, 1 concurrent | 10,000/mo, 3 concurrent |
| Servers | 1 instance, 512 MB, sleeps after 15 min idle | 3 always-on, 2 GB |
| Bandwidth | 150 GB/mo | 2 TB/mo |
Related guides
- Deploy a Hono appHono APIs on Node.js or Bun as a long-lived server.
- Deploy a Node.js appAny Node.js server with a start script: bots, WebSocket servers, workers with an HTTP port.
- Deploy a Node.js functions appAn api/ folder of functions that scale to zero, with no framework at all.
Ship your Bun project tonight
Connect the repository and the build settings fill themselves in. Free plan, no card.