Connect real hosts
Run a hub and an agent on your own machines, and the rooms of your design show the real health of your containers, with their logs. Your design stays where it is: it never goes to the hub.
This is free, and always run by you. There is no hosted hub, and we never connect to your infrastructure.
1 · Start a hub and an agent
From a checkout of the InfraCity repository, on the machine whose containers you want to see. Replace
shopwith your Docker Compose project;docker compose lslists them.pnpm live shop
Give several names to show several projects, or
--allfor every container on the machine. Add--name my-laptopand--label env=devto say what the host is called and how a zone can pick it. It makes new tokens each time and prints what to paste into the editor.2 · Connect the editor
In the editor choose Connect to hub, then enter the address it printed (for example
ws://127.0.0.1:8787) and the view token. The header changes from “Offline · design only” to “Hub connected”.The first time, Chrome (and browsers built on it) asks whether this site may connect to devices on your local network. Choose Allow: the hub is on your own machine. Until you answer, the connection waits.
Open the live editor3 · See your hosts
Each host arrives as a building. A building you drew binds to a host by name, or sits in a zone whose host selector matches its labels, such as
env=prod; a host that matches nothing waits in the arrivals strip. Click a room for its details and its logs.What becomes what In Docker In the city A host: a machine with an agent on it A building A Compose project on that host A floor A service in the project A room (several containers are replicas of one room) Container health and restarts The room's colour: its worst container decides A container that is not part of a Compose project A one-room floor of its own A password, token or key Its name only, never its value
Keep it running with Docker
For a host that should keep reporting, run the hub and the agent as containers. The first command writes docker/.env with fresh tokens; open it and set INFRACITY_INCLUDE_PROJECTS to the projects you mean to show.
pnpm live:env docker compose -f docker/compose.yaml --env-file docker/.env up -d --build
To keep the raw Docker socket away from the agent, add the proxy file. The agent then reads through a proxy that only allows reading.
docker compose -f docker/compose.yaml -f docker/compose.socket-proxy.yaml \ --env-file docker/.env up -d --build
A hub on another machine should sit behind TLS so you connect with wss://. The hub only listens on this machine until you set INFRACITY_ALLOW_REMOTE=1, and an agent refuses plain ws:// to a remote hub unless you set INFRACITY_ALLOW_INSECURE=1. Behind a proxy, also set INFRACITY_TRUST_PROXY=1 so a wrong token locks out only the client that sent it, not everyone behind the proxy.
What to know before you trust it
- Agents dial out to the hub, so a host opens no inbound port. Everything is read-only: an agent lists and inspects containers and reads their logs, and never changes anything.
- The Docker socket is the catch. Mounting it, even read-only, lets whatever controls the agent run anything as root on that host. The proxy file removes that, but the proxy can still read container data, so list only the projects you mean to show.
- Secret values never leave the host: only their names are sent. Log lines have secrets hidden on the host before they are sent, but that is best effort: a secret printed with nothing around it cannot be recognised.
- Whoever has the view token can read the logs of every project you report, so treat it like a password. The agent token lets a machine report as a host.
- Your design never goes to the hub, and nothing you draw is stored there. The hub keeps only what the agents report, in memory.
If it does not connect
| You see | Check |
|---|---|
| Nothing happens when you press Connect | Chrome is waiting for you to answer its local network prompt, near the address bar. If you chose Block, allow it again in the site settings (the icon at the left of the address). |
| The hub refused the view token | A typo, or an old token: every pnpm live run makes a new one. After 10 wrong tries an address is locked out for five minutes. |
| Cannot reach the hub | The hub is not running, the port is different, or you are locked out for a few minutes. |
| Connected, but no building | The agent is not running, or it was given a different agent token. It prints “connected” when the hub accepts it. |
| A building with no floors | The project name does not match. docker compose ls lists the names Docker Compose uses. |
| Your own buildings say “not found” | They are bound to host names that no agent reported. Give the host that name with --name, or place it in a zone whose host selector matches its labels. |