Home Assistant and Node-RED in Docker: Fix the Network Mode Conflict

Yes, they can run together — here’s what actually went wrong

Home Assistant and Node-RED can run side by side as separate Docker containers. That’s the standard setup. If one stopped working when you installed the other, you almost certainly hit a Docker networking conflict — specifically, both containers being configured to use host network mode.

The culprit: host network mode

The official Home Assistant Docker documentation recommends running the container with --network=host. In this mode, the container bypasses Docker’s virtual network entirely and binds directly to the host machine’s interfaces. Home Assistant needs it for mDNS (Zeroconf) — the discovery protocol used by Apple HomeKit, Chromecast, ESPHome, and similar integrations. Bridge mode blocks multicast traffic. Without mDNS, those integrations can’t find your devices on the LAN.

The trouble starts when a second container is also given network_mode: host. Both containers share the same host network stack. Every port one of them binds is unavailable to the other — and Home Assistant in host mode claims quite a few. Start Node-RED with the same setting and something will collide: which is exactly what you saw.

Why Node-RED ends up in host mode

Node-RED doesn’t need host mode. But many quick-start guides, Docker templates, and NAS management UIs (Portainer stacks, Synology, Unraid community apps) copy the network_mode: host setting into their Node-RED configurations, because they were written starting from a Home Assistant template. If you installed Node-RED using a pre-built template, that’s the likely cause.

The fix: a shared bridge network

Put both containers on a user-defined Docker bridge network. Containers on the same named bridge can reach each other by container name — no IP addresses needed, no host-mode conflicts. Each container only exposes the ports it actually needs.

Using Docker Compose:

version: "3"

services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:stable
    container_name: homeassistant
    restart: unless-stopped
    volumes:
      - ./ha-config:/config
    ports:
      - "8123:8123"
    networks:
      - smarthome

  nodered:
    image: nodered/node-red:latest
    container_name: nodered
    restart: unless-stopped
    volumes:
      - ./nodered-data:/data
    ports:
      - "1880:1880"
    networks:
      - smarthome

networks:
  smarthome:
    driver: bridge

No network_mode: host on either container. Node-RED can reach Home Assistant at http://homeassistant:8123 — the container name acts as the hostname inside the shared bridge network.

What if you genuinely need host mode for Home Assistant?

Some integrations need host networking: Z-Wave or Zigbee USB adapters, Apple HomeKit pairing, and anything that relies on LAN broadcast or multicast discovery. In that case, keep HA in host mode but run Node-RED in standard bridge mode with a normal port mapping. Then point Node-RED at your server’s LAN IP instead of the container name:

http://192.168.1.10:8123

HA in host mode is reachable at the host’s actual IP, so Node-RED in bridge mode can reach it over your local network. Swap in whatever IP your server is at.

Connecting Node-RED to Home Assistant

Once both containers are up without conflicts, install the node-red-contrib-home-assistant-websocket package from Node-RED’s Palette Manager: hamburger menu (top right) → Manage palette → Install tab → search “home-assistant-websocket” → Install.

Then set up the connection:

  1. In Home Assistant, click your username at the bottom left, open the Security tab, scroll to Long-Lived Access Tokens, and create one. Copy it immediately — you only see it once.
  2. In Node-RED, drop any HA node onto the canvas. Open it, then click the pencil icon next to Server.
  3. Enter the Base URL — http://homeassistant:8123 if you’re on a shared bridge, or your host’s LAN IP if HA is in host mode.
  4. Paste the access token into the Access Token field.
  5. Click Add, then Deploy.

A green “connected” indicator under the node means it’s working. If you see “connecting” or “disconnected”, the Base URL is almost always the issue — double-check whether you need the container name or the LAN IP.

Quick diagnostics

  • docker ps — confirm both containers show as Up
  • docker inspect homeassistant | grep NetworkMode — check what mode HA is actually running in
  • docker logs homeassistant — look for port binding errors on startup
  • ss -tlnp | grep -E '8123|1880' — check whether either port is already held by something else on the host

Sources


Related Articles

Similar Posts