VxCloud
🟢Beginner12 minBackend

Deploy a Node.js (Express / Fastify / NestJS) API

Pick your framework, clone from Git, install dependencies, and run the API under process supervision so it restarts on crash and survives a reboot.

What you'll build

  • An Express / Fastify / Koa / Hapi / NestJS API running on your node
  • PM2-style supervision: auto-restart on crash, start on boot
  • A clean env_vars + package_file convention you can reuse

Before you begin

  • A registered node
  • A Node.js API repo with a start script in package.json
  • Knowing your framework and the port it listens on
1

Connect the repository

Open Development → Deploy → Node.js. Steps 1–2 set the target node and the Git source, exactly like the other wizards.

app.prodxcloud.com/dashboard/development

Deploy Node.js — Application source

2
3
4
5
https://github.com/acme/orders-api
main
GitHub token▾
Step 2 — repo + branch. Private repos use a Vault-sealed token.
2

Pick your framework and Node version

Step 3 is the one that differs from the frontend wizards: choose the framework. This sets the right start command and health-check defaults — nestjs expects dist/main.js, express expects your entry file, and so on.

app.prodxcloud.com/dashboard/development

Deploy Node.js — Node.js configuration

3
4
5
nestjs▾
20▾
orders-api
Step 3 — framework drives the start command; pick Node 20 LTS unless you need otherwise.

Framework options

express, fastify, koa, hapi, nestjs, or plain for a hand-rolled HTTP server.
3

Set the entry point, package file, and env

Step 4 — point at the right package_file (handy for monorepos), set the app port, and paste environment variables one KEY=value per line. These are injected at process start, not baked into the image.

app.prodxcloud.com/dashboard/development

Deploy Node.js — Application settings

4
5
dist/main.js
package.json
PORT=3000 LOG_LEVEL=info
3000 / 80
Step 4 — for a monorepo, package_file is e.g. services/api/package.json.

Read PORT from the environment

Hard-coding a port is the #1 cause of “deploy succeeded but nothing responds”. Bind to process.env.PORT.
4

Deploy with process supervision

Allocate resources and deploy. The runtime wraps your process in PM2-style supervision so a crash triggers an automatic restart and the API comes back after a node reboot.

Deployment progress100%
  • Clone repository20%
  • npm install50%
  • npm run build (if present)70%
  • Start under supervision + Nginx proxy95%
  • Health check on /100%
Supervision means an unhandled exception restarts the API instead of taking it down.

Confirm it’s up and self-healing:

bash
$ curl -s https://orders-api.<node-domain>/health{"status":"ok"}$ # Kill the process on the box — supervision brings it straight back$ ssh ubuntu@<node-ip> "pkill -f node; sleep 3; curl -s localhost:3000/health"{"status":"ok"}

Resilient API live

Crash-restart and boot-persistence are on. To add a managed database, continue with the FastAPI + Postgres tutorial — the Postgres half applies to any runtime.

Nice work — you're done!

You completed Deploy a Node.js (Express / Fastify / NestJS) API. Keep the momentum going with the next walkthrough, or jump back to the full catalog.