PureDevOps Community

How to start pm2 process as non-privileged user to run an app on port 80 or 443

For example , i had planned to start python3 app as pm2 service and it should be running in port 80 below are the steps i followed

sudo apt-get install authbind
sudo touch /etc/authbind/byport/80
sudo chown gitlab-runner /etc/authbind/byport/80
sudo chmod 755 /etc/authbind/byport/80

vi /home/gitlab-runner/.bashrc
+alias pm2='authbind --deep pm2'


logout and login back and start the pm2 server as below.

authbind --deep pm2 start /opt/qcontroller/server/main.py --interpreter python3