Deploy Node.js services on a VPS and automatically restart them if they crash or the server reboots.
Run multiple instances of your app across all CPU cores with automatic load balancing between them.
Update your application to a new version without dropping any active user connections.
Manage logs from multiple running app instances in one place with automatic rotation to prevent disk overflow.
PM2 is a production-grade process manager for Node.js and Bun applications. Its core job is to keep your applications running reliably in a server environment: if a process crashes, PM2 automatically restarts it. Beyond simple crash recovery, it provides the operational tooling that production deployments actually need. The most important capability is cluster mode. PM2 can launch multiple instances of a Node.js application to take advantage of all CPU cores on the server, acting as a built-in load balancer that distributes incoming requests across those instances. When you need to deploy a new version, PM2 supports zero-downtime reloads by cycling instances one at a time so traffic is never interrupted. It handles application logs by aggregating output from all instances and rotating log files automatically so they do not fill the disk. PM2 also provides a startup generator that creates a system-level service definition for your OS, meaning your applications will restart automatically after a server reboot without any manual intervention. You can manage the full lifecycle of multiple applications at once using a single ecosystem configuration file that describes each app, its entry point, environment variables, cluster settings, and watch patterns. You would reach for PM2 when deploying Node.js services directly on a VPS or bare metal server, as opposed to a containerized environment where an orchestrator like Kubernetes handles restarts. It is particularly common in setups where the operational overhead of containers is not justified. The tool is written in JavaScript and is installed as a global npm package, making it straightforward to add to any Node.js deployment workflow.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.