"Hello World" Examples Bun

Bun Hello World

A Bun application connected to PostgreSQL, running on Zerops with six ready-made environment configurations โ€” from AI agent and remote development to stage and highly-available production.

Lightweight project core
Single dedicated container with balancers (L3/L7), logger and statistics services
app:3000
Bun

Containers

1Shared Core

0.25 GBRAM

GBDisk (SSD)

 GitHub repo
db:5432,:6432
PostgreSQL

Container

1Shared Core

0.25 GBRAM

GBDisk (SSD)

3Shared Cores

0.75 GBRAM

GBDisk (SSD)

$4.35

Per month for
Resources cost
add
FreePer month for
Lightweight pkg.

After deploying one of the environments and getting to know Zerops, you have two paths forward. 1 Clone our GitHub repositories and use the whole recipe as a template, or if you already have an existing application on a similar stack, 2 integrate the recipe setup with your application.

or
Taking ownership of theenvironment

Small production environment offers a production-ready setup optimized for moderate throughput.

๐Ÿ“ฆClone the template repositories๐ŸWhat's next?

Taking ownership of the Small Production environment

๐Ÿ“ฆ Clone the template repositories

Fork or clone the following to your local machine or GitHub account:

๐Ÿ What's next?

See how the applications were integrated with Zerops

Even when you use this recipe as a template, it's good to have an idea of what steps were taken to best integrate the apps into Zerops.

Deploy environments for the rest of the development lifecycle

One environment rarely tells the full story โ€” deploy environments for other stages of development to see how they work on Zerops.

Knowledge Base

Bun ยท app
Base ImageGotchas

Bunapp

zerops-recipe-apps/bun-hello-world-app

Base Image

Includes: Bun, npm, yarn, git, bunx. NOT included: pnpm.

Gotchas

  • BUN_INSTALL: ./.bun for build caching โ€” Zerops can only cache paths inside the project tree. Default ~/.bun is outside it and gets lost between builds.
  • Use bunx instead of npx โ€” npx may not resolve correctly in the Bun runtime.
  • bun build --target bun only works with pure-JS dependencies โ€” The prod setup bundles with bun build which inlines all imports. This works for pure-JS packages (e.g. pg) but silently produces broken bundles for native addons (mysql2, bcrypt, sharp, canvas, etc.). The build exits 0 but the bundle fails at runtime or is empty. If your app uses native dependencies, skip bundling: use deployFiles: [./] and start: bun src/index.ts for both dev and prod setups.