Node-RED is what happens when you give an engineer a canvas instead of a code editor: wire a message source to a transform to a database to a chart, deploy, and watch it run. It is the fastest path from machines that publish data to people who can see it. This post follows a plant engineer building a factory dashboard with Node-RED on MassiveGRID PaaS, which is built on Virtuozzo Application Platform, formerly Jelastic, and then doing the unglamorous work of making it production-grade.
The plant belongs to a precision-machining company we will call Kestrel Precision: twelve CNC machines with gateways that publish state and spindle data over MQTT to a Mosquitto broker already on the company's PaaS account. The Node-RED Dev package deploys Node-RED on a Node.js container with persistent flows, editor authentication and HTTPS.
The afternoon: four flows
- Ingest. An MQTT-in node subscribes to
plant/+/stateandplant/+/spindleon the broker's internal hostname. A function node normalises the gateways' two slightly different JSON shapes into one. - Store. A PostgreSQL node, added to the environment from the topology wizard, receives each reading through the community PostgreSQL palette node; a table per signal with a timestamp index. Inserts are batched every five seconds to keep the database happy.
- Show. The Node-RED dashboard palette renders a page per machine: current state, spindle load gauge, an hourly utilisation chart from a PostgreSQL query node. The dashboard is served on the same HTTPS domain as the editor, on a path.
- Alert. A machine that reports fault or goes silent for five minutes triggers a flow that posts to the maintenance team's chat channel and, during night shift, sends an SMS through an HTTP request to the company's SMS provider.
By 17:00 the plant manager was looking at twelve machines on a screen for the first time. Everything so far is Node-RED's own strength. What follows is the platform's.
Making it not a development environment
The package is labelled Node-RED Dev, and the engineer treats the label as a checklist rather than a warning.
- Credentials. The editor login set at install is changed to a strong password and Node-RED's credential secret is pinned in its settings file so the encrypted credentials survive a redeploy. The broker and database passwords live in Node-RED's credential store, not in function nodes.
- Projects with Git. Node-RED's projects feature is enabled, and the flows are committed to a repository on the company's GitLab server. Every deploy in the editor is a commit the engineer can read; a bad flow change is a revert.
- Access. The editor is behind the platform's container firewall allowing the plant's network and the VPN; the dashboard path is opened to the office network only. Nothing about the plant floor is on the public internet.
- Restart behaviour. The Node.js container's process manager restarts Node-RED on a crash, and the flows and credentials are on persistent storage with snapshots, so a restart resumes exactly where it was.
Why PostgreSQL beside Node-RED, not inside it
Node-RED's own context store can hold state, and beginners keep readings there until the memory runs out. Twelve machines at a reading a second is a million rows a day, and that belongs in a database with an index. A platform PostgreSQL node in the same environment group is reached over the internal network, scales vertically as the tables grow, and is backed up nightly by the Database Backup/Restore add-on. The engineer adds a monthly partitioning scheme and a retention job in Node-RED itself: a scheduled flow that drops partitions older than two years, which is the company's record-keeping requirement.
| Component | Runs on | Role | Cloudlets (typical) |
|---|---|---|---|
| Mosquitto | Existing broker node | Machine telemetry in | 2 to 4 |
| Node-RED | Node.js container, persistent flows | Ingest, transform, dashboard, alerts | 3 to 8 |
| PostgreSQL | Database node | Time-series storage, partitioned | 4 to 10 |
| Backup Storage | Storage node | Nightly dumps | Disk only |
Node-RED or n8n for this job
The company also runs n8n for business automation, and the engineer was asked why not use it here. The answer is the shape of the work. Node-RED was built for event streams and protocols: its MQTT, serial, Modbus and OPC UA nodes are first-class, message flow is continuous, and latency from a machine fault to an alert is milliseconds. n8n excels at connecting SaaS applications and AI workflows with rich prebuilt integrations, in discrete executions. Machines to dashboard is Node-RED's job; the weekly production report emailed to the finance system is n8n's, and the two hand off through the same PostgreSQL.
Scaling and cost
Node-RED is a single Node.js process, and for twelve machines it barely notices; the container sits at 3 cloudlets (a cloudlet is 128 MiB of RAM plus 400 MHz of CPU) and rises to 8 when the dashboard's hourly charts recompute, with vertical scaling handling it. When the second plant's forty machines are added next year the engineer's plan is a second Node-RED instance per plant, cloned from this one, rather than one enormous flow, because clones are minutes and cost by the hour. The whole stack, broker included, runs at about 14 cloudlets an hour on average, roughly $34 a month before discounts at MassiveGRID's published $0.003372 per cloudlet-hour. The screen on the plant floor cost more than the first year of the system behind it.
Frequently Asked Questions
Can Node-RED talk to PLCs directly without MQTT?
Yes. Community palette nodes exist for Modbus TCP, OPC UA, Siemens S7 and others. They need a network path from the Node-RED node to the PLCs, which usually means a VPN or gateway from the plant network to the platform; publishing through an MQTT gateway on site is the more common and more robust pattern.
How do I back up Node-RED flows?
Enable the projects feature and commit to Git, which gives history and review as well as backup. The flows and credentials files also live on the node's persistent storage, which the platform snapshots, and a clone of the environment is a full copy.
Is the dashboard suitable for a plant-floor display?
Yes. Node-RED's dashboard is a responsive web page; a browser in kiosk mode on the floor display shows it. Restrict access with the container firewall to the plant network rather than exposing it publicly, and use a read-only dashboard user if your flows write commands to machines.
From machines to a screen, this afternoon
Deploy Node-RED on MassiveGRID PaaS beside a Mosquitto broker and a PostgreSQL node, all on one internal network, with persistent flows, HTTPS and per-cloudlet-hour billing. Free 14-day trial, no credit card.
Node-RED on MassiveGRID PaaS