Install PM2 globally
Enable PM2 on boot
Example ecosystem.config.js
Make sure to have this file in your project root before starting PM2.
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.