Railway
Railway auto-detects Node projects from package.json. A config file is optional; add one only when you want to pin the start command, set a health check, run pre-deploy migrations, or switch to a Dockerfile-based build.
When to choose Railway
- You want the lowest-config push-and-it-runs experience on Node.
- You want managed Postgres, Redis, or MySQL in the same project.
- You like environment-per-PR with usage-based billing.
Server entrypoint
railway.json
Or, equivalently, railway.toml:
Deploy
Gotchas
- Don't override
PORT. Railway injects it and the load balancer targets that port. healthcheckTimeoutis in seconds. Make it longer than your slowest legitimate startup.- Use
preDeployCommandfor migrations so schema changes run before traffic shifts.