Search code examples
node.jspm2

Can the pm2 node module restarts the app after crash automatically


I have a Node.js app ready which is workable, but has known and unknown bugs which crash the app. In such cases it would be nice if pm2 can restart the node app. Is this feature already available in pm2?


Solution

  • Yes, it does this by default. For more information see Restart strategies.

    If the app repeatedly fails to start over a short period of time, pm2 may cease restarting. See configuration, min_uptime and max_restarts.