Bun hosting in 2026: how to run a Bun server on Livops
Bun is not a separate preset. A Node project that uses Bun, through a bun lockfile, a packageManager of bun or Elysia, is started with bun, so Bun.serve and bun:sqlite work. Livops picks the start command from your package.json or your TypeScript entry file.
By Livops team, the people who build and run LivopsUpdated
Bun does not get its own preset on Livops. A Node project that uses Bun is built as a Node project, and only the command that starts it changes. The reason is practical: Bun runs TypeScript directly and provides Bun.serve and bun:sqlite, which do not exist under plain Node. So the start command must run under bun, or the app would crash on its first request.
How Livops decides
Livops treats the project as a Bun project when any one of these is true:
- a
bun.lockorbun.lockbfile is in the repository package.jsonhas apackageManagerfield that starts withbun@- the project depends on
elysia, which runs on Bun only - the
startscript begins withbun
The start command
- If
package.jsonhas astartscript, Livops runsbun run start. On a build image that has no Bun, it falls back tonpm run start. - If there is no
startscript, Livops runsbunon the first of these files that exists:src/index.ts,index.ts,src/server.ts,server.ts,src/main.ts,main.ts,src/app.ts,app.ts.
Bun runs .ts files itself, so a project with no build step can start from its TypeScript source.
The port
Read PORT from the environment and listen on it. In Bun that is Bun.serve({ port: Number(process.env.PORT) || 3000 }). Do not hard-code a port. A fixed port makes the app unreachable on Livops.
Set the health check path to /, or to a page that always answers.
Telegram bots
A Telegram bot on Bun with grammy or telegraf is a bot, not a web server. It dials out to Telegram, so it needs no port and no health check page. Follow Grammy bot hosting for the bot-specific settings.
Environment variables
Put secrets and settings in the Variables section of the cabinet. Read them with process.env or Bun.env. A change takes effect after a restart.
Common mistakes
- A
startscript that runsbun --watch. The watcher is for your laptop. Use a plainbun runof the entry file in the start script. - A hard-coded port. Read
PORT. - Relying on a lockfile you did not commit. Commit
bun.lockso the install matches what you tested. - Bun APIs with no Bun detection rule. If the code uses
Bun.serveorbun:sqlitebut none of the rules above match, Livops starts it with Node and it crashes. Keep one of them true, usually thebun.lockyou commit.
Questions
How does Livops know my project uses Bun?
From any one of these: a bun.lock or bun.lockb file, a packageManager field that starts with bun@, the elysia dependency, or a start script that begins with bun. Any one is enough.
Which command starts a Bun project?
If the package.json has a start script, bun run start, and npm run start on an image that has no bun. If there is no start script, bun on the first TypeScript entry it finds, in this order: src/index.ts, index.ts, src/server.ts, server.ts, src/main.ts, main.ts, src/app.ts, app.ts.
Is a Bun app free on Livops?
A Bun server is a web app, a process that stays up, so it is paid by the memory it uses.
Sources
- Bun — Documentation (bun.com). Checked .
- Bun — Run a file (bun.com). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Bun appRelated
- Node.js hosting in 2026: how to deploy an Express appA Node.js server in production needs one long-running process that listens on the port it is given, restarts when it crashes and exits cleanly on SIGTERM. On Livops you push a repository with package.json and it runs as a web app for 39 credits a month (39,000 so'm). Here is what Node needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- Express.js hosting in 2026: the options comparedAn Express app in production needs one long-running Node process that listens on process.env.PORT on every interface, trusts exactly the proxy in front of it, exits cleanly on SIGTERM, and keeps sessions and data in a database rather than in memory. On Livops an Express repository deploys from a push for 39 credits a month (39,000 so'm). Here is how Render, Railway, Fly.io, Vercel and a VPS with pm2 compare.
- grammY bot deploy: polling, webhooks and hostingDeploy a grammY bot as one always-on Node.js process: bot.start() for polling, or webhookCallback() behind an HTTP server, with bot.stop() on SIGTERM. On Livops a repository with grammy in package.json runs as a bot from every push, for 19 credits a month (19,000 so'm).
- App not listening on $PORT: why the health check failed after deployThe platform started your app, tried the port it gave it, and nothing answered in time. Almost always the app listens on its own fixed port instead of the PORT variable, listens on localhost (127.0.0.1) instead of 0.0.0.0, or crashed or was still starting when the check gave up. Listen on 0.0.0.0 and the port in PORT, and it passes.
- npm failed with return code 1 (npm ERR! code 1): how to fix the buildnpm failed with return code 1, or npm install exited with 1, is npm ERR! code 1 in newer npm: it only says that a script npm ran exited with code 1. The real error is printed above it: usually a compile or type error, a lockfile out of sync with package.json, or a dependency whose install script failed. Find the first error line above code 1, fix that, and the build passes.
- Deno hosting in 2026: how to deploy a Deno appA Deno project is recognised from deno.json, built only when it has a build task, and started from its preview or start task, or from its entry file. Livops runs it on the port it assigns.