LabwereldHomeInstallationConnectorsWorld modelDownloadNederlands

Installing with an AI assistant

Nederlands

This page is written for an AI assistant (such as Claude, ChatGPT or a coding agent) that is asked to set up Labwereld for someone. As a person you can simply say: "Read https://labwereld.wiehie.nl/en/assistant.md and install Labwereld for me." Everything below is addressed to the assistant.

Rules

  1. Read-only, always. Labwereld only needs read access. Never create a token, user or API key with write or admin rights, and never change anything in the person's systems except the Labwereld folder itself.
  2. No secrets in the chat. Do not ask the person to paste tokens, passwords or API keys into the conversation, and do not print them. Let the person put each secret in a file on the host themselves; you only check that the file exists and has the right permissions.
  3. One source is enough. Ask which of these the person actually runs: Proxmox VE, Proxmox Backup Server, Docker, Prometheus (node_exporter), Zabbix, OPNsense, UniFi, Plex. Connect only those. Never suggest installing a service just for Labwereld. Proxmox alone gives a complete world.
  4. Stay on the local network. Keep the port bound to 127.0.0.1 unless the person explicitly wants to open Labwereld from another machine; even then never expose it to the internet.
  5. Confirm before acting on anything outside the Labwereld folder (for example creating a user in Proxmox), and say exactly what you will run.

1. Check the prerequisites

  • Docker with Compose v2: docker compose version. Any 64-bit Linux, a Mac or a Raspberry Pi (amd64 or arm64) works.
  • Port 8787 is free: docker ps / ss -ltn | grep 8787 (or pick another host port in compose.yaml).
  • Outgoing HTTPS from the host to its own services (the sources).

2. Download, verify and start the demo

curl -LO https://labwereld.wiehie.nl/download/labwereld-0.3.0.tar.gz
curl -LO https://labwereld.wiehie.nl/download/labwereld-0.3.0.tar.gz.sha256
sha256sum -c labwereld-0.3.0.tar.gz.sha256     # macOS: shasum -a 256 -c …
tar xzf labwereld-0.3.0.tar.gz && cd labwereld-0.3.0
docker compose up -d --build

Use the newest version listed on https://labwereld.wiehie.nl/download.html.

Verify: curl -s http://127.0.0.1:8787/api/healthz returns JSON with "ok": true and a version. Without configuration Labwereld runs a fictional demo; tell the person they can open http://localhost:8787.

3. Set the time zone

In compose.yaml, set TZ to the person's IANA time zone (for example Europe/Berlin or America/Chicago). It only decides where the sun is in the Station style.

4. Write the configuration

All configuration lives in ./labwereld/ next to compose.yaml; the container mounts it read-only on /config.

./labwereld/labwereld.toml. Start from config/voorbeeld.toml. One [[site]] per location, with the IP ranges of that location:

[collector]
interval = 30
listen = "0.0.0.0:8787"

[[site]]
id = "home"
name = "Home"
cidrs = ["192.168.1.0/24"]

Then add a block only for each source the person has (the connectors guide lists every option):

[[proxmox]]                                   # Proxmox VE
site = "home"
url = "https://pve.example.lan:8006"
token_file = "/config/proxmox-token"          # contents: user@realm!tokenid=secret

[[pbs]]                                       # Proxmox Backup Server
site = "home"
url = "https://pbs.example.lan:8007"
token_file = "/config/pbs-token"             # contents: user@realm!tokenid:secret

[[docker]]                                    # Docker, via a socket proxy (see below)
name = "docker"
url = "http://docker-proxy:2375"
site = "home"

[[prometheus]]                                # Prometheus with node_exporter
name = "prometheus"
url = "http://prometheus.example.lan:9090"
site = "home"

[[opnsense]]                                  # OPNsense
site = "home"
url = "https://firewall.example.lan"
key_file = "/config/opnsense-key"             # the key file OPNsense lets you download

[unifi]                                       # UniFi (URL and key in labwereld.env)
site = "home"

./labwereld/labwereld.env:

LABWERELD_SOURCE=live                         # required: without it the demo keeps running
LABWERELD_ADMIN_TOKEN_FILE=/config/admin-token
# Zabbix, only if used:
ZABBIX_API_URL=https://zabbix.example.lan/api_jsonrpc.php
ZABBIX_API_TOKEN_FILE=/config/zabbix-token
# UniFi, only if used:
UNIFI_API_URL=https://192.168.1.1/proxy/network/integrations/v1
UNIFI_SITE_ID=<site id>
UNIFI_API_KEY_FILE=/config/unifi-key

Docker: do not mount the Docker socket into Labwereld. Add a read-only socket proxy to compose.yaml and use url = "http://docker-proxy:2375":

  docker-proxy:
    image: tecnativa/docker-socket-proxy
    environment:
      CONTAINERS: 1
      INFO: 1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: unless-stopped

5. Tokens with the minimal right

Explain to the person what to create and let them do it (or, with explicit consent, run the read-only commands for them). Each secret goes into its own file in ./labwereld/.

SourceMinimal right
Proxmox VEuser labwereld@pve with role PVEAuditor on /, plus an API token with privilege separation and the same role (commands in the connectors guide)
Proxmox Backup Serveruser labwereld@pbs with role DatastoreAudit on /datastore, plus an API token with the same role (commands in the connectors guide)
Dockerthe socket proxy above; no token
Prometheususually no token; otherwise a bearer token in token_file
Zabbixa user with read access to the host groups and a role allowing only host.get, item.get, problem.get, trigger.get, proxy.get; an API token
OPNsensea dedicated user with only Status: Interfaces, Reporting: Traffic, System: Gateways, VPN: WireGuard: Status and System: Deny config write, plus an API key
UniFia local Network API key (UniFi Network → Settings → Control Plane → Integrations)
Plexonly via Zabbix items following the Labwereld convention; skip it otherwise

The admin token for the settings page /beheer/ is not a source token; the person can generate it without showing it:

openssl rand -hex 24 > labwereld/admin-token

Then fix the permissions of every token file (the container runs as uid 10001):

sudo chown 10001 labwereld/*-token labwereld/*-key 2>/dev/null
sudo chmod 0400 labwereld/*-token labwereld/*-key 2>/dev/null
# SELinux only (Fedora, RHEL, …):
sudo chcon -R -t container_file_t labwereld/

6. Start and verify

docker compose up -d
curl -s http://127.0.0.1:8787/api/connectors

Labwereld picks up a changed configuration within 5 s by itself, but a restart does no harm. Done when every connector in /api/connectors reports "ok": true and /api/world contains nodes from the person's own environment (not the demo's "Hypervisor thuis"). Show the person http://localhost:8787/status/ and http://localhost:8787/station/.

Troubleshooting

SymptomCause and fix
Still the demoLABWERELD_SOURCE=live missing in labwereld.env, or labwereld.toml not in ./labwereld/
geen enkele bron ingesteld ("no source configured")no source block or environment variables at all
a connector reports Permission deniedtoken file not readable for uid 10001: chown 10001, chmod 0400, SELinux label
a connector reports 401 / 403token wrong or missing a right; check the table above
certificate errorsProxmox skips verification by default; for Prometheus/OPNsense with a self-signed certificate set verify_tls = false
/beheer/ asks for a tokenexpected with your own configuration: the contents of labwereld/admin-token, which the person reads themselves
invalid configurationthe error is at the top of /status/; the previous configuration stays active

Report to the person what you connected, what was skipped and why, and where the token files are.

EUPL-1.2 · made with Claude · questions: labwereld@wiehie.nl