Bun · Deployment guide · Hosting

Deploy Bun with the runtime made explicit.

Bun HTTP services, APIs, WebSocket servers, and JavaScript or TypeScript applications. Darwa AI connects the repository, runs bun install --frozen-lockfile && bun run build, deploys the result on long-running bun process, and keeps domains, HTTPS, releases, logs, and billing in the same workspace.

Long-running Bun process
Deployment model
bun install --frozen-lockfile && bun run build
Build command
Application source or compiled output
Expected output
Web Services
Recommended Darwa product
Deployment contract

What a production Bun deployment needs.

These are operational requirements, not a generic framework feature list. Confirm them in the repository before the first release.

01

Build

Use bun install --frozen-lockfile && bun run build. Commit the lockfile and pin the runtime version so a rebuild installs the same dependency graph.

Review deployment docs →
02

Start

Production start: bun run start. The command must stay in the foreground and report a failed boot with a non-zero exit code.

Explore Web Services →
03

Artifact

Expected deployable output: Application source or compiled output. Generated artifacts should come from the build rather than being edited after release.

Configure the build →
04

Configuration

Store secrets and environment-specific values in the service environment. Do not commit production credentials or bake them into frontend bundles.

Manage configuration →
05

Health and logs

Expose a lightweight health endpoint, keep startup logs actionable, and verify the public endpoint after every release.

See runtime operations →
06

Known boundary

Confirm that every Node package and native dependency supports the selected Bun release. Bind the service to 0.0.0.0 and the injected PORT.

Check a workload with Darwa →
Release path

From Bun repository to a repeatable release.

A successful first deploy is not enough. The release must be reproducible, observable, reversible, and safe to scale.

Connect source01

Select the repository and production branch. Keep preview work isolated from the production service.

Detect and confirm02

Confirm long-running bun process, the build command, output, and production start command instead of relying on a lucky default.

Add environment03

Set secrets and public configuration with the correct build-time or runtime scope.

Deploy and verify04

Watch the build, startup, and health checks; then exercise a real application path rather than only the homepage.

Attach the domain05

Point the domain after the generated endpoint is healthy. Managed HTTPS should complete before traffic is moved.

Plan rollback06

Keep the previous successful release available and make database changes backward-compatible before scaling replicas.

FAQ

Answers before you deploy.

Can Darwa AI host Bun?+

Yes. Bun HTTP services, APIs, WebSocket servers, and JavaScript or TypeScript applications. The recommended starting product is Web Services, subject to the runtime boundary described on this page.

What build command should I use for Bun?+

Start with bun install --frozen-lockfile && bun run build. Keep the dependency lockfile committed and test the same command in a clean environment before deployment.

What starts Bun in production?+

Use bun run start. A server deployment must listen on the assigned port, stay in the foreground, and exit when startup fails.

Can I connect a custom domain?+

Yes. Deploy to the generated endpoint first, verify health, then connect the domain and wait for managed HTTPS before moving traffic.

Where should secrets be stored?+

Use the service environment and keep production secrets out of Git, build logs, browser bundles, and image layers.

How do I deploy without downtime?+

Use health checks, backward-compatible data changes, a verified new release, and a retained previous release that can be restored quickly.