homelab-blueprint/docker-compose-files/node-red/README.md
2026-06-15 10:53:29 +02:00

1.9 KiB

Node-RED

Docker deployment for Node-RED with the Home Assistant websocket integration. Run all commands from the repository root.

Appdata Location

The setup script creates appdata/node-red in the project root. Do not create it inside docker-compose-files/.

Installation

  1. Deploy the Home Assistant stack first, then create .env if needed:

    cp -n .env.sample .env
    
  2. Set the required values in .env:

    TZ=Africa/Johannesburg
    HA_URL=http://homeassistant:8123
    HA_TOKEN=<home-assistant-long-lived-access-token>
    DOCKERLOGGING_MAXFILE=3
    DOCKERLOGGING_MAXSIZE=10m
    

    setup-node-red.sh generates NODE_RED_CREDENTIAL_SECRET if it is empty.

  3. Create appdata, render settings, and generate Compose:

    ./setup-node-red.sh
    
  4. Validate, build, and start Node-RED:

    docker compose -f docker-compose.node-red.yml config --quiet
    docker compose -f docker-compose.node-red.yml up -d --build
    
  5. Verify the container and open http://<HOST_IP>:1880:

    docker compose -f docker-compose.node-red.yml ps
    docker compose -f docker-compose.node-red.yml logs --tail=100 node-red
    

Apply Configuration Changes

./setup-node-red.sh
docker compose -f docker-compose.node-red.yml up -d --build

Do not change NODE_RED_CREDENTIAL_SECRET after saving credentials.

Initial Setup

Add a Home Assistant server node using $(HA_URL) and $(HA_TOKEN).

Network Requirements

The Home Assistant stack must be running because Node-RED joins the external ha_network.

Troubleshooting

If startup fails with a missing network, start docker-compose.homeassistant.yml first.

Useful Commands

docker compose -f docker-compose.node-red.yml restart node-red

Backup

Back up appdata/node-red and preserve NODE_RED_CREDENTIAL_SECRET.