Sthora
Servers

Adding a second machine

Enrolling a server the control plane does not run on — one command, one outbound connection, no inbound port.

A control plane can manage servers other than its own. The second machine runs an agent that dials out to the portal, so you open no port on it and hand over no SSH key.

Enrol it

Servers → Add server in the portal, and give it a name.

Copy the command it shows you and run it on the target machine as root. It is a docker run of the agent image carrying the issued token.

The server appears as connected within a few seconds. Deploy to it by choosing it when you create an application.

The token

The token is shown once, in the response to registering the server and in the response to rotating it. No other endpoint can carry one.

If you lose it, rotate it from the server's page:

  • the running agent keeps working until it reconnects, and
  • the old token stops being accepted immediately.

Prerequisites on the control plane

PUBLIC_BASE_URLRequired. It is the address the agent dials back on. Registering a server refuses rather than generating a command containing undefined.
AGENT_CHANNEL_ENABLEDMust be on. Off turns the channel away entirely — correct for a self-hosted install that manages one machine and has no reason to hold a socket open for a channel nobody will use.
AGENT_IMAGEThe image the generated command tells the operator to run. Configurable because an air-gapped or mirrored install pulls from its own registry, and the alternative is telling those operators to edit a command the portal generated for them.

What the agent needs on the target machine

  • Docker, with the socket at /var/run/docker.sock.
  • Outbound HTTPS to the control plane. Nothing inbound.
  • The host's /proc, /sys, and / bind-mounted into the container, so metrics describe the machine rather than the agent's own container.

What this actually gives away

The agent holds the Docker socket

On the machine it runs on, that is the same access the control plane holds on its own. It is not less privileged; it is the same privilege at the other end of a connection you can cut. Stop the container and the control plane can do nothing to that machine.

Removing a server

DELETE /servers/:id refuses while anything is still deployed to it. Move or delete the applications first.

Applications already running on a removed server keep running: they are containers started by compose files on its disk and depend on nothing here.

On this page