PM2 alternatives and similar modules
Based on the "Process Management" category.
Alternatively, view PM2 alternatives based on common mentions on social networks and blogs.
Nodemon.io9.5 8.8 L5 PM2 VS Nodemon.ioMonitor for any changes in your node.js application and automatically restart the server - perfect for development
forever8.9 0.0 L5 PM2 VS foreverA simple CLI tool for ensuring that a given script runs continuously (i.e. forever)
Supervisor8.4 3.2 L2 PM2 VS SupervisorSupervisor process control system for Unix (supervisord)
Phusion Passenger7.5 0.0 L2 PM2 VS Phusion PassengerA fast and robust web server and application server for Ruby, Python and Node.js
supervisor7.0 0.0 PM2 VS supervisorRestart scripts when they crash or restart when a *.js file changes.
node-windows6.6 5.6 PM2 VS node-windowsWindows support for Node.JS scripts (daemons, eventlog, UAC, etc).
God6.5 0.0 L4 PM2 VS GodRuby process monitor
naught4.8 0.0 L5 PM2 VS naughtZero downtime deployment for your Node.js server using builtin cluster API
node-mac4.3 0.0 PM2 VS node-macNode utilities for Mac
node-linux4.1 0.0 PM2 VS node-linuxCreate native background daemons on Linux systems.
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of PM2 or a related project?
P(rocess) M(anager) 2 Runtime Edition
PM2 is a production process manager for Node.js applications with a built-in load balancer. It allows you to keep applications alive forever, to reload them without downtime and to facilitate common system admin tasks.
Starting an application in production mode is as easy as:
$ pm2 start app.js
PM2 is constantly assailed by more than 1800 tests.
Official website: https://pm2.keymetrics.io/
Works on Linux (stable) & macOS (stable) & Windows (stable). All Node.js versions are supported starting Node.js 12.X.
$ npm install pm2 -g
You can install Node.js easily with NVM or ASDF.
Start an application
You can start any application (Node.js, Python, Ruby, binaries in $PATH...) like that:
$ pm2 start app.js
Your app is now daemonized, monitored and kept alive forever.
Once applications are started you can manage them easily:
To list all running applications:
$ pm2 list
Managing apps is straightforward:
$ 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>
To have more details on a specific application:
$ pm2 describe <id|app_name>
To monitor logs, custom metrics, application information:
$ pm2 monit
Cluster Mode: Node.js Load Balancing & Zero Downtime Reload
The Cluster mode is a special mode when starting a Node.js application, it starts multiple processes and load-balance HTTP/TCP/UDP queries between them. This increase overall performance (by a factor of x10 on 16 cores machines) and reliability (faster socket re-balancing in case of unhandled errors).
Starting a Node.js application in cluster mode that will leverage all CPUs available:
$ pm2 start api.js -i <processes>
<processes> can be
-1 (all cpu minus 1) or a specified number of instances to start.
Zero Downtime Reload
Hot Reload allows to update an application without any downtime:
$ pm2 reload all
More informations about how PM2 make clustering easy
With the drop-in replacement command for
pm2-runtime, run your Node.js application in a hardened production environment.
Using it is seamless:
RUN npm install pm2 -g CMD [ "pm2-runtime", "npm", "--", "start" ]
Read More about the dedicated integration
Host monitoring speedbar
PM2 allows to monitor your host/server vitals with a monitoring speedbar.
To enable host monitoring:
$ pm2 set pm2:sysmonit true $ pm2 update
Terminal Based Monitoring
Monitor all processes launched straight from the command line:
$ pm2 monit
To consult logs just type the command:
$ pm2 logs
Standard, Raw, JSON and formated output are available.
$ pm2 logs APP-NAME # Display APP-NAME logs $ pm2 logs --json # JSON output $ pm2 logs --format # Formated output $ pm2 flush # Flush all logs $ pm2 reloadLogs # Reload all logs
To enable log rotation install the following module
$ pm2 install pm2-logrotate
Startup Scripts Generation
PM2 can generate and configure a Startup Script to keep PM2 and your processes alive at every server restart.
Init Systems Supported: systemd, upstart, launchd, rc.d
# Generate Startup Script $ pm2 startup # Freeze your process list across server restart $ pm2 save # Remove Startup Script $ pm2 unstartup
More about Startup Scripts Generation
# Install latest PM2 version $ npm install [email protected] -g # Save process list, exit old PM2 & restore all processes $ pm2 update
PM2 updates are seamless
If you manage your apps with PM2, PM2+ makes it easy to monitor and manage apps across servers.
Feel free to try it:
Discover the monitoring dashboard for PM2
Thanks in advance and we hope that you like PM2!
PM2 is made available under the terms of the GNU Affero General Public License 3.0 (AGPL 3.0). For other licenses contact us.
*Note that all licence references and agreements mentioned in the PM2 README section above are relevant to that project's source code only.