English
Get started

← All templates · Automation

Deploy Node-RED in one click

Low-code flows that wire together APIs, devices and online services

A self-hosted alternative to Zapier and IFTTT.

What is Node-RED?

Node-RED is an open-source, low-code programming tool for event-driven applications, often run in place of Zapier or IFTTT. In its editor in the browser you drag nodes onto a canvas and wire them into flows: a message comes in from an HTTP request, an MQTT topic, a webhook or a timer, passes through nodes that change, filter or route it, and goes out to a database, an API or a chat. A Function node runs your own JavaScript where no node fits, and the community library has more than 6,000 nodes to install from the editor.

Node-RED was started at IBM in 2013 and is now a project of the OpenJS Foundation. People use it for home automation, often beside Home Assistant, for IoT and industrial data, and as glue between web services, and they self-host it to run their automations around the clock with no price per run. This template opens the editor only to the username and password given. The catch: the routes of HTTP In nodes are public, so an endpoint that should be private needs httpNodeAuth in settings.js or a check of its own.

Hosting Node-RED on Pethost

  1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
  2. New project opens at Node-RED. You fill in what it asks for and click Create project: Username, Admin password.
  3. In a minute or two Node-RED is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
  4. It is a project like any other: you or your agent can change it, roll it back or restore it.

Questions about Node-RED

Is Node-RED free?

Yes. Node-RED is open source under the Apache 2.0 license and costs nothing, whatever the number of flows or messages. It is a project of the OpenJS Foundation.

How do I install more nodes in Node-RED?

Open the main menu, choose Manage palette and search its Install tab, which lists the nodes of the community library. Installed nodes are kept in the data volume, so they stay through restarts and new deploys.

Can Node-RED work with Home Assistant?

Yes. The node-red-contrib-home-assistant-websocket nodes talk to Home Assistant through its WebSocket and REST APIs, to react to its events and call its services. Your Home Assistant must be reachable from the server Node-RED runs on.

How do I build a dashboard in Node-RED?

Install @flowfuse/node-red-dashboard with Manage palette: its nodes draw buttons, charts and forms on a page that Node-RED serves. The older node-red-dashboard has been deprecated since June 2024.

How do I protect the HTTP endpoints of my flows?

The editor asks for a sign-in, but the routes of HTTP In nodes answer anyone. Set httpNodeAuth with a user and a bcrypt hash in /data/settings.js to put one password on all of them, or check a token in the flow itself.

How much memory and disk does Node-RED need?

Node-RED is light: about 100 MB of memory; flows take kilobytes, and the nodes you install a few megabytes each. On Pethost the Starter plan is enough for it, with room for other apps beside it.

Node-RED Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

Containers: node-red (nodered/node-red:5).

Volumes, in the nightly backup: data.

services:
  node-red:
    image: nodered/node-red:5
    restart: unless-stopped
    environment:
      TZ: ${TZ:-UTC}
      ADMIN_USERNAME: ${ADMIN_USERNAME}
      ADMIN_PASSWORD: ${ADMIN_PASSWORD}
    # The editor would be open to anyone with the address. Node-RED starts with the settings of
    # /data/settings.js, which are yours to edit, and with the username and password of the
    # project's .env as its only sign-in, unless settings.js sets adminAuth itself.
    entrypoint: ["/bin/bash", "-c"]
    command:
      - |
        # The first start: settings.js to edit, and no flow, where the image's would warn of a
        # missing volume, which the project has.
        if [ ! -f /data/settings.js ]; then
          cp node_modules/node-red/settings.js /data/settings.js
          rm -f /data/flows.json
        fi
        cat > /tmp/settings.js <<'END'
        const { createHash, timingSafeEqual } = require("node:crypto");
        const settings = require("/data/settings.js");
        const digest = (text) => createHash("sha256").update(String(text)).digest();
        const user = (username) => (username === process.env.ADMIN_USERNAME ? { username, permissions: "*" } : null);
        settings.adminAuth ??= {
          type: "credentials",
          users: async (username) => user(username),
          authenticate: async (username, password) =>
            timingSafeEqual(digest(password), digest(process.env.ADMIN_PASSWORD)) ? user(username) : null
        };
        module.exports = settings;
        END
        exec ./entrypoint.sh --settings /tmp/settings.js
    volumes:
      - data:/data

volumes:
  data:

More in Automation