Displaying Node-RED UI in Home Assistant without add-on?

Hi folks,

I’d like to display the Node-RED UI inside the Home Assistant UI a similar fashion how the hass.io add-on displays it.

Let me explain - I am using docker-based Home Assistant, thus add-ons are not an option. Instead of exposing multiple ports from my router to the outside world, I’d prefer to only expose Home Assistant, and let it proxy the Node-RED UI. I am running HACS, so am okay with custom components. If the solution is generic and can be used for other apps, such as Zigbee2MQTT or AppDaemon, it would be great. All these live on the same host as Home Assistant.

Is this please possible?

Thank you very much!

Try the iframe Panel integration

Thank you Mauricio for the suggestion, unfortunately an iframe wouldn’t work for me when connecting to Home Assistant from outside of my local network, where the rest of the services are not exposed. I believe I need a proxy on the server side. Not sure if such a thing is available or even a good idea though.

I have the same scenario here. Home Assistant is the only system exposed to the internet, everything else I access through a VPN.

I run Home Assistant container and Node Red container and access the Node Red UI outside the network through a reverse proxy. I use the SWAG/NGINX reverse proxy and since you are already using docker, you would be able to as well.

With the reverse proxy, you only expose ports 80 and 443 and not all the individual ones for Home Asssistant and Node Red (ie no need to expose ports 1880 or 8123 through the router with a reverse proxy).

You can create subdomains and access all these things as well with a reverse proxy. I also use the reverse proxy to access the UI for zigbee2MQTT outside the network as well.

Instructions to setup the SWAG proxy are on this thread

Once you have the reverse proxy setup, the iframe panel mentioned above would work to display the Node Red dashboard in Home Assistant by using the external proxy’s address for Node red - ie https://nodered.yourdomain.duckdns.org. Prior to exposing the Node Red UI to the web, be sure to setup a password to secure access the editor’s UI page.

Also here are the NGINX proxy configs to setup Node Red access. I have separate ones to expose the endpoints and/or the UI so you can do either or both as needed:

################################################################################
### SUBDOMAIN 1a Node Red Admin#################################################
server {
	listen 443 ssl;

	root /config/www;
	index index.html index.htm index.php;

	server_name nodered.yourdomain.duckdns.org;
	
	include /config/nginx/ssl.conf;

	client_max_body_size 0;

	location / {
#		auth_basic "Restricted";
#		auth_basic_user_file /config/nginx/.htpasswd;
		include /config/nginx/proxy.conf;
		proxy_pass http://yourIPhere:1880;
	}
}

################################################################################
### SUBDOMAIN 1b Node Red Endpoints##############################################
server {
	listen 443 ssl;

	root /config/www;
	index index.html index.htm index.php;

	server_name noderedend.yourdomain.duckdns.org;
	
	include /config/nginx/ssl.conf;

	client_max_body_size 0;

	location / {
#		auth_basic "Restricted";
#		auth_basic_user_file /config/nginx/.htpasswd;
		include /config/nginx/proxy.conf;
		proxy_pass http://yourIPhere:1880/endpoint/;
	}
}

If you do an IFRAME and use a VPN, the local IFRAME address should work to point to the local Node Red instance as well when the VPN is on, if you want to go that route instead of a reverse proxy. The VPN will be more secure but access will only work on machines you setup the VPN on, versus the reverse proxy which allows access from any machine. I wroteup a post about setting up Wireguard container if you want a VPN

1 Like

Thanks a ton Mauricio and Tim, this was exactly what I was looking for! I was thinking I will have to decide between the proxy and VPN, but reading through your article, I might as well go with both. Very helpful, thanks again!

1 Like