Skip to content

Node.js and Bun backends

Deploy a Node.js app on Enzonic

A project with a start script and no build script is deployed as a generic Node.js server, whatever library it uses. This covers plain http servers, WebSocket servers and small services that need a process that stays up.

At a glance

What Enzonic Deploy does with a Node.js project when you connect it. You can override any of it in the project settings.

Language
JavaScript / TypeScript
Detected from
A start script and no build script, with no framework detected first
Build command
None by default
Output
The project folder
Runs as
Server

Dependencies install with the package manager your lockfile names: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile, or bun install --frozen-lockfile. Node.js 18, 20, 22 and 24 are available. Deploy reads engines.node in package.json, then .nvmrc or .node-version, and uses Node.js 22 when nothing pins a version.

How it runs

  • Server

    Always: your start command with PORT set.

Deploy Node.js step by step

  1. 1Make sure "start" runs your server and that it listens on process.env.PORT.
  2. 2Connect the repository and deploy.
server.js
import http from 'node:http';

http
  .createServer((req, res) => {
    res.writeHead(200, { 'content-type': 'text/plain' });
    res.end('ok');
  })
  .listen(process.env.PORT ?? 3000, '0.0.0.0');

Connect a database to Node.js

Create a database on Enzonic Databases (or from the project's settings) and its connection string is added to the project's environment variables. This example uses PostgreSQL.

db.js
import postgres from 'postgres';

export const sql = postgres(process.env.DATABASE_URL, { max: 10 });

Postgres projects get two variables: DATABASE_URL through the connection pooler for the app, and DATABASE_URL_UNPOOLED for migrations.

PostgreSQL on Enzonic DatabasesEvery database engine

Things to know

  • Deploy routes HTTP to the PORT your process listens on; a process with no HTTP listener fails its health check.

Plan limits that matter here

From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.

Plan limits that matter for Node.js
LimitFreePro
Build minutes3,000/mo, 1 concurrent10,000/mo, 3 concurrent
Servers1 instance, 512 MB, sleeps after 15 min idle3 always-on, 2 GB
Bandwidth150 GB/mo2 TB/mo

Compare every plan

Related guides

Ship your Node.js project tonight

Connect the repository and the build settings fill themselves in. Free plan, no card.

Start free