Railway Node.js SIGTERM Handler Not Running
Quick answer
If you start Node with npm, yarn or pnpm, the package manager swallows SIGTERM. Start Node directly with a custom start command.
Most likely fix: Start Node directly
How to fix it
Try these in order — the most common fix is first.
1. Start Node directly
- Open the service Settings tab
- Scroll to the Deploy section
- Change Custom Start Command from 'npm run start' to 'node index.js' (your real entry file)
- Redeploy
Did this fix it?
Symptoms
Your SIGTERM handler never runs and the service is eventually force-quit, looking like a sudden crash.
Why it happens
- npm/yarn/pnpm becomes the main process and intercepts the shutdown signal
This guide also covers
- railway sigterm node
- railway graceful shutdown
- railway npm start sigterm
Still not working?
If Railway keeps failing, you're not alone. See every Railway problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usOther Railway errors
- Railway Application Failed to Respond (502)
- Railway: No Start Command Could Be Found
- Railway Slow Deployments and Slow App
- Railway ENOTFOUND redis.railway.internal
- Railway Postgres: Could Not Locate a Valid Checkpoint Record
- Railway SSL Certificate Stuck or Not Working (526, 525, Too Many Redirects)
- Railway 405 Method Not Allowed on POST Requests
- Railway Services Stopped: Trial Credits Ran Out