Deploy/Bun
Framework guide

Deploy a Bun app to production

Agents love Bun — ask Claude Code for 'a fast API' and there's a decent chance you get Hono on Bun. Classic buildpack platforms still treat Bun as exotic; Launchmatic's Nixpacks detection supports it natively, lockfile and all.

How detection works

A bun.lockb (or bun.lock) in the repo, or "bun" in package.json engines. Nixpacks installs Bun and uses your package.json scripts with bun run.

Build configuration & gotchas

Start command

bun run start mapping to bun src/index.ts — Bun runs TypeScript directly, so most Bun apps skip the build step entirely.

Port binding

Bun.serve({ port: Number(process.env.PORT) || 3000 }) — Hono's export default { port, fetch } shape works too; either way, read PORT from the environment.

Node compatibility

Most npm packages work under Bun, but native Node addons are the usual exception. If one fails at runtime, pin the dependency to a pure-JS alternative — or deploy the same code under Node by removing bun.lockb.

Environment variables

PORTInjected — pass to Bun.serve.
DATABASE_URLWorks with Bun's built-in postgres client and Drizzle.

A deploy-ready Hono + Bun entrypoint:

import { Hono } from "hono";

const app = new Hono();
app.get("/health", (c) => c.text("ok"));

export default {
  port: Number(process.env.PORT) || 3000,
  fetch: app.fetch,
};

FAQ

Does Launchmatic run bun.lockb installs?+

Yes — the presence of Bun's lockfile is exactly what triggers Bun detection, and dependencies install with `bun install` for the fast, reproducible build you'd get locally.

Ready to deploy?

Free to start. No credit card. Auto-SSL on custom domains, managed Postgres, and per-branch preview deploys included.

This guide is part of our complete vibe coding hosting guide — how to take any AI-built app to production.

AI tools that emit this stack