Deploy a Bun application on onesubnet
Deploy a JavaScript app with Bun: install, start, port and environment variables.
Deploy a Bun application on onesubnet
onesubnet runs your JavaScript/TypeScript applications via Bun (ultra-fast runtime, Node.js compatible). Deploy via Git.
1. Prepare the project
- A
package.jsonwith astartscript, and@types/bunif using TypeScript. - Listen on the port from the
PORTvariable:
const port = Number(process.env.PORT ?? 3000)
Bun.serve({ port, fetch: () => new Response("Hello from Bun") })
2. Deploy
- Connect your Git repository in the panel.
- Build command:
bun install - Start command:
bun run src/index.ts(orbun start).
3. Environment variables
In Settings → Environment (connection string, secrets…). Access via process.env or Bun.env.
4. Logs
Live console in the panel.
References
- Bun: https://bun.sh/docs
- Bun.serve: https://bun.sh/docs/api/http