Start app as root with pm2

I had problems with sudo pm2 start api, but this was since pm2 was already running without sudo privileges, therefor you need to run:

pm2 kill
sudo pm2 start api

This kills the pm2 deamon first, so that it starts in sudo, but then you need sudo for ALL pm2 commands afterwards, like: sudo pm2 ls

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)