Run on port 80
-
Find the linked Node binary:
which node -
Find the real Node binary:
readlink -f /run/user/1000/fnm_multishells/2076_1764275467596/bin/nodeYou should get something like:
/home/youruser/.fnm/node-versions/v22.0.0/installation/bin/node -
Give that binary permission to bind to low ports:
sudo setcap 'cap_net_bind_service=+ep' /home/youruser/.fnm/node-versions/vXX.XX.X/installation/bin/node(replace the path with what you got from
readlink -f) -
Verify:
getcap /home/youruser/.fnm/node-versions/vXX.XX.X/installation/bin/node # should output: cap_net_bind_service=ep -
Now run Next.js as a normal user:
PORT=80 npm run dev # or npx next dev -p 80
Notes:
- If you install a new Node version via
fnm, repeat thesetcapfor that version'snodebinary. - You must run
setcapon the actual binary, not the/run/user/...symlink.