Skip to content

Instantly share code, notes, and snippets.

@vasilvix
vasilvix / nodejs-ubuntu-bind-port-80.md
Created June 26, 2022 12:50 — forked from chairco/nodejs-ubuntu-bind-port-80.md
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

<input id="address" name="address" type="text"/>
<input id="coordinates" name="coordinates" type="text"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/suggestions-jquery@20.3.0/dist/css/suggestions.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/suggestions-jquery@20.3.0/dist/js/jquery.suggestions.min.js"></script>
<script>
$('#address').suggestions({
token: 'DADATA_ТОКЕН_ПРИНА',