Copy link
Recently, a developer friend of mine was panicking because his Node.js app crashed on a cPanel shared server. Like many developers would want to do, they wanted a quick way to restart Node.js app in cPanel, fix the bug that caused the crash, then restart Node.js app without downtime. Fortunately, PM2 came to the rescue with its app, and with auto-restart capabilities, it becomes easy to auto-restart Node.js app using PM2 and can run it smoothly without downtime. In this guide, we will show you how to use PM2 to fix Node.js app crashes in cPanel and keep your app online.
1. Log in to cPanel.
2. Go to the software section and click on the setup Node.js app.
3. You can click on the Restart button to relaunch the application. OR4. Edit the application environment created in cPanel by clicking the Edit option and copying the virtual environment URL.
5. Go to Terminal (under Advanced options), and paste the activation command
Step 1: Connect via terminal:Log on to your server using a terminal
Step 2: Check running apps with pm2 list:This command displays a list of all PM2-managed apps along with their status.
Step 3: Restart the app with pm2 restart app_nameReplace app_name with your app name or ID from the list.
Step 4: View logs with pm2 logs app_name:Check if the app restarted correctly and look for any errors.
Enable Auto-Restart on Reboot (Optional)Run pm2 startup
With Big Cloudy hosting, you can quickly restart your Node.js app in cPanel and keep it online without interruption. Our hosting platform fully supports PM2, allowing you to easily auto-restart Node.js apps using PM2 and keep them online. No more downtime—Big Cloudy gives you the tools that you need to fix Node.js app crashes in cPanel and run your projects 24/7.
Save my name, email, and website in this browser for the next time I comment.
Or copy link