Skip to content

Agent on another host

NightDragon1 edited this page Nov 8, 2026 · 2 revisions

Version: applies to RCONductor 1.1. Parts marked (new in 1.1) are not in 1.0.

One agent runs on each game host. It controls the containers there for the panel: status, metrics, logs, start, stop and restart. It cannot create, remove or change containers, run commands in them or touch images and volumes. The panel itself can run on any other host.

What the game host needs

Need Why
Docker Engine on Linux, amd64 or arm64 the agent image exists for both
the Docker socket /var/run/docker.sock and its group (stat -c %g /var/run/docker.sock) the agent runs as a non-root user (65532) and reaches the socket through that group
an outgoing TCP connection to the panel's agent port (default 8443) the agent connects out; it opens no port itself
a volume for /secrets the agent key and the pairing with the panel
the label rconductor.manage=true on each game container the agent manages only labeled containers
the same major version as the panel panel 1.x with agent 1.x

Access to the Docker socket is equal to root on the host; see Things to note.

On the panel host

Agents connect to the agent port directly, never through a reverse proxy: its TLS ends at the panel, which agents pin by key. Publish the port and tell the panel the address agents reach it under, before you create a token, since the token carries it:

services:
  panel:
    image: docker.io/nightdragon1/rconductor-panel:1
    restart: unless-stopped
    read_only: true
    cap_drop: [ALL]
    security_opt: ["no-new-privileges:true"]
    pids_limit: 256
    mem_limit: 1g
    ports:
      - "8080:8080"
      # Agent port: agents on other hosts connect here directly,
      # never through a reverse proxy.
      - "8443:8443"
    environment:
      # Where agents reach the panel; goes into every pairing token.
      RCD_AGENT_PUBLIC_ADDR: "${RCD_AGENT_PUBLIC_ADDR}"
    volumes:
      - data:/data
      - secrets:/secrets
      - backups:/backups

volumes:
  data:
  secrets:
  backups:
echo "RCD_AGENT_PUBLIC_ADDR=panel-host.lan:8443" > .env
docker compose up -d

panel-host.lan is the name or IP address of the panel host as the game hosts see it. In your firewall, allow port 8443 only from your game hosts.

On the game host

Create a pairing token in the panel: Agents, Pair an agent, Make token. It is valid once, for 24 hours. Then, with Compose:

services:
  agent:
    image: docker.io/nightdragon1/rconductor-agent:1
    restart: unless-stopped
    read_only: true
    cap_drop: [ALL]
    security_opt: ["no-new-privileges:true"]
    pids_limit: 256
    mem_limit: 1g
    group_add: ["${DOCKER_GID}"]
    environment:
      RCD_PAIRING_TOKEN: "${RCD_PAIRING_TOKEN:-}"
      RCD_AGENT_NAME: "${RCD_AGENT_NAME:-}"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - agent-secrets:/secrets

volumes:
  agent-secrets:
echo "DOCKER_GID=$(stat -c %g /var/run/docker.sock)" > .env
echo "RCD_AGENT_NAME=game-host-2" >> .env
echo 'RCD_PAIRING_TOKEN=rcd1....' >> .env
docker compose up -d
docker compose logs agent | grep "connected to the panel"

Or with docker run:

docker run -d --name rconductor-agent --restart unless-stopped \
  --read-only --cap-drop ALL --security-opt no-new-privileges:true \
  --pids-limit 256 --memory 1g \
  --group-add "$(stat -c %g /var/run/docker.sock)" \
  -e RCD_PAIRING_TOKEN='rcd1....' \
  -e RCD_AGENT_NAME=game-host-2 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v rconductor-agent-secrets:/secrets \
  docker.io/nightdragon1/rconductor-agent:1

RCD_AGENT_NAME is the name shown in the panel; without it the agent takes the host name, inside a container its ID. After the first connection the agent keeps its pairing in /secrets; the token is ignored afterwards and may stay. After a revocation in the panel the agent stops reconnecting until it is paired again.

Pairing without a token

Instead of a token, set only RCD_PANEL_ADDR=panel-host.lan:8443 on the agent and switch on pairing by fingerprint in the panel (setting agents.fingerprint_pairing; it closes itself after 30 minutes). The agent writes its own fingerprint and the panel's to its log. Compare both with the panel, then approve the agent there.

Narrowing the Docker API

A socket proxy in front of the socket lets the agent reach only the calls it needs. The guide in the repository has a tested example: Agent behind a socket proxy.

Versions

Update the panel first, then the agents. Panel and agent must have the same major version; otherwise the panel refuses the agent with the reason version, and the agent keeps trying until the versions match. (new in 1.1) A panel works with every older agent of its major version and hides what that agent cannot do.

Clone this wiki locally