title: Node.js EACCES error when listening on http 80 port (permission denied)
body: <p>Node.js throws following error while running on http port 80 (default port):-</p>
  
  <pre><code>Error: EACCES, Permission denied
      at Server._doListen (net.js:1062:5)
      at net.js:1033:14
      at Object.lookup (dns.js:132:45)
      at Server.listen (net.js:1027:20)
      at [object Context]:1:3
      at Interface.&lt;anonymous&gt; (repl.js:150:22)
      at Interface.emit (events.js:42:17)
      at Interface._onLine (readline.js:132:10)
      at Interface._line (readline.js:387:8)
      at Interface._ttyWrite (readline.js:564:14)
  </code></pre>
  
  <p>I figured out that node needs to have root access.</p>
  
  <p>Conventionally we avoid giving root access in normal situation. What's the best practices for using it on port 80 (or port&lt;1024).</p>
  
  <p>This <a href="https://stackoverflow.com/questions/16573668/best-practices-when-running-node-js-with-port-80-ubuntu-linode">link</a> has the same question but it has only one answer i.e. PREROUTING. While my solution provides other ways as well.</p>
  
  <p>I am writing this to have all answers at one location, as I have to go thorough other resources than PREROUTING. Why not all answers at one location for sharing the knowledge</p>