Experience of installing Node-Red on Android using termux from F-Droid:
(This is a more in-depth writeup. The below is just my experience of doing it...)
1/ Download F-Droid from the original website, and chrome should ask if you want to install it.
2/ In F-Droid, search Termux. Install the one just called 'Termux'. (at the point of installation, my random Android on some chinese tablet asked me to authorise F-Droid to install things...).
3/ since I will try to run node-red at boot, I also installed Termux:boot - this prompted 'Harmfull app blocked', but you can then 'install anyway'.
4/ open termux.
5/ to make things easier, install openssh (I read here):
apt update
apt upgrade
apt install openssh
set a password, then run sshd:
passwd
type pwd twice
sshd &
ifconfig
now you can ssh in to cut & paste more easily..
5/ Install node-red:
ssh into your new android device at IP:8022 - use root and the pwd entered above.
apt install coreutils nano nodejs
npm i -g --unsafe-perm node-red
run node-red to test:
node-red
Check you can get to it from the outside, and then use ctrl-C to kill it.
5/ IF you want to start at boot:
Run termux:boot once - it claims start on boot rights the first time you run it.
termux:boot runs scripts in ./termux/boot/ - create this folder.
for SSH,. I created ./termux/boot/10-ssh.sh containing:
#!/data/data/com.termux/files/usr/bin/sh
termux-wake-lock
sshd
for node-red, I created ./termux/boot/20-nr.sh containing:
#!/data/data/com.termux/files/usr/bin/sh
node /data/data/com.termux/files/usr/bin/node-red
NOTE: The shebang in the installed start script 'node-red' is incompatible with termux:boot - for the explanation see here. The above command line apparently overides that, and so works.
6/ Reboot your android device, and confirm that you can access both ssh and node-red.
(I did this on a chinese Teclast T10 tablet (Android 7) with 4G ram and 64G flash - and may likely use it as a pre-configured backup Node-Red as a standby for my Rpi. As well as a browser interface bolted to the wall home control).
br,
Simon