How to connect to nodered using raspberry pi hostname

Goal:
I would like to allow users to just type into their browser: <hostname> and automatically be directed to the nodered dashboard app I made.

Progress so far:
Nodered is running on a raspberry pi. I already changed my hostname, I have a static IP, and I added an entry of this static IP with my hostname to /etc/hosts.

I can ping <hostname> on my raspberry pi and get a response but I cannot ping that hostname from any other computer on the network and get a response.

Will it even be possible to append :1880/ui to my hostname so users do not have to type that in?

Thanks for the help.

I just found I can enter: hostname.local:1880/ui and that works!

However, is there a way to get rid of the .local:1880/ui? Maybe that involves something fancier like setting up a server to route traffic?

Hi @cuxcrider

When a browser is pointed at <hostname> it will attempt to access port 80. Via your Node-RED settings file you can change what port NR listens on. But for it to listen on port 80 as a normal user you will also need to grant it permission to do so. This SO post explains what to do - https://superuser.com/questions/710253/allow-non-root-process-to-bind-to-port-80-and-443 - you need to identify the path to the node binary by running which node - I can't remember where it is on a Pi install.

That will get you as far as <hostname>/ui to access the dashboard.

In the settings file you can uncomment the line for httpAdminRoot to move the Node-RED editor away from / - for example, set it to /admin. Finally, uncomment the ui setting and change the ui value to /.

Restart Node-RED and you should be there.

thanks, that was perfect and it's up and running.

To truly use just <hostname> I had to add a dns entry on our local server, but otherwise everything could be done on the pi.

The .local is typically provided by either your router or by Apple's Bonjour protocol running on the Pi.

There are doubtless several ways to get rid of it but all are relatively involved. For example, in order to make best use of Let's Encrypt, on my Pi I actually use a full domain name like pi.something.co.uk. This is set up on my router which allows such things - not all of them do.