Zaher Ghaibeh
PHP Backend developer
I've experience in a few PHP Frameworks, such as Laravel, Lumen and Slim (The last two are used for building Microservices/API services).
Run node apps on port 80 without Root permissions
Published at Friday, October 21, 2016 , 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