pm2 and forever command for beginnners

pm2 and forever command for beginnners

pm2 and forever is a tool to run the process at the background, many of the angular developers are using these tools nowadays in any linux/amazon ec2 machines for angular universal server side rendering(ssr) for seo and many other features.


Herewith I have listed the few mostly used commands:

pm2 commands:

pm2 start your_js_file (pm2 start local.js) in my case for angular universal run,

this build is created using the below commands,

npm run build:prod (or) yarn run build:prod 


npm run server (or) yarn run server


pm2 list: list down all the pm2 processes.

pm2 kill: to kill all the running pm2 processes

pm2 monit: to monitor the running processes

pm2 logs: to see the logs of the running pm2 processes.

pm2 start all: to start all the pm2 process

pm2 start your_pm2_process_name: to start the particular pm2 process.

pm2 stop your_pm2_process_name: to stop the particular process. pm2 kill can be used to stop all the running pm2 processes.

pm2 show your_pm2_process_name: to show the details about this particular pm2 process.



Forever commands:

forever local.js (runs directly)

forever show

forever start local.js (runs in daemon mode)

482 total views, 2 views today

About Mirthbees 679 Articles
Blogger, Innovator, Developer and Enterpreneur. Founder of GuruRecharge, Readymade online recharge script. Lead Developer in

Be the first to comment

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.