What Is Phusion Passenger and How Does cPanel Run Node.js?
Phusion Passenger is the application server cPanel uses to run your Node.js app — it starts your app, manages its processes, assigns it a port, and restarts it when needed. Understanding it explains several cPanel Node.js behaviours that otherwise seem mysterious.
What Passenger does for you
Instead of you running node app.js and keeping it alive yourself, Passenger runs your app behind the web server, manages its lifecycle, and routes web requests to it. It is why cPanel Node hosting "just works" without you managing a process.
Three things this means for your app
- Use process.env.PORT — Passenger tells your app which port to listen on via an environment variable. Do not hard-code a port; listen on
process.env.PORT. Hard-coding is a top cause of "application failed to start". - Restart via tmp/restart.txt — Passenger watches that file to know when to restart; see restarting your app.
- Your startup file is the entry point — Passenger runs the file you set as the startup file; see setting the startup file.
Passenger vs PM2
On shared cPanel, Passenger manages your app, so you generally do not run PM2 yourself — that is for VPS or Webuzo setups where you control the process. On cPanel, let Passenger do its job.
Why persistent background work is limited
Because Passenger manages the process and shared hosting conserves resources, long-running background tasks may be paused or stopped when idle. If your app needs always-on background processing, a VPS is a better fit — see why apps stop on shared hosting.
Frequently asked questions
Why must I use process.env.PORT?
Passenger assigns the port and passes it in that variable. If your app listens on a fixed port instead, it will not receive requests and will appear broken. Always bind to process.env.PORT.
Do I need PM2 on cPanel?
Generally no — Passenger already manages your app's process. PM2 is for environments where you control the process yourself, like a VPS or Webuzo.
Can I run a worker or cron process with Passenger?
Passenger runs your web app; persistent background workers are constrained on shared hosting. For reliable background jobs, use a VPS where you can run workers and a job queue.
Was this article helpful?