What is PM2 PM2 is a free open source, advanced, efficient and cross-platform production-level process manager for Node.js with a built-in load balancer. It works on Linux, MacOS as well as Windows. It supports app monitoring, efficient management of micro-services/processes, running apps in cluster mode, graceful start and shutdown of apps. It keeps your apps “alive forever” with auto restarts and can be enabled to start at system boot, thus allowing for High Availability (HA) configurations or architectures Why to Use PM2 Assume you have a micro service in node js ( ) running on port 7890. server.js http = ( ); hostname = ; port = ; server = http.createServer( { res.statusCode = ; res.setHeader( , ); res.end( ); }); server.listen(port, hostname, () => { .log( ); }); const require 'http' const '192.168.43.31' const 7890 const ( ) => req, res 200 'Content-Type' 'text/plain' 'This is the Main App!\n' console `Server running at http:// : /` ${hostname} ${port} The above code will run on server after executing node server.js command. But what if something crashes in this API. We need to restart it manually by executing the same command line. Here PM2 comes to rescue by restarting the node api automatically. You will not run your app as root; therefore, your app will be more secure. Your application will restart if it crashes, and it will keep a log of unhand led exceptions. Your application will restart when the server starts — i.e. it will run as a service. How to Do It Use npm to install process manager for Node.js using following command. This will install latest version of pm2 on your system. npm install pm2@latest -g Now start your node API by simply executing the following command. pm2 start server.js # Specify an app name pm2 start server.js --name <app_name> Managing The Process Managing application state is simple here are the commands: $ pm2 restart app_name $ pm2 reload app_name $ pm2 stop app_name $ pm2 app_name delete List the status of all application managed by PM2: $ pm2 [list|ls|status] To display logs in realtime. $ pm2 logs PM2 Cluster Mode The allows networked Node.js applications (http(s)/tcp/udp server) to be scaled accross all CPUs available, without any code modifications. This greatly increases the performance and reliability of your applications, depending on the number of CPUs available. cluster mode Under the hood, this uses the Node.js such that the scaled application’s child processes can automatically share server ports. cluster module To enable the , just pass the option: cluster mode -i pm2 start server.js -i max means that PM2 will auto detect the number of available CPUs and run as many processes as possible max So i think you got a basic idea about pm2 and how to use it. Please refer the below url for further informations. https://pm2.keymetrics.io/