Spring Fresh Sale! - Up To 67% OFF BDIX Hosting + Free Domain
Node.js

How to Keep a Node.js App Running on Webuzo with PM2

PM2 keeps your Node.js app running on Webuzo after you disconnect from SSH, restarts it automatically if it crashes, and can bring it back after a server reboot. Because Webuzo gives you SSH access, you can use PM2 properly — a big advantage over shared hosting where persistent processes are restricted.

Why you need a process manager

If you start your app with node app.js over SSH, it stops the moment you close the session. PM2 runs it as a managed background process that stays up and recovers from crashes.

Installing PM2

npm install -g pm2

Starting your app

pm2 start app.js --name myapp

The app now runs in the background. Useful commands: pm2 list shows status, pm2 logs streams output, pm2 restart myapp restarts it.

Surviving server reboots

Make PM2 relaunch your apps on boot:

pm2 startup

Run the command it prints, then save your current process list:

pm2 save

Now your app comes back automatically after a reboot.

Fitting into the Webuzo setup

PM2 keeps your app alive on its local port; OpenLiteSpeed proxies your domain to it. This pairing — PM2 for the process, OpenLiteSpeed for the front door — is the core of running Node on Webuzo. See also running Node in production with PM2 for clustering.

Frequently asked questions

Why does my app stop when I log out of SSH?

Because a foreground node process ends with your session. PM2 runs the app as a persistent background process that survives logout — which is exactly why you use it.

Will PM2 restart my app after a server reboot?

Yes, once you run pm2 startup (and the command it gives you) and pm2 save. That registers PM2 to relaunch your saved apps on boot.

Can PM2 use multiple CPU cores?

Yes — PM2 cluster mode (pm2 start app.js -i max) runs one instance per core. Keep shared state external (for example in Redis) since each instance has its own memory.

Was this article helpful?