This guide walks you through the steps of running Node-RED on an Azure virtual machine instance.
Create a base image
Log in to the Azure console
Click to add a new… virtual machine
In the list of virtual machines, select Ubuntu Server and click Create
Give your machine a name, the username you want to use, and the authentication details you want to use to access the instance
Choose the size of your instance. Keep in mind that node.js is single-threaded, so there is no benefit in choosing a size with multiple cores for a simple node-red instance. A1 Basic is a great starting point
In the Settings step, click on the Network Security Group option. Add a new “Inbound Rule” with options set to:
Name: node-red-editor
Priority: 1010
Protocol:TCP
Destination port range: 1880
Click OK on the settings page, review the summary, and click OK to deploy the new instance
After a few minutes, your instance will be running.In the console you can find the IP address of your instance
Establecer Nodo-RED
La siguiente tarea es iniciar sesión en la instancia e instalar node.js y Node-RED.
Log in to your instance using the authentication details you specified in the previous stage.
Una vez conectado, tienes que instalar node.js y Node-RED
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs build-essential
sudo npm install -g -unsafe-perm node-red
En este punto, puede probar su instancia ejecutando node-red. NOTA: Es posible que reciba algunos errores relacionados con los nodos en serie.
Una vez iniciada, puedes conectarte en http://
Para que Node-RED se inicie automáticamente cuando se reinicie su instancia, puede utilizar pm2:
sudo npm install -g -unsafe-perm pm2
pm2 start `que nodo-rojo` - -v
pm2 guardar
pm2 puesta en marcha
NOTA: Este último comando le pedirá que ejecute otro comando - asegúrese de hacer lo que dice.
Palabras clave: Pasarela LoRa