Playbook: onboard a server
Goal: a fresh Linux VPS shows up online in the fleet, with the base stack it needs: a Docker box, a LEMP box, a Node.js box, or another mix.
Token: full + servers:enroll, with no server allowlist. Only the workspace owner
can enrol servers. Adding a server over the plan’s VPS quota fails with
402 server_limit (Free 1 · Plus 3 · Pro 10 · Max 25 servers, plus any vps-slot
add-ons).
Box requirements: Ubuntu 24.04+ (also Debian 12/13; Alma or Rocky 9/10 in beta), root access, and outbound HTTPS on port 443. No inbound port is needed.
-
Check capacity.
servers_listreturns the servers you already have. If the user is at the quota, stop and say so. -
Create the enrolment.
servers_create(RESTPOST /v1/servers):{"name": "api-prod-1","install_config": {"components": ["docker"],"timezone": "UTC","swap": "2G","autoUpdates": true,"hardenSsh": false}}componentstakes any ofnginx,php,mariadb,mysql,postgres,docker,nodejs,redis,wpcli,phpmyadmin,certbot,firewallandsupervisor.phpanddockerpull innginx, andnginxpulls incertbot. If you omitcomponents, you get a PHP/LEMP box (nginx,php,mariadb,redis,wpcli,certbot). Use["docker"]for a container host and["nodejs","nginx"]for Node.js.phpVersions(for example["8.4"]; the first entry is the default) applies only when PHP is installed.- When
install_configis present, the base stack is provisioned automatically when the agent first connects.
The response carries
one_liner,install_token,install_token_idandexpires_at. The install token is valid for 1 hour. -
Run the one-liner on the box as root. Give the user the
one_liner(acurl -fsSL … | sudo INSTALL_TOKEN=… SERVER_NAME=… bashcommand) to paste into an SSH session. If you already have a shell on that box yourself, run it there. A token cannot run it for you: install-over-SSH is dashboard-only. -
Wait for the agent. Poll
servers_listevery 5–10 s until the new server showsonline: true(usually within a minute of the installer finishing). If it isn’t online after a few minutes, see Agent won’t come online. -
Provision (or repair) the base stack if you didn’t pass
install_config, or if you need more components later. Callservers_provision {id, body: {components: [...], phpVersions: [...]}}(levelfull). It is idempotent, so installed parts are skipped. It returns202 {job_id, …}. Polljobs_get {id: job_id}, which can take up to 30 minutes. -
Verify.
servers_provision_get {id}shows the provisioning state and the applied config.servers_inventory {id, kind: "services"}lists the running services, andservers_inventory {id, kind: "facts"}the OS facts.
Optional follow-ups
Section titled “Optional follow-ups”- Name and tag it.
servers_update {id, body: {name, notes?, tagId?}}, plusserver_tags_list/server_tags_create. - Reuse a template.
templates_listreturns saved install configs. Pass the template’s config asinstall_config:template_idalone is only recorded. To re-apply a saved template to an existing box, callservers_provision_remediate {id, body: {template_id}}. - Set the agent update policy.
agent_policy_get/agent_policy_set {id}. - Add monitoring. See Uptime monitors and alerts.
servers_delete {id} (full + servers:delete, owner only) removes the server from the
fleet. If the server is online, its agent uninstalls itself. Sites, apps and data on the
box are left in place. An unused install token can be revoked with
install_tokens_revoke {id}.