Okay so we want to set up node red on our proxmox 8.0.3 so here you will learn how to do it also you will make small script that you can use to manage updates of your node.
Some good resources could be found in here:
- https://nodered.org/docs/getting-started/raspberrypi
- https://tronics.life/updating-node-red-npm-and-node-js/’
1. Go to first link and try to follow in my case i’m using debian so some comands are a bit diferent.
2. Create a new LXC container with debian
3. apt install build-essential git curl
npm
4. npm update -g npm cache clean -f npm install –g npm
5. npm install -g -unsafe-perm node-red node-red-restart
After this node should generate setting file my one was in
/root/.node-red/settings.js
In there you can change you’re auth type. By default is public.
And gratis autoupdate script to update container from proxmox lvl
# Get the vm list
vms="$(lxc-ls --active)"
# Update mosquito
update_vm(){
local vm="$1
echo "*** [VM: $vm [$(hostname) @ $(date)] ] ***"
lxc-attach -n "$vm" apt-get -- -qq update
lxc-attach -n "$vm" apt-get -- -qq -y upgrade
lxc-attach -n "$vm" apt-get -- -qq -y clean
lxc-attach -n "$vm" apt-get -- -qq -y autoclean
lxc-attach -n "$vm" nod-red-stop
lxc-attach -n "$vm" npm -- update -g
lxc-attach -n "$vm" npm -- cache clean -f
lxc-attach -n "$vm" npm install -- --g npm
lxc-attach -n "$vm" npm install -- -g -unsafe-perm node-red
lxc-attach -n "$vm" node-red-restart
lxc-attach -m "$vm" systemctl status nodered
echo "-----------------------------------------------------------------"
}
update_vm 103