Skip to main content

Install PM2 globally

Enable PM2 on boot

Example ecosystem.config.js

Make sure to have this file in your project root before starting PM2.
Give each app a unique error_file / out_file path. Duplicate log paths across apps will cause PM2 to write mixed/garbled logs.

Common commands

Since PM2 was installed via nvm-managed npm, it lives under the same Node version’s global path. If you switch the default Node version with nvm alias default, reinstall PM2 globally under the new version or PM2 commands may stop resolving.