Skip to main content
PM2 is the go-to process manager for Node.js. It restarts your app if it crashes, brings it back after a reboot, and gives you clean logs. Combine it with your Opus Host VPS and your app just stays online.

1. Install Node.js

2. Get your app onto the server

Clone from Git or upload via the File Manager:

3. Install PM2

4. Start your app with PM2

For apps with a start script in package.json:

5. Save and enable auto-start on reboot

Copy and run the sudo env PATH=... command that pm2 startup prints. That registers PM2 as a systemd service.

Common PM2 commands

Run multiple instances (cluster mode)

Use all available CPU cores automatically:

Environment variables

Create an ecosystem.config.js file for cleaner deploys:
Start with:
Put Nginx in front of your Node.js app as a reverse proxy so you can serve it on port 80/443 with HTTPS. See Nginx Reverse Proxy.