-
-
Notifications
You must be signed in to change notification settings - Fork 1
Setup Notes
Daniel Kastl edited this page Jan 16, 2020
·
1 revision
Memo to setup PM2 to run the notification server
- Create user PM2 and set his password
sudo useradd -d /opt/pm2 -m -s /bin/bash pm2`
sudo passwd pm2
- Add users you want to provide the access to PM2 to PM2 group
sudo usermod -aG pm2 <username>
- Set the PM2_HOME variable
sudo touch /etc/profile.d/pm2.sh
sudo sh -c 'echo "export PM2_HOME=\"/opt/pm2/.pm2\"" > /etc/profile.d/pm2.sh'
source /etc/profile.d/pm2.sh
- Install the PM2
sudo npm install pm2 -g
- Make startup script
sudo pm2 startup ubuntu -u pm2 --hp /opt/pm2
sudo systemctl enable pm2-pm2 && \
sudo systemctl start pm2-pm2 && \
sudo systemctl status pm2-pm2
- Change permission of PM2_HOME
sudo chmod -v g+w /opt/pm2/.pm2
- Check the PM2
pm2 status