Hi, I'm on ubuntu running version 2.4.6 of pm2 and using node 4.4.5. I want to set up pm2 to restart my node.js application whenever it crashes, but I'm running into trouble when starting the server. I type sudo pm2 start server.js to start the server on port 443. When I type pm2 list in the terminal, it says it's in an errored state and gives me this error: Error: listen EACCES 0.0.0.0:443 which is what I get when I don't run the server as root, because you need to be root to use ports lower than 1024. Can you please tell me how to start the server as root using pm2? Thanks!
Its documented right there : http://pm2.keymetrics.io/docs/usage/specifics/#listening-on-port-80-w-o-root
You can also use sudo setcap cap_net_bind_service=+ep /path/to/node to allow the node binary to bind the port itself.
Still being put into an errored state after following the authbind commands. Replaced 80 with 443 but still no dice. Finding this in the error log:
Error: listen EACCES 0.0.0.0:443
Hi, I am having this same issue. Followed the docs, but it doesn't work....
Most helpful comment
Still being put into an errored state after following the authbind commands. Replaced 80 with 443 but still no dice. Finding this in the error log:
Error: listen EACCES 0.0.0.0:443