Run node apps on port 80 without Root permissions
Published 4 years and 9 months ago, Categorized under: Code, Linux

Most of us run the node apps under the root user, so last time I talked about using IPTables to do some tricks which will route the requests from port 80 to port 8080.

Today I was able to do so without IPTables , and you can run this command with SUDO to give node the ability to use the port 80 :

sudo apt-get install libcap2-bin
sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\``

I used it on Ubuntu 16.04 and it worked like a charm.

PS: I noticed that the command was not clear so I need to put it in an image

Share It via: