Deploy a Hono API on Bun to your own VPS, no Docker

Deploy a Hono API on Bun to your own VPS: ox installs Bun, runs bun install from bun.lock, and starts src/index.ts under systemd behind Caddy.

Last updated 2026-10-09

On this page

To deploy Hono on Bun to a VPS with ox, add the repo as a project and deploy it, with no Dockerfile and no ox.toml. ox reads src/index.ts and bun.lock, runs bun install --frozen-lockfile, then starts bun run src/index.ts under systemd behind Caddy with HTTPS. Run ox check in your repo to see the same plan before the first deploy.

Plan verified, real-server test pending. The plan below is what ox check prints for a minimal Hono on Bun repo in ox's tests. A deploy on a real server is not recorded yet.

ox reads src/index.ts and bun.lock, builds the plan on the card, and starts bun run src/index.ts on your server.

What ox detects in a Hono on Bun repo

This is the plan ox check prints for a minimal a Hono API running on Bun, with no ox.toml. Each row says where its value came from: a file in the repo, or ox's default.

FieldValueSource
app.startbun run src/index.tsdetected:src/index.ts
build.installbun install --frozen-lockfiledetected:bun.lock
tools.bun1.3default

The ox.toml for Hono on Bun

None is needed: the plan above comes from the repo alone. Write one to serve your own domain or to change what ox detected. This one passes ox check against the same repo: [app] keeps the detected start command and build.

ox.toml, optional
domains = ["api.example.com"]

[app]

Check and deploy Hono on Bun

Add the repo as a project, then check and ship it from a terminal:

Check, deploy and read the logs
ox check                                # in the repo: the plan above, offline
ox new <owner/repo> --server <server>  # add the repo as a project
ox deploy <project> --wait              # stream the deploy, exit with its result
ox logs <project> --follow             # the app's own logs

Variables to set for Hono on Bun

None before the first deploy: ox check asks for no variable. Add your own on the dashboard's Variables tab or with ox vars set <project> KEY.

ox provides these to the app itself: PORT, HOST, OX_ENV, OX_PROJECT, OX_RELEASE, OX_DATA_DIR, PUBLIC_URL and PUBLIC_HOST.

If the Hono on Bun deploy fails

  • TCP connect to 127.0.0.1:8001 did not answer within 120s: dial tcp 127.0.0.1:8001: connect: connection refused: The app started but never answered on the port ox gave it. Listen on 127.0.0.1 at $PORT; the lines above the message are the app's own output. More.
  • web of shop on main keeps crashing: systemd restarted it 5 times in the last 10 minutes. The Logs tab shows why.: The release went live and then kept dying. Read the Logs tab for the error and deploy a fix, or roll back. More.
  • the app exited while starting (failed): The start command ran and stopped. The log shows the app's last lines, most often a missing variable or a wrong path to the built file. More.

Your visitors never see a failed deploy: the previous release keeps serving until the new one passes its health check.

Next steps

Hono on Bun FAQ

Do I need a Dockerfile or an ox.toml to deploy Hono on Bun to a VPS?

No. ox does not use Docker, and ox check on a Hono on Bun repo with no ox.toml prints Ready to deploy. Write an ox.toml only to change what ox detected.

What does ox install on the server for Hono on Bun?

Only what the plan names: bun 1.3 (ox's default). Your app's own dependencies are installed by the build into the release folder, not system-wide.

Does Bun need a build step?

No. Bun runs TypeScript directly, so ox installs from bun.lock and starts bun run src/index.ts, with no build.

Every stack ox deploys, and the ones it does not yet, is on the Stacks page.