Back to documentation
Deployment

Understanding Render Start Commands and Health Checks

Learn what the start command and health check path do and how Render uses them to run your service.

After a successful build, Render launches your service with a start command and then watches a health check endpoint to decide whether the new version is alive. These two settings are small but they control whether deploys go live or roll back.

The start command

For generated projects the start command is:

npm start

which 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; generated projects handle this automatically.

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

The health check path

Generated services use:

/api/health

a tiny endpoint that returns HTTP 200 when the app is up. Render uses it in two ways:

  • Zero-downtime deploys: when you ship a change, Render starts the new version alongside the old one and only switches traffic once the health check passes. If the new version never becomes healthy, the old version keeps serving and the deploy is marked failed — your users never see the broken build.
  • Ongoing monitoring: if a running instance stops answering health checks, Render restarts it.
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 key (database URL, API key) is absent. Check the service's Environment tab; the error message in runtime logs names the variable.
  • Crash loop: the process exits immediately, Render restarts it, it exits again. The first stack trace in the logs is the real error; everything after is repetition.
  • Port binding: the server hard-codes a port instead of reading PORT. Generated projects do not do this, but manual edits sometimes introduce it.

Free tier behavior

On Render's free tier, web services spin down after around fifteen minutes without traffic. The next request triggers a cold start — the start command runs again — which takes several seconds. This is normal and expected on the free tier; paid instance types stay always-on. Decide based on your audience: for a personal project the wait is harmless, for a business's booking page it costs customers.