Skip to content

Instantly share code, notes, and snippets.

@DykiSA
Last active April 13, 2020 05:19
Show Gist options
  • Save DykiSA/2397c4b00f579cf450e4fe9eb7d2c935 to your computer and use it in GitHub Desktop.
Save DykiSA/2397c4b00f579cf450e4fe9eb7d2c935 to your computer and use it in GitHub Desktop.
Setup PM2 - Realtime NodeJS service and monitoring

Install PM2 globally (if not yet installed)

npm i -g pm2

Registering and Startting an app

pm2 start --name '<appname>' <app_entrypoint>

Optional setup: Configure PM2 to run on startup

pm2 startup

Synchronize and save current state to be running on startup

pm2 save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment