Secure Node-RED: Login, HTTPS, MQTT TLS, Backups and Git
Node-RED can become the control center for lights, sensors, notifications and HTTP integrations. That makes editor access and flow configuration sensitive: someone who can edit a privileged flow may be able to change device behavior or read stored credentials.
A fresh Node-RED editor is not a public-facing authenticated control panel by default. Treat security as a deployment requirement, not a final cosmetic step. This guide lays out a practical hardening plan for home-lab and small-server deployments; the exact settings depend on the hosting environment, Node-RED release and reverse-proxy architecture.
1. Protect the editor with authentication
Follow the current Node-RED security guide. Configure adminAuth in the runtime's settings using a password hash generated by Node-RED's supported tool. Do not store a plaintext password in a committed settings file. Give accounts only the permissions needed for their role where your deployment supports role separation.
Protect administration separately from public/guest dashboards and HTTP endpoints. A route being obscure or on a high port is not authentication. After configuration, restart the runtime and test both permitted login and denied anonymous access from another device on the network.
2. Restrict network exposure and enable HTTPS
For local development, keep the editor on a trusted network. For remote administration, use HTTPS through a properly configured Node-RED HTTPS listener or a secure reverse proxy/VPN architecture. Ensure the proxy forwards the expected headers and does not inadvertently create an alternate unauthenticated route.
Do not forward port 1880 straight to the public internet as a shortcut. Restrict firewall rules and remote access to the smallest set of trusted users/devices. Secure dashboard endpoints separately; protecting the editor does not automatically make every HTTP In route, dashboard or custom API private.
3. Protect MQTT connections and flows
Use broker authentication and topic ACLs so each device can read and publish only what it needs. Use TLS where MQTT crosses an untrusted network, and validate the broker certificate in the client configuration. The exact Node-RED broker-node settings depend on the configured CA/certificate and your broker.
Avoid embedding API keys and passwords in Function-node source, dashboard messages or publicly exported flow JSON. Use Node-RED credential handling and environment/configuration settings appropriate to your deployment, and ensure debug output does not print tokens or authorization headers.
4. Back up and version flows safely
Export flows intentionally and remove sensitive values before sharing. Store versioned flow exports in a private repository or a controlled configuration backup location. Keep the runtime's settings and required package list alongside operational documentation, but do not include private credentials, API keys, device tokens or private certificates in a public repository.
A backup is only useful if it can be restored. Periodically restore to a test Node-RED instance, install the required palette packages and verify that the flow starts and the documented connections can be configured. Record version numbers so a later upgrade does not quietly break a node dependency.
5. Keep runtime and contrib nodes maintained
Node-RED flows can depend on third-party nodes. Install only what you need, prefer actively maintained packages, monitor advisories and review breaking changes before updating a production instance. Back up flows and configuration before a major update. Test the update on a copy where practical, especially for flows that control physical equipment.
When a flow calls HTTP APIs or accepts JSON from a device, validate method, headers, body shape and allowed values. Never assume that input is trustworthy because it comes from your own LAN; another device or compromised account may still send malformed requests.
Security checklist
- Editor/admin authentication configured and tested.
- HTTPS, VPN or secured remote access configured when needed.
- No direct, unrestricted public forwarding to the editor.
- Dashboard and HTTP endpoint access reviewed separately.
- MQTT credentials, TLS and topic ACLs configured for the threat model.
- Secrets excluded from flow exports, screenshots and Git.
- Flow/config backups stored safely and restore-tested.
- Node-RED and contributed nodes updated and reviewed.
- Critical device safety does not depend solely on a cloud dashboard.
Next steps
- Node-RED Complete Guide: From First Flow to Home Automation
- Node-RED with MQTT: Connect Mosquitto, Publish & Subscribe
- Install Mosquitto on Raspberry Pi 5
Official reference: Securing Node-RED. Check documentation for the Node-RED version and hosting stack you operate; security settings and proxy details are environment-specific.