How to deploy a Node application · Ample Computer

How to deploy a Node application

Deploy a Node web app or API with a compatible Node 22 runtime, production start command, PORT binding, and health checks.

the short version

To deploy a Node application, make sure it has a production start path and listens on the PORT environment variable at 0.0.0.0. Ample detects common Node projects, installs dependencies, runs the build when present, selects a Node 22 runtime for a new server, and waits for the app to pass health checks.

Who this is for

This guide is for Node, Express, Fastify, and other JavaScript server projects that need a public URL.

How to do it

  1. 1

Define a production start command. The process should start the actual web server, not a file watcher or development server. Put the command in package.json or provide it explicitly.

  1. 2

Bind to the platform port. Read process.env.PORT, fall back only for local use, and listen on 0.0.0.0 so the platform can reach the process.

$ server.listen(Number(process.env.PORT || 3000), '0.0.0.0')
  1. 3

Run the plan. The plan can detect linked databases, required secrets, and whether the repo contains multiple services.

$ ample plan --write
  1. 4

Deploy and inspect the result. Apply the plan. If activation fails, use runtime logs to inspect the process output rather than rerunning the same deployment.

$ ample up

What this supports

Know the limits

Common failure modes