Repolode
Unitech

Unitech/pm2

A production process manager for Node.js and Bun apps with a built-in load balancer, keeping processes alive and reloading them without downtime.

Stars
43,311
Forks
2,734
Open issues
1,109
Last commit
23 hours ago

What is it?

PM2 is a process manager for running Node.js and Bun applications in production. It keeps processes alive, restarts them after crashes, and can start and manage other programs such as Python scripts or binaries available on the PATH.

Its cluster mode launches multiple instances of a Node.js application and load-balances HTTP, TCP and UDP traffic across them, so an app can use all CPU cores. The reload command updates running applications without downtime. PM2 also provides terminal monitoring, log viewing and rotation, and can generate startup scripts for systemd, launchd and other init systems so processes restart with the server.

A dedicated runtime command, pm2-runtime, is designed for running apps inside Docker containers. PM2 runs on Linux, macOS and Windows, and supports Node.js 18+ and Bun 1+.

Key features

  • 01Keeps Node.js, Bun, Python and other processes running and restarts them after failures.
  • 02Cluster mode load-balances HTTP, TCP and UDP traffic across multiple instances.
  • 03Zero-downtime reload of running applications.
  • 04Terminal monitoring and centralized log viewing with JSON and formatted output.
  • 05Generates startup scripts for systemd, launchd and other init systems.

Use cases

  • Running a Node.js API in production on a single server and using all CPU cores.
  • Deploying apps to Docker containers with the pm2-runtime command.
  • Updating a live service without dropping connections during a release.
  • Keeping background services running across server reboots.

Quick start

  1. 1

    Install PM2 globally with npm

    npm install pm2 -g
  2. 2

    Start your application with PM2

    pm2 start app.js
  3. 3

    List running applications

    pm2 list

Things to know

  • Licensed under AGPL 3.0, a copyleft license; other licenses require contacting the maintainers.
  • Requires Node.js 18+ or Bun 1+.

Topics

FAQ

What is pm2?
A production process manager for Node.js and Bun apps with a built-in load balancer, keeping processes alive and reloading them without downtime. PM2 is a process manager for running Node.js and Bun applications in production. It keeps processes alive, restarts them after crashes, and can start and manage other programs such as Python scripts or binaries available on the PATH.
Is pm2 free to use? What license does it have?
pm2 is open source under the Other license. Check the license terms before using it in commercial products.
Is pm2 still maintained?
Actively maintained. The last commit to pm2 was on Oct 21, 2026.
What can I use pm2 for?
Running a Node.js API in production on a single server and using all CPU cores. Deploying apps to Docker containers with the pm2-runtime command. Updating a live service without dropping connections during a release. Keeping background services running across server reboots.
How do I install pm2?
Install PM2 globally with npm: npm install pm2 -g Start your application with PM2: pm2 start app.js List running applications: pm2 list
Where can I get pm2?
The source code and installation instructions are on GitHub: https://github.com/Unitech/pm2

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects