Back to documentation
Deployment

Advanced: Render Start Commands and Health Checks (Self-Hosting)

For developers self-hosting a copy: what the start command and health check path do on Render.

This guide is optional reading for developers who self-host a copy on their own Render account. 9orb hosts your product by default and keeps it running for you.

After a successful build, Render launches the service with a start command and then watches a health check endpoint to decide whether the new version is alive.

The start command

npm start

This runs the project's start script — for Next.js, `next start` — booting the production server produced by the build. The server must listen on the port Render provides in the PORT environment variable.

Build and start are different jobs: the build command runs once per deploy and can be slow; the start command runs every time the service boots and should do nothing but start the server. Do not put migrations or installs in the start command.

The health check path

/api/health

A tiny endpoint that returns HTTP 200 when the app is up. Render uses it for zero-downtime deploys (traffic switches only once the new version is healthy) and to restart an instance that stops answering.

If a deploy shows "build succeeded" but then fails or times out, the health check is the usual suspect: the app built fine but crashed on startup, or never started listening on the right port. Open the runtime logs (not the build logs) to see the crash.

Common startup failures

  • Missing environment variable: the app throws on boot because a required value (database URL, secret) is absent. Check the service's Environment tab.
  • Crash loop: the process exits immediately and Render restarts it repeatedly. The first stack trace in the logs is the real error.
  • Port binding: the server hard-codes a port instead of reading PORT.

Free tier behavior

On Render's free tier, web services spin down after a period without traffic, and the next request triggers a cold start that takes a while. Paid instance types stay always-on.