Running Home Assistant and Node-RED in Docker Without Conflicts

They can run together — here’s what goes wrong

Home Assistant’s official Docker container runs in host network mode. That’s intentional: it needs to see broadcast traffic on your LAN to auto-discover devices via mDNS, Zeroconf, and similar protocols. Strip that away and half your integrations stop working.

The problem is that host network mode means the container bypasses Docker’s internal bridge network and sits directly on the host’s network stack. If Node-RED also pulls host networking — which some install guides and Docker GUI templates set by default — the two containers end up fighting over the same network namespace. Ports conflict, services crash, and whichever one started last tends to win. That’s why removing Node-RED brought Home Assistant back.

The fix: Docker Compose with split networking

Run them from a single docker-compose.yml. Give Home Assistant host networking (it needs it), and give Node-RED standard bridge networking with a port mapping. They don’t need the same network mode to communicate — Node-RED connects to Home Assistant over HTTP and WebSocket using the host machine’s IP address.

services:
  homeassistant:
    container_name: homeassistant
    image: ghcr.io/home-assistant/home-assistant:stable
    restart: unless-stopped
    network_mode: host
    volumes:
      - ./ha-config:/config
    environment:
      - TZ=Europe/Amsterdam

  node-red:
    container_name: node-red
    image: nodered/node-red:latest
    restart: unless-stopped
    ports:
      - 1880:1880
    volumes:
      - ./node-red-data:/data
    environment:
      - TZ=Europe/Amsterdam

Replace the timezone string with your own. Adjust the volume paths to wherever you want to keep config files. Then start both containers:

docker compose up -d

Home Assistant will be at http://your-host-ip:8123 and Node-RED at http://your-host-ip:1880. Both should start cleanly without stepping on each other.

Connecting Node-RED to Home Assistant

Getting both containers running is only part of the setup. To actually control Home Assistant entities from Node-RED flows, you need the right palette node and an access token.

Install the palette node

In Node-RED, open the hamburger menu and go to Manage paletteInstall. Search for node-red-contrib-home-assistant-websocket and install it. There’s an older package called node-red-contrib-home-assistant that shows up in the same search results — skip it, it’s largely unmaintained. The websocket version is the current standard.

Generate a long-lived access token

In Home Assistant, click your username at the bottom of the left sidebar, then scroll all the way down on your profile page to Long-Lived Access Tokens. Click Create Token, give it a name (“node-red” works fine), and copy it immediately. You only see the token once.

Wire up the server node

Drop any Home Assistant node into a Node-RED flow, double-click it, and click the pencil icon next to the Server field. Set the base URL to http://your-host-ip:8123. Use the actual IP address of the machine — not localhost, and not the container name homeassistant. Because Node-RED is on bridge networking, Docker’s internal DNS won’t resolve the Home Assistant container. Paste your access token and click Add. The server node indicator should turn green.

If it stays red, run docker compose ps to confirm Home Assistant is actually up, and double-check the IP address.

Using Portainer or a NAS GUI?

If you’re setting this up through Portainer stacks or a NAS interface like Synology or Unraid, the conflict often sneaks in through a default template that sets both containers to host networking. The cleanest fix is to paste the compose file above as a new Portainer stack. Explicit network settings beat template defaults every time.

What Node-RED adds once everything is wired up

Home Assistant’s built-in automations handle simple triggers well enough. Node-RED earns its place when a flow needs multi-step logic: check a state, wait, call an external API, branch on the result, then act. The visual editor also makes it much easier to trace exactly where something broke.

Sources


Related Articles

Similar Posts