Copy link
If you’ve deployed a new Node.js app on cPanel and suddenly see a “503 Service Unavailable” error, don’t panic you’re definitely not the first. This is one of the most common issues developers face when running Node.js apps in a shared hosting environment with CloudLinux and Passenger (Phusion Passenger).
In this guide, we’ll explain why the 503 error happens, step-by-step methods to fix it permanently, and how to prevent it in future deployments.
A 503 Service Unavailable error in Node.js means that your application is not running or responding when the web server tries to connect.
In shared hosting with CloudLinux + cPanel + Passenger, your Node.js app doesn’t run continuously — instead, Passenger spawns the app when it’s first accessed. If something fails during startup (like missing dependencies or version mismatch), cPanel shows a 503 response.
Common Causes of 503 Service Unavailable in Node.js on cPanel
Here are the most common reasons behind this issue:
Step-by-Step Fix for 503 Error in Node.js on cPanel
💡 Pro Tip: CloudLinux suspends applications that exceed their resource limits to maintain server stability.
✅ Keep Node.js versions consistent between local and server (e.g., both using Node.js 18.x).
Navigate to your app directory: cd ~/your-app-folder
Sometimes, uploaded ZIPs don’t include node_modules.
Run:
npm install
If logs mention a missing module (like express), run:
npm install express
You generally shouldn’t specify a port manually on shared hosting. Passenger manages this automatically. If you’ve hardcoded a port in your script (like app.listen(3000)), replace it with:
const PORT = process.env.PORT || 3000;
app.listen(PORT);
This ensures compatibility with cPanel’s internal Passenger port binding.
To check if a port is stuck:
lsof -i:3000
kill -9 <PID>
If you see Error: Cannot find module ‘express’ — reinstall the missing dependency.
After fixes, restart the app:
Alternatively, from the terminal:
npm start
If the app runs fine, reload the browser — the 503 error should be gone.
Problem
Fix
App not running
Go to Setup Node.js App → Start
Wrong version
Match local and cPanel Node.js versions
Missing modules
Run npm install
Port already in use
Use lsof -i:PORT → kill -9 PID
Startup file error
Re-select correct file in cPanel
Shared hosting servers often run CloudLinux + Passenger.
While this setup is efficient, it means your app isn’t persistent — if it crashes, it won’t auto-restart until accessed again. That’s why monitoring and correct configuration are crucial.
If you frequently deploy Node.js apps, shared hosting may not always be ideal. Consider upgrading to a CloudLinux VPS with full Node.js support, which includes:
You can explore Node.js hosting plans optimized for Passenger environments, which provide better uptime and fewer 503 interruptions.
Q2. Does Node.js run 24/7 on shared hosting? No. In cPanel shared hosting, Node.js apps start when accessed and stop after inactivity or errors.
Q3. How do I change the Node.js version in cPanel? Go to Setup Node.js App → Edit → Node.js version, select your desired version, and click Save.
Q4. Can I run multiple Node.js apps under one cPanel account? Yes, but each app must be configured separately with its own directory and startup file.
Q5. How do I monitor my Node.js app logs in cPanel? Go to Setup Node.js App → Edit → Logs or use the terminal to view real-time logs.
Q6. What if the 503 error still appears after all fixes? Try restarting the app, reinstalling dependencies, or contacting your hosting support to check for CloudLinux throttling.
💻 Code More, Debug Less — That’s the BigCloudy Promise
Whether you’re building with Node.js, Python, or PHP — BigCloudy gives you the tools that developers want: instant app version switching, isolated environments, real-time logs, and smart resource scaling — all inside a clean cPanel UI.
Save my name, email, and website in this browser for the next time I comment.
Or copy link