Docker

What it is: A platform for running applications in containers: isolated processes started from prebuilt images. In a homelab it's the standard way to run services like Node-RED, Home Assistant or an MQTT broker without installing them into the system. Docker docs Current versions are Docker Engine 29.8.2 and Compose 5.6.0 (09–10/2026). Docker docs

Core concepts

Docker architecture
Client, daemon, registry, containers, networks and volumes. Own diagram (Synthesis) based on Docker docs.

Compose in practice

Synthesis based on Docker docs and Node-RED docs: Node-RED and an MQTT broker on one user-defined network, data in volumes, the Node-RED port on the LAN only.

services:
  node-red:
    image: nodered/node-red:5.0.7      # pinned version instead of latest
    restart: unless-stopped
    ports:
      - "1880:1880"                    # 127.0.0.1:1880:1880 = host only
    volumes:
      - node_red_data:/data
  mosquitto:
    image: eclipse-mosquitto:2         # Mosquitto 2.x
    restart: unless-stopped
    volumes:
      - mosquitto_data:/mosquitto/data
volumes:
  node_red_data:
  mosquitto_data:

Restart policy

Value Behaviour
no no restart (default)
on-failure[:n] only on error (non-zero exit code), optionally max. n attempts
always always. A manually stopped one comes back only after a daemon restart
unless-stopped like always, but a manually stopped one stays off even after a daemon restart

The policy only applies after a successful start (container up for at least 10 s). Docker docs Umbrel uses on-failure for its apps. Umbrel sources

Data and backups

docker run --rm --volumes-from mynodered -v $(pwd):/backup ubuntu tar cvf /backup/backup.tar /data

Networking and ports

Logs

The default json-file driver does not rotate logs and can fill the disk. local is recommended Docker docs:

{ "log-driver": "local" }

It goes into /etc/docker/daemon.json. After restarting Docker it applies to newly created containers; existing ones don't pick up the new setting automatically. Docker docs

Security

Gotchas

Related

Sources