Place UI in root and w/o port number

I have created a very simple "lights on/off" flow. For me, calling a url like http://home:1880/ui is fine to load the dashboard on my mobile phone. However for friends and family this is way too complicated. What they want is something like http://home and basta - no port number, no subdirectory.
I could of course have the index.html in the web server's root redirect to the appropriate address, but that would require me to install yet another webserver (like lighttpd) on my Raspberry Pi which I would like to avoid. The Pi's sole purpose is to run Node-Red.
Any ideas?

In order for it to be accessible without a port number like that, it needs to run on port 80. And for most operating systems, in order to open ports below 1000, the program needs to run as root. For node-red, running as root is strongly discouraged. In this case you're best of with using a webserver, for example nginx or lighttpd, to forward the ui endpoint to the root on port 80. When doing so, make sure to also forward the websocket communication, to prevent the connection between Node-RED and the dashboard from failing.

1 Like

There is a relatively simple way to achieve this and that is to install a web server that supports reverse proxy. Any of the web servers should do this. My preference would be NGINX or Caddy.

There are loads of tutorials about that will show you how to do it. Look up a tutorial that covers Node-RED ideally but if not at least covers proxy'ing "websockets" which the Dashboard (and other parts of Node-RED) uses extensively.

That will let you hide the gory details of the Node-RED mechanics.

Do remember though that you really should be using https if possible in order to protect both your server and your users. Caddy is especially good for that as it has direct links to Let's Encrypt and will manage certificates and renewals for you. But there are tools for NGINX too.


Thanks for your help. And also thanks for the hint for using Caddy. I will check this out.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.