PM2

No Change
trial
First Added:May 28, 2026 Updated: July 2, 2026

PM2. Is a production process manager for Node.js and Bun with a built-in load balancer.

Summary

Garden stance: We trial PM2 for our estate.

When to use: Evaluate on a project when the capability clearly fits the requirement.

When to skip: When a simpler alternative already covers the need.

Details

FeatureNotes
Process controlpm2 start, stop, restart, reload, delete; list with pm2 ls
Cluster mode-i max or a fixed instance count; use reload (not restart) for zero-downtime
Logspm2 logs, rotation via pm2-logrotate; files under ~/.pm2/logs
Monitoringpm2 monit for CPU, memory, and request stats in the terminal
Boot persistencepm2 save plus pm2 startup generates OS startup hooks
Containerspm2-runtime replaces node as PID 1 friendly foreground runner
DeployBuilt-in multi-host deploy (Git-based); lighter than Capistrano but overlaps

12-factor fit: aligns with disposability and logs-as-streams from 12 Factor App. Pair with env-based config, not checked-in secrets.

PM2+: optional hosted monitoring from the Keymetrics team. The open-source runtime stands alone without a subscription.

Alternatives: Docker plus Compose or Swarm for packaging and restart policy. Kubernetes for multi-node scheduling. Plain systemd units when you want no extra dependency and only one or two services.

References