Skip to content

Node.js and Bun backends

Deploy a Express app on Enzonic

Express apps deploy as they run on your machine: Deploy installs dependencies, runs your build script if you have one and starts the server. Koa is detected the same way.

At a glance

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

Language
JavaScript / TypeScript
Detected from
express or koa in dependencies; A start script, a main field, or server.js / index.js / app.js / src/index.js / server.mjs / index.mjs
Build command
Your build script, if any
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 Express step by step

  1. 1Read the port from process.env.PORT.
  2. 2Connect the repository and deploy.
index.js
import express from 'express';

const app = express();
app.use(express.json());
app.get('/', (req, res) => res.send('Hello from Enzonic'));

app.listen(process.env.PORT ?? 3000);

Connect a database to Express

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.

routes/posts.js
import pg from 'pg';

const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });

export async function listPosts(req, res) {
  const { rows } = await pool.query('select id, title from posts limit 20');
  res.json(rows);
}

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

  • If package.json has neither a start script nor a main field, and none of the usual entry files exist, the build stops with "add \"start\" to package.json".

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 Express
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 Express project tonight

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

Start free