I created an account for the whole purpose of describing the steps on how to properly set the Node-RED using SSL on your Home Assistant, after wasting a couple of hours researching for the right documentation. Like other post was mentioning already, the steps make sense for an experienced user who knows where to look, however, for a person who has just started playing with Linux, Home Assistant, Docker etc it’s been quite challenging to figure it out.
Using Home Assistant Supervised on a stand-alone Debian 11 linux machine:
-
In Home Assistant “Settings” click on “Addons”
-
Search for the “Node-RED” addon
-
Install the “Node-RED” addon. - Do not start it yet!
-
SSH into your Linux machine
-
Navigate to location (in my case was) /usr/share/hassio/homeassistant ( run cli command ls -lrt to display a list of files and folders in the homeassistant directory). There should be a folder named node-red . cd to the node-red directory
-
Within the node-red directory, create the SSL cert and key: Run the below command:
openssl req -sha256 -newkey rsa:4096 -nodes -keyout privkey.pem -x509 -days 730 -out certificate.pem
Once the command has run, and followed the on-screen prompts, you should have the certificate.pem and privkey.pem in the Node-RED directory
-
Return to Home Assistant WebUI, go to Configuration tab and fill in the blanks (certfile with certificate.pem, credential_secret, keyfile with privkey.pem
-
Enable the ssl option
-
Click Save
-
Go to Info tab and click Start followed by Open Web UI
-
Now you should have Node-RED working!