Documentation
Deploy a Node.js app
Deploy Express, Fastify, Next.js, NestJS, Remix, Nuxt or any Node.js, Bun or Deno app on Rebasable.
Rebasable detects Node.js when your repository has a package.json. It installs dependencies with the package manager of your lockfile (npm, pnpm, Yarn or Bun), runs your build script if there is one, and starts the app with npm start (or the equivalent).
Requirements
- Listen on
0.0.0.0andprocess.env.PORT(default10000). - Commit your lockfile so builds are reproducible.
- Pick the Node.js version with
engines.nodeinpackage.jsonor a.node-version/.nvmrcfile.
{
"engines": { "node": "22.x" },
"scripts": {
"build": "tsc -p .",
"start": "node dist/server.js"
}
}
Express example
import express from 'express';
const app = express();
app.get('/', (_req, res) => res.send('Hello from Rebasable'));
app.get('/healthz', (_req, res) => res.send('ok'));
app.listen(process.env.PORT || 10000, '0.0.0.0');
Set Health check path to /healthz so deploys only go live when your app answers.
Common settings
| Setting | Typical value |
|---|---|
| Build command | npm ci && npm run build (auto-detected) |
| Start command | npm start (auto-detected) |
| Pre-deploy command | npx prisma migrate deploy or npm run migrate |
Frameworks
- Next.js: build
npm run build, startnpm start(runsnext start -p $PORT). For a fully static export (output: 'export'), create a static site with publish directoryout. - NestJS / Fastify / Koa / Hono: listen on
PORTand host0.0.0.0. - Remix / Nuxt / SvelteKit / Astro SSR: use the Node adapter and start the generated server.
- Monorepos: set Root directory to the app folder (for example
apps/api). Builds only rerun when files under it change if you set a build filter.
Bun and Deno
A bun.lockb / bun.lock file selects Bun; a deno.json selects Deno. Start commands are detected the same way, or you can set your own (bun run src/index.ts, deno run -A main.ts).
Troubleshooting
- “Port scan timeout” / health check failed: your app listens on
localhostor a fixed port. Use0.0.0.0andPORT. - Out of memory during build: set
NODE_OPTIONS=--max-old-space-size=1536as an environment variable or use a larger instance type. - Failed deploys get an automatic AI diagnosis with a suggested fix.