Skip to content

PM2

Medium — good to knowBackend

ELI5 — The Vibe Check

PM2 is the most popular process manager for Node.js. It keeps your app alive, restarts it when it crashes, and can run multiple copies across all your CPU cores. It's the 'set it and forget it' of Node.js deployment. Also has a nice dashboard.

Real Talk

PM2 is a production-grade process manager for Node.js applications with a built-in load balancer. It provides zero-downtime reloads, log management, startup scripts, cluster mode for multi-core utilization, and a monitoring dashboard. It can also manage non-Node processes like Python scripts.

Show Me The Code

# Start with cluster mode (all CPU cores)
pm2 start app.js -i max

# Monitor processes
pm2 monit

# Zero-downtime reload
pm2 reload app

When You'll Hear This

"PM2 cluster mode spreads our app across 8 CPU cores automatically." / "Set up PM2 startup so the app survives server reboots."

Made with passive-aggressive love by manoga.digital. Powered by Claude.