Node-RED Automation Platform
Low-code automation with Node-RED, MQTT broker, InfluxDB storage, and Grafana dashboards.
Overview
Node-RED is a visual programming tool developed by IBM that enables users to wire together hardware devices, APIs, and online services through a browser-based flow editor. Built on Node.js, it uses a drag-and-drop interface where users connect nodes to create automation flows, making it particularly valuable for IoT applications, home automation, and industrial monitoring without requiring extensive coding knowledge. This automation platform combines Node-RED with Mosquitto MQTT broker for lightweight messaging, InfluxDB for time-series data storage, and Grafana for creating rich visualization dashboards. The stack creates a complete data pipeline where sensors and devices publish data via MQTT, Node-RED processes and routes this information to InfluxDB for storage, while Grafana provides real-time monitoring and historical analysis through customizable dashboards. This combination is ideal for makers, system integrators, and organizations looking to implement comprehensive IoT automation solutions. The visual programming approach of Node-RED makes complex automation accessible to users with varying technical backgrounds, while the time-series capabilities of InfluxDB and visualization power of Grafana provide enterprise-grade monitoring and analytics capabilities typically found in much more expensive commercial solutions.
Key Features
- Visual flow-based programming with 300+ pre-built nodes for common automation tasks
- MQTT broker with WebSocket support for real-time IoT device communication
- InfluxDB 2.7 with Flux query language for advanced time-series data analysis
- Grafana dashboard templating with variables for dynamic multi-device monitoring
- Node-RED palette manager for installing community-contributed automation nodes
- Mosquitto persistence and retained message support for reliable IoT messaging
- InfluxDB data retention policies for automatic old data cleanup
- Grafana alerting with multiple notification channels including Slack and email
Common Use Cases
- 1Home automation systems collecting sensor data and controlling smart devices
- 2Industrial IoT monitoring for equipment performance and predictive maintenance
- 3Weather station data collection with automated alerts for extreme conditions
- 4Energy monitoring systems tracking solar panel output and consumption patterns
- 5Greenhouse automation with temperature, humidity, and irrigation control
- 6Network monitoring solutions collecting SNMP data and system metrics
- 7Building management systems for HVAC control and occupancy tracking
Prerequisites
- Docker Engine 20.10+ and Docker Compose V2 for container orchestration
- Minimum 2GB RAM (1GB for InfluxDB, 512MB for Grafana, remainder for Node-RED and Mosquitto)
- Available ports 1880 (Node-RED), 1883/9001 (MQTT), 3000 (Grafana), and 8086 (InfluxDB)
- Basic understanding of MQTT publish/subscribe messaging patterns
- Familiarity with time-series data concepts for effective InfluxDB usage
- Knowledge of JSON data structures for Node-RED flow configuration
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 nodered: 3 image: nodered/node-red:latest4 environment: 5 TZ: ${TZ}6 ports: 7 - "1880:1880"8 volumes: 9 - nodered_data:/data10 depends_on: 11 - mosquitto12 networks: 13 - automation-net14 restart: unless-stopped1516 mosquitto: 17 image: eclipse-mosquitto:latest18 ports: 19 - "1883:1883"20 - "9001:9001"21 volumes: 22 - ./mosquitto.conf:/mosquitto/config/mosquitto.conf:ro23 - mosquitto_data:/mosquitto/data24 networks: 25 - automation-net26 restart: unless-stopped2728 influxdb: 29 image: influxdb:2.730 environment: 31 DOCKER_INFLUXDB_INIT_MODE: setup32 DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUX_USER}33 DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUX_PASSWORD}34 DOCKER_INFLUXDB_INIT_ORG: ${INFLUX_ORG}35 DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUX_BUCKET}36 ports: 37 - "8086:8086"38 volumes: 39 - influxdb_data:/var/lib/influxdb240 networks: 41 - automation-net42 restart: unless-stopped4344 grafana: 45 image: grafana/grafana:latest46 environment: 47 GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}48 ports: 49 - "3000:3000"50 volumes: 51 - grafana_data:/var/lib/grafana52 depends_on: 53 - influxdb54 networks: 55 - automation-net56 restart: unless-stopped5758volumes: 59 nodered_data: 60 mosquitto_data: 61 influxdb_data: 62 grafana_data: 6364networks: 65 automation-net: 66 driver: bridge.env Template
.env
1# Timezone2TZ=UTC34# InfluxDB5INFLUX_USER=admin6INFLUX_PASSWORD=secure_influx_password7INFLUX_ORG=automation8INFLUX_BUCKET=nodered910# Grafana11GRAFANA_PASSWORD=secure_grafana_passwordUsage Notes
- 1Node-RED editor at http://localhost:1880
- 2Install additional nodes from palette manager
- 3Use MQTT nodes for IoT integration
- 4Visualize data in Grafana
Individual Services(4 services)
Copy individual services to mix and match with your existing compose files.
nodered
nodered:
image: nodered/node-red:latest
environment:
TZ: ${TZ}
ports:
- "1880:1880"
volumes:
- nodered_data:/data
depends_on:
- mosquitto
networks:
- automation-net
restart: unless-stopped
mosquitto
mosquitto:
image: eclipse-mosquitto:latest
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
- mosquitto_data:/mosquitto/data
networks:
- automation-net
restart: unless-stopped
influxdb
influxdb:
image: influxdb:2.7
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUX_USER}
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUX_PASSWORD}
DOCKER_INFLUXDB_INIT_ORG: ${INFLUX_ORG}
DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUX_BUCKET}
ports:
- "8086:8086"
volumes:
- influxdb_data:/var/lib/influxdb2
networks:
- automation-net
restart: unless-stopped
grafana
grafana:
image: grafana/grafana:latest
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
ports:
- "3000:3000"
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- influxdb
networks:
- automation-net
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 nodered:5 image: nodered/node-red:latest6 environment:7 TZ: ${TZ}8 ports:9 - "1880:1880"10 volumes:11 - nodered_data:/data12 depends_on:13 - mosquitto14 networks:15 - automation-net16 restart: unless-stopped1718 mosquitto:19 image: eclipse-mosquitto:latest20 ports:21 - "1883:1883"22 - "9001:9001"23 volumes:24 - ./mosquitto.conf:/mosquitto/config/mosquitto.conf:ro25 - mosquitto_data:/mosquitto/data26 networks:27 - automation-net28 restart: unless-stopped2930 influxdb:31 image: influxdb:2.732 environment:33 DOCKER_INFLUXDB_INIT_MODE: setup34 DOCKER_INFLUXDB_INIT_USERNAME: ${INFLUX_USER}35 DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUX_PASSWORD}36 DOCKER_INFLUXDB_INIT_ORG: ${INFLUX_ORG}37 DOCKER_INFLUXDB_INIT_BUCKET: ${INFLUX_BUCKET}38 ports:39 - "8086:8086"40 volumes:41 - influxdb_data:/var/lib/influxdb242 networks:43 - automation-net44 restart: unless-stopped4546 grafana:47 image: grafana/grafana:latest48 environment:49 GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}50 ports:51 - "3000:3000"52 volumes:53 - grafana_data:/var/lib/grafana54 depends_on:55 - influxdb56 networks:57 - automation-net58 restart: unless-stopped5960volumes:61 nodered_data:62 mosquitto_data:63 influxdb_data:64 grafana_data:6566networks:67 automation-net:68 driver: bridge69EOF7071# 2. Create the .env file72cat > .env << 'EOF'73# Timezone74TZ=UTC7576# InfluxDB77INFLUX_USER=admin78INFLUX_PASSWORD=secure_influx_password79INFLUX_ORG=automation80INFLUX_BUCKET=nodered8182# Grafana83GRAFANA_PASSWORD=secure_grafana_password84EOF8586# 3. Start the services87docker compose up -d8889# 4. View logs90docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/node-red-automation/run | bashTroubleshooting
- Node-RED flows not connecting to Mosquitto: Verify MQTT broker configuration node uses 'mosquitto' as hostname, not localhost
- InfluxDB authentication errors: Check DOCKER_INFLUXDB_INIT_* environment variables match values used in Node-RED InfluxDB output nodes
- Grafana showing 'No data points' for InfluxDB queries: Ensure InfluxDB data source uses Flux language and correct bucket name from environment variables
- MQTT clients cannot connect: Create mosquitto.conf file with 'listener 1883' and 'allow_anonymous true' for basic setup
- Node-RED palette installation fails: Container needs internet access and sufficient disk space in nodered_data volume
- Grafana dashboards not persisting: Verify grafana_data volume is properly mounted and container has write permissions
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
node-redmosquittoinfluxdbgrafana
Tags
#node-red#automation#low-code#mqtt#iot
Category
Home Lab & Self-HostingAd Space
Shortcuts: C CopyF FavoriteD Download