Connect a server

Connecting a server means installing the VPS Manager agent on it. The agent is a single binary that runs as a systemd service and connects out to our gateway. It needs no open inbound ports and no SSH access.

What you need

  • A Linux server on x86_64 (amd64) or arm64. Ubuntu, Debian, Rocky Linux and AlmaLinux are the distributions we test.
  • Root access (you run the installer with sudo).
  • curl and sha256sum on the server (both are present on standard images).
  • Outbound access from the server to our agent gateway on TCP ports 4443 (first enrollment) and 4444 (the permanent connection).

Install the agent

  1. In your workspace, open Servers and click Add server.
  2. Give the server a name and continue.
  3. Copy the install command shown on the next screen and run it on the server as root. It looks like this:
curl -fsSL https://<api host>/v1/agent/install.sh | sudo bash -s -- \
  --token <one-time token> --server-id <server id> --enroll <gateway host>:4443
  1. Leave the page open. It checks every few seconds and shows Connected: hostname (os) once the agent is online. Click Open server.

The token in the command works once and expires after 15 minutes. If it expires, open the server in Servers and click Show install command to get a fresh one. Creating a new token cancels any older unused one.

What the installer does

  1. Downloads the agent release over HTTPS and checks it against the published SHA-256 checksum (and an Ed25519 signature when one is pinned).
  2. Installs the binary at /usr/local/bin/vpsm-agent and creates /etc/vpsm (readable by root only).
  3. Creates a system user called vpsm. Terminals and file access use this non-root user by default.
  4. Writes the systemd unit vpsm-agent.service, enrolls the server and starts the service.

During enrollment the server generates its own private key, which never leaves the server. Our gateway signs a short-lived client certificate (24 hours, renewed automatically), and every later connection uses mutual TLS 1.3.

It is safe to run the installer again. Add --reenroll to force a fresh enrollment.

What the agent can do

The agent only runs commands it has a handler for; anything else is rejected. In short, it can:

  • report inventory and metrics, and tail logs you choose;
  • install and manage Docker, containers and compose stacks;
  • build and release your apps, run cron jobs and CI steps;
  • configure nginx and TLS certificates for your domains;
  • create and manage databases, and run backups and restores with restic;
  • open a web terminal and browse files, as the vpsm user by default (acting as root is off unless your organization turns it on);
  • install k3s, load balancers and firewall rules when you ask for them;
  • update or uninstall itself.

Read the Security page for the full picture, including how commands are authenticated and how terminal sessions are recorded.

Pause the agent

If you ever want the platform to stop changing a server, run this on the server:

sudo vpsm-agent pause

The agent then refuses every command from the platform, while still sending heartbeats and metrics. Run sudo vpsm-agent resume to undo it.

Remove a server

Open the server and click Remove server. This disconnects the agent, revokes its certificate, and uninstalls the agent if the server is online. Apps already running on the server keep running.

If the server was offline, or you prefer to do it by hand, run:

sudo vpsm-agent uninstall

This removes the systemd unit, the binary and the agent's state. Some things are left on purpose:

  • /etc/vpsm/dbs/: credentials for databases that keep running on the server.
  • /etc/vpsm/commands.log: the local log of commands the agent ran (kept when you remove the server from the dashboard).
  • The vpsm user and /home/vpsm.
  • Your apps, containers and nginx configuration.

To clean those up too, once you no longer need them:

sudo rm -rf /etc/vpsm
sudo userdel -r vpsm

Troubleshooting

  • The token was rejected: it was already used or is older than 15 minutes. Open the server and click Show install command for a new one.
  • The server never shows as connected: check that outbound TCP 4443 and 4444 to the gateway are allowed, then look at journalctl -u vpsm-agent.