Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Package created
8 Jun 2013
Version published
20 Jan 2024
Total deps
Direct deps
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does pm2 do?

PM2 is a critical production process manager for Node.js applications, complete with a built-in load balancer. It's designed to affordably keep applications alive indefinitely, reload them with no downtime, and simplify routine system admin tasks. It operates on Linux, macOS, and Windows, supporting all Node.js versions starting from Node.js 12.X.

How do you use pm2?

To utilize PM2, start by installing it via NPM with the command:

$ npm install pm2 -g

Kickstart an application by using the "pm2 start" command followed by the application name. For instance:

$ pm2 start app.js

This then daemonizes your application, where it's monitored and consistently kept alive.

For managing your applications, PM2 provides a variety of commands. To list all current running applications, use:

$ pm2 list

For starting, stopping, restarting, or deleting an application, you can use "pm2 stop", "pm2 restart", or "pm2 delete" respectively, followed by the application name, namespace, id, 'all', or json config:

$ pm2 stop <app_name|namespace|id|'all'|json_conf>
$ pm2 restart  <app_name|namespace|id|'all'|json_conf>
$ pm2 delete   <app_name|namespace|id|'all'|json_conf>

For in-depth information on a particular application:

$ pm2 describe <id|app_name>

To monitor logs, custom metrics, and application information, you install the following module:

$ pm2 install pm2-logrotate

And then type the command:

$ pm2 logs

To enable log rotation or execute a hot reload, you simply input "pm2 reload all".

Where are the pm2 docs?

For complete PM2 documentation, you can visit the official website https://pm2.keymetrics.io/, which is also the destination for more information about Process Management, Cluster Mode, Container Support, Monitoring, Log Management, Startup Scripts Generation, and PM2+ Monitoring. Keep your Node.js applications smoothly running with the versatile, easy-to-use PM2.