Avinish kumar
Avinish kumar

Reputation: 21

How to run a program in background?

I have a node.js application. I want to run it in the background without keeping the terminal always open.

How can I achieve this?

Upvotes: 0

Views: 303

Answers (2)

Aayush Mall
Aayush Mall

Reputation: 1013

You can use either PM2 process manager (https://www.npmjs.com/package/pm2)

Or You can use forever (https://www.npmjs.com/package/forever)

Or simply you can use nohup as

nohup node index.js &

This will run the node process in detached form in the background

Upvotes: 1

Justin12138
Justin12138

Reputation: 1

you need pm2.js;

goto PM2 Quick Start

Upvotes: 0

Related Questions