By default Node-RED binds to 0.0.0.0
which is the shortcut to say bind to all available interfaces (the log says to access via http://localhost:1880
because this will always be available). You should find that if you know the IP address of the machine running Node-RED and you enter http://ip-address:1880
from another machine on your LAN it should connect to the Node-RED editor.
You can change this bind address in the settings.js
file (found in the userDir which is logged early on when Node-RED starts and is by default in ~/.node-red
on a Linux/Unix machine). You can uncomment the uiHost
line and change the IP address to what ever the static IP address of your host machine is. Under 99.9% of circumstances you should not do this and just leave it as the default 0.0.0.0
As for how you set your device that is hosting Node-RED to have a fixed IP address, that will be entirely dependent on the type of router you have, but usual approach would be to set the routers built in DHCP server to just asign a static IP address to that device as identified by it's MAC address. This means that you do not need to change anything on the device.
It is unlikely you will be able (or want) to to run Node-RED actually on your router, most home (or enterprise) routers are specialist devices and running a programming environment like Node-RED on them is really not a good idea from a security point of view unless you 110% know what you are doing.
Speaking of security, make sure you enable adminAuth
in your settings.js
before setting up any port forwarding on the router to expose Node-RED to the outside world. An unsecured Node-RED editor is likely to be quickly scanned by something like Shodan and promptly ushttps://nodered.org/docs/user-guide/runtime/securing-node-reded to host Crypto mining or much worse. Read the following carefully https://nodered.org/docs/user-guide/runtime/securing-node-red