install node red on ubuntu or variant + setup secure

 

Install NODE.js and npm

optional to upgrade npm:

Install node RED

If need external access add port forward at 1880

reference:
http://nodered.org/docs/getting-started/installation.html

https://www.digitalocean.com/community/tutorials/how-to-connect-your-internet-of-things-with-node-red-on-ubuntu-16-04

Secure node red access

uncomment:

generate hash pw with:

Reference :
http://nodered.org/docs/security.html

Secure dash UI access

uncomment:

generate hash pw with:

reference:

https://github.com/node-red/node-red-dashboard/blob/master/README.md

http://nodered.org/docs/security.html

SSL & Let’s encrypt on ddns acount

port forward on your router to your local ip computer where you run node-red: refer to your router user manual

install light web server if you don’t have one installed (need only to setup let’encrypt cert) NB: you can use also ngix proxy solution see below)

certboot install:

var/www/html/ with the proper dir of your installed server and yoursite.ddns.net with your site

result must be somethin like this:

the cert are stored at:

result:

or

copy cert1.pem privkey1.pem to your .node-red directory

on settings.js uncomment

and

add cron to renew your cert:
test if renew work

add in cron (see reference)

reference:

https://www.hardill.me.uk/wordpress/2015/05/11/securing-node-red/

http://nodejs.org/api/https.html#https_https_createserver_options_requestlistener

https://certbot.eff.org/#ubuntuxenial-other

https://help.ubuntu.com/community/lighttpd

How to Schedule Tasks on Linux: An Introduction to Crontab Files

 

Proxy with NGInX

( if need to uninstall lighttpd this also stop service)

check if lighthttp is stoped

reboot

install NGInX

 

Reference:

https://www.digitalocean.com/community/tutorials/how-to-connect-your-internet-of-things-with-node-red-on-ubuntu-16-04

https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-16-04