Node-RED
Low-code programming for event-driven applications, IoT devices, and API integrations.
Why consider Node-RED?
Node-RED is an open-source visual flow-based programming tool for wiring hardware devices, APIs, and online services together with a browser-based flow editor.
Learn Node-RED by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide11 sections
What is Node-RED?
Node-RED is an open-source, flow-based visual programming tool originally created by IBM Emerging Technologies and maintained by the OpenJS Foundation. Built on Node.js, Node-RED provides a browser-based visual canvas where developers and engineers can interconnect hardware sensors, home automation systems, MQTT brokers, REST APIs, and cloud services using interconnected processing nodes.
It serves as a self-hosted, lightweight alternative to commercial IoT middleware and automation services like Zapier, IFTTT, and AWS IoT Core.
Who Is It For?
- IoT & Industrial Automation Engineers: Connecting industrial PLCs (Modbus, OPC UA, MQTT), factory sensors, and telemetry dashboards.
- Home Automation Enthusiasts: Integrating complex home automation routines connecting Zigbee sensors, Home Assistant, and smart home appliances.
- Backend Developers: Prototyping webhook handlers, ETL event pipes, and custom API integrations in minutes.
Key Features
- Visual browser-based flow editor: Drag, drop, and wire nodes representing hardware inputs, HTTP endpoints, functions, and outputs.
- Comprehensive palette of built-in nodes: HTTP, WebSocket, TCP, UDP, MQTT, Serial, File, and JSON parsers.
- Function node with full JavaScript execution: Write arbitrary JavaScript code within nodes to manipulate payloads.
- Huge community node repository: Install thousands of community-developed nodes directly from the palette manager.
- Lightweight runtime environment capable of running on low-power hardware like Raspberry Pi and industrial gateways.
Deploying Node-RED with Docker Compose
version: '3.7'services: nodered: image: nodered/node-red:latest container_name: nodered restart: unless-stopped ports: - "1880:1880" environment: - TZ=UTC volumes: - ./data:/dataStart the container:
docker compose up -dOpen http://localhost:1880 in your browser to access the visual flow editor.
Building Your First Automation Flow
- From the left sidebar palette, drag an inject node (input) onto the canvas.
- Drag a function node onto the canvas and connect the wire from the inject node's output to the function node's input. Double-click the function node and add:
javascript1
msg.payload = { message: "Hello from Node-RED!", timestamp: new Date().toISOString() };2return msg; - Drag a debug node onto the canvas and connect the function node output to the debug node input.
- Click the red Deploy button in the top right corner.
- Click the square button on the inject node; the formatted JSON message will appear instantly in the right-side Debug tab.
Practical Use Cases
1. Smart Home Temperature & Humidity Monitor
An automation engineer reads MQTT sensor packets from Zigbee temperature sensors, formatting the data and dispatching alerts to Telegram when thresholds exceed 28°C.
2. Microservice Webhook Router
A developer receives Stripe webhook payments via an HTTP input node, verifies payment metadata in a function node, and writes transaction logs to MongoDB.
3. Industrial Modbus Sensor Telemetry
A factory engineer polls Modbus registers on manufacturing equipment every second, forwarding time-series metrics to InfluxDB and Grafana.
Troubleshooting and Limitations
- Flow Backups and Version Control: Node-RED flows are stored as JSON in
/data/flows.json; enable Node-RED's built-in Git project feature for full version control. - Long-Running Blocking Operations: Node.js operates on a single event loop; avoid blocking CPU-intensive calculations inside Function nodes to prevent stalling message flows.
Official Resources
- Official Website: https://nodered.org
- GitHub Repository: https://github.com/node-red/node-red
- Documentation: https://nodered.org/docs/
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.