Deploy by framework

Node servers

Deploy NestJS, Express, Fastify, Hono, or Koa as managed Node servers.

Nitroship packages supported Node HTTP servers with their production dependencies. You do not need a Dockerfile for a standard JavaScript entrypoint.

Detection and build output

Preset slugDependency markerEntrypoint
nestjs@nestjs/corenode dist/main.js
expressexpressnode <file> from scripts.start, otherwise package.json main
fastifyfastifySame entrypoint rule
honohono and @hono/node-serverSame entrypoint rule
koakoaSame entrypoint rule

NestJS requires a build script. For other servers, a simple start script such as "start": "node dist/server.js" takes precedence over main. The entrypoint must be JavaScript inside the project, not a TypeScript source file or an arbitrary shell command. TypeScript projects need a build step that emits the selected JavaScript file.

Runtime code, assets, and production dependencies are packaged together. Put runtime packages in dependencies; devDependencies are omitted from the deployed runtime. These server presets do not invent a separate CDN directory: the server serves its own assets.

The example selects express. Replace it with the slug for your server; node-servers is a documentation group, not a preset slug.

Deploy

Install the CLI

curl -fsSL https://nitroship.co/install.sh | bash
ntro login

Already installed? Skip ahead. Full options, PATH setup, and updates: Install the CLI.

nitroship.json
{
  "build": {"framework": "express"},
  "compute": {"regions": ["kr-icn"]}
}

Setting build.framework skips detection and uses this preset, even if your project root has a Dockerfile. It can't be combined with build.dockerfile. Without it, Nitroship detects the build as described in How Nitroship chooses a build.

ntro apps create my-node-servers-app
ntro deploy . --prod

After installing dependencies, you can also build locally with ntro deploy . --prod --local. After deployment, open static assets and a server route at the URL printed by the CLI.

Bind to the platform port

Read PORT and listen on all network interfaces. For example:

server.js
import express from "express";

const app = express();
app.get("/", (_req, res) => res.send("Hello Nitroship"));
app.listen(Number(process.env.PORT || 3000), "0.0.0.0");
package.json (scripts)
{"scripts": {"start": "node server.js"}}

For NestJS, use await app.listen(Number(process.env.PORT || 3000), "0.0.0.0"). For Fastify, pass { port: Number(process.env.PORT || 3000), host: "0.0.0.0" } to listen. Hono must use @hono/node-server, not a Bun, Deno, or edge-only adapter.

Limits and custom setups

Server deployments need a compute region. Your server must listen on 0.0.0.0:$PORT (default 3000). A single Node server handles all HTTP requests and any assets it serves; routes aren't split into separate functions the way Next.js routes are.

Nitroship does not automatically run migrations, queue workers, or schedulers. Run migrations in CI or locally; see Scheduled jobs for periodic work. Store uploads in S3 or other object storage, and configure secrets through Environment variables.

For adapters or output layouts outside this contract, use your own Dockerfile. Remove build.framework and define installation, build, and startup in the Dockerfile.

On this page