PM2
In-depth entryby Keymetrics (Unitech) · CLI tool · also known as pm2, PM2 Process Manager
Production process manager for Node.js and other long-running programs with cluster mode, log handling, restart policies and boot-time startup scripts
Overview
PM2 is an open-source process manager, published by Keymetrics under the AGPL-3.0 license, that keeps server applications running: it starts them, restarts them on crash or memory limit, rotates and tails their logs, and generates startup scripts so processes return after a reboot. Although written for Node.js, it supervises any executable, including Python, shell and binary programs, through its ecosystem configuration file.
Its distinctive feature is cluster mode, which forks a Node.js application across all CPU cores behind a shared port and allows zero-downtime reloads. An ecosystem file (JavaScript, JSON or YAML) declares every process with environment variables, working directory, instance count and log paths, so a server's full set of services can be versioned and brought up with a single pm2 start. The pm2 startup command writes a systemd or launchd unit, and pm2 save persists the current process list. A companion SaaS, PM2 Plus and PM2 Enterprise at pm2.io, adds remote monitoring and metrics on a subscription basis; the CLI itself needs no account.
PM2 suits small and medium deployments where a handful of services run directly on a host rather than inside containers, which is common on VPSs and in homelab or Mac-mini clusters. It does not isolate processes, manage dependencies or schedule across machines; those jobs belong to containers or an orchestrator. The AGPL license and the Node.js runtime requirement are worth noting for redistribution and minimal servers.
Capabilities
- Supervise and auto-restart processes with crash, memory and cron-based policies
- Cluster mode that load-balances a Node.js app across CPU cores with zero-downtime reload
- Ecosystem configuration file describing many processes and environments
- Log aggregation, rotation (module) and real-time tailing
- Startup script generation for systemd, launchd and other init systems
- Deployment helper for pulling and restarting from a git remote
- Optional remote monitoring through PM2 Plus
Typical workflows
- Keep several web services alive on one Linux or macOS host
- Reload a Node.js API across cores without dropping connections
- Register all services so they return automatically after a reboot
- Tail and rotate logs for a fleet of scripts
Strengths
- Very small learning curve for Node.js developers
- Runs on macOS and Linux without containers
- Single file describes an entire host's processes
- Mature project with long release history
Limitations
- AGPL-3.0 license has obligations for modified redistributions
- No isolation or dependency management between processes
- Single-host only; no scheduling across machines
- Requires a Node.js runtime even for non-Node programs
Prerequisites
- Node.js runtime
- Shell access to the host
Who it is for
- Node.js developers
- Operators of small VPS or on-premises fleets
- Researchers running long-lived services on workstations
Alternatives & comparison
launchd (macOS) and systemd (Linux) are the native supervisors and need no runtime, but lack cluster mode, unified logs and a cross-platform CLI. Docker restart policies supervise containers rather than bare processes and add isolation at the cost of an image build step. Kubernetes handles the same restart and scaling concerns across a cluster and is the step up once services span many hosts.
- Docker
Container platform combining the Docker Engine runtime, the Compose and Build tooling, Docker Desktop for macOS and Windows, and the Docker Hub registry
MixedOpen source - Kubernetes
Open-source system for scheduling, scaling and operating containerized workloads across a cluster of machines
Open sourceOpen source - launchd
macOS's built-in service manager that starts, supervises and schedules daemons and per-user agents from property-list job definitions
ProprietaryFree
Sources & verification
Primary sources consulted for this record. Claims are tied to the fields each source supports; the automated link checker re-verifies every URL on a schedule.
- LicensePM2 license (GNU AGPL-3.0)checked Nov 1, 2026
https://github.com/Unitech/pm2/blob/master/GNU-AGPL-3.0.txt
Supports: license_spdx, source_model
- Official documentationPM2 Quick Startchecked Nov 1, 2026
https://pm2.keymetrics.io/docs/usage/quick-start
Supports: capabilities, workflows, prerequisites
- Official sitePM2 - Advanced Production Process Manager for Node.jschecked Nov 1, 2026
https://pm2.keymetrics.io/
Supports: name, summary, capabilities
- Pricing pagePM2 Plus pricingchecked Nov 1, 2026
https://pm2.io/pricing
Supports: pricing_model
Pricing concerns the optional PM2 Plus/Enterprise monitoring service, not the CLI.
- Confidence
- High
- Reviewed
- Nov 1, 2026
- Links
- Verified · Nov 2, 2026
Spotted an error?
More in Infrastructure & provisioning
Ansible
Red Hat (Ansible community) · Infrastructure & provisioning
Agentless configuration management and orchestration tool that runs YAML playbooks over SSH, with collections for clouds, network gear and applications
Slurm Workload Manager
SchedMD LLC · Distributed & parallel computing
Open-source cluster resource manager and job scheduler for Linux clusters, allocating nodes, launching jobs and managing queues on many HPC systems
Terraform
HashiCorp (an IBM company) · Infrastructure & provisioning
Infrastructure-as-code tool that provisions cloud and SaaS resources from HCL configurations through a plan-and-apply workflow, licensed under BSL 1.1
OpenTofu
Linux Foundation (OpenTofu project) · Infrastructure & provisioning
Community fork of Terraform under the Linux Foundation, keeping the HCL language, provider ecosystem and state model under the MPL-2.0 license