Playbook: create a site (any type)
Goal: a domain served by nginx on one server, as one of six site types. WordPress is
one of the six. Always pass siteType: a site.create body without it creates a
WordPress site.
Token: operate (site.create is an operate kind). Run it on a server whose base
stack has nginx, plus PHP for PHP and WordPress sites. Every site type is on every
plan, Free included; the runtime (Node.js, Python, Go) is installed by site.create.
Prerequisites: the domain’s A/AAAA record points at the server if you want automatic
TLS. Get the server’s public IP from servers_ip_get {id}. Records at a connected DNS
provider can be created first (see DNS, TLS and SSL).
- Pick the server. Call
servers_list, thenservers_sites {id}to check the domain isn’t already there.servers_sites_allsearches the whole fleet. - Read the schema.
jobs_schema {type: "site.create"}. - Dispatch.
jobs_create {id: <server UUID>, body: {...}}with one of the bodies below. - Poll
jobs_get {id: job_id}until it reaches a terminal status (usually under a minute; WordPress takes a bit longer). - Verify. Run
servers_sites_refresh {id}, wait a few seconds, thenservers_sites {id}should list the domain.site_get {domain, server}orjobs_create site.info {domain}returns its details. Then fetchhttps://<domain>.
Bodies by type
Section titled “Bodies by type”Common optional fields: sslMode (auto (the default) or skip), includeWww
(boolean), plan (a resource-limit plan slug, or none) and docRoot.
Static site
{ "type": "site.create", "domain": "docs.example.com", "siteType": "static" }PHP: plain, Laravel or Symfony
{ "type": "site.create", "domain": "app.example.com", "siteType": "php", "framework": "laravel", "phpVersion": "8.4", "gitRepo": "https://github.com/acme/app.git" }A Laravel site gets a production .env (APP_ENV=production, APP_DEBUG=false,
APP_URL=https://<domain>), a database (MariaDB when the box has it, named by dbName /
dbUser; otherwise SQLite), its migrations run, the scheduler and one queue worker.
laravelScheduler: false / laravelQueue: false skip either one (both on by default;
used only with siteType: "php" + framework: "laravel"). A failed scaffold step fails
the job with scaffold_failed. Day 2: site.laravel-status {domain},
site.laravel {domain, scheduler?, queue?, queueProcs?} and
site.artisan {domain, command} (see Laravel).
PHP from a private repository. Do not put a token in gitRepo. List the org’s Git
connections (GET /v1/git/connections, keep status: "connected"), then send the
connection’s id as gitConnectionId with the repository’s https:// clone URL on that
provider (github.com, gitlab.com or bitbucket.org). gitBranch picks a branch
(default: the repository’s default branch):
{ "type": "site.create", "domain": "app.example.com", "siteType": "php", "framework": "laravel", "gitRepo": "https://github.com/acme/private-app.git", "gitBranch": "main", "gitConnectionId": "<connection id>" }The control plane gets a fresh clone token from the connection for this job only (never
stored, masked in output) and remembers the connection for the site, so later
deploy.run jobs need no gitConnectionId. Errors: 400 bad_git_connection
(unknown connection, or the URL is not https on its provider), 502 git_token_failed
(re-verify the connection).
Node.js, Python or Go (a runtime process behind nginx)
{ "type": "site.create", "domain": "api.example.com", "siteType": "nodejs", "runtimeVersion": "22", "appPort": 3000, "startCommand": "npm start", "gitRepo": "https://github.com/acme/api.git" }appPort must be between 1024 and 65535. For Python and Go, use "siteType": "python"
or "go" with the matching runtimeVersion and startCommand.
WordPress
{ "type": "site.create", "domain": "blog.example.com", "siteType": "wordpress", "wpLocale": "en_US", "wpRedis": true }Optional WordPress fields (dbName and dbUser also apply to Laravel): method (fresh or blank), dbName, dbUser,
wpNoindex and phpVersion. The core MCP tool site_create {domain, server, apply}
also creates a WordPress site (preview first, then apply: true), but it can’t create
any other type.
The exact field list is whatever jobs_schema returns. Unknown keys are rejected.
Day-2 site operations
Section titled “Day-2 site operations”| Need | Job kind (body) | Level |
|---|---|---|
| Switch PHP version | php.switch {domain, version} | operate |
| Issue or renew TLS | ssl.issue {domain} · ssl.renew {domain?, dryRun?} | operate |
| Force HTTPS | ssl.https-redirect {domain, enabled} | operate |
| Restart the runtime process | site.restart {domain} | operate |
| Disable or enable | site.disable {domain} · site.enable {domain} | operate |
| Environment variables (runtime and PHP sites) | site.env {domain, env} (env = the full dotenv text; read it with site.env-get {domain}) | operate |
| Laravel scheduler / queue workers | site.laravel-status {domain} (read) · site.laravel {domain, scheduler?, queue?, queueProcs? 1-8} | operate |
| Laravel artisan | site.artisan {domain, command}: migrate, migrate:status, optimize, optimize:clear, config:cache, config:clear, route:cache, view:cache, cache:clear, queue:restart, storage:link, down (maintenance mode: visitors get 503, confirm first), up, about | operate |
| Logs | site.logs {domain, lines}, or core logs_tail {server, target: "site:<domain>"} | read |
| Resource limits | site.limits-set {domain, cpu?, mem?, tasks?, disk?, conc?, …} · site.limits-clear {domain} | operate |
| Git deploy pipeline (Pro) | deploy.init {domain, repo, branch, build, public, gitConnectionId?} → deploy.run {domain, ref?} (a private repo’s connection is remembered from deploy.init or site.create) | operate |
| Clone to another server (Pro) | sites_clone_xserver {id, body: {dstServerId, sourceDomain, newDomain}} | full |
| Delete | site.delete {domain} | full + sites:delete |
WordPress-only tools (wp_update, wp_cache, wp.* job kinds, the wp_* content reads
and the link manager) apply only when siteType is wordpress.
Common failures
Section titled “Common failures”400 bad_requestondomain: use a lowercase bare hostname (app.example.com), not a URL.- Job
failed: the site already exists. Checkservers_sitesfirst. - TLS skipped or failed: DNS didn’t point at the server yet, or port 80 was blocked.
Fix it, then run
ssl.issue {domain}. - Laravel job
failedwithscaffold_failed: a create step (composer,.env, database, migrations) failed; the message names it.not_laravelmeans a Laravel kind was sent for a site that isn’t PHP + Laravel. - The runtime site returns 502: the process isn’t listening on
appPort. Checksite.logsandstartCommand.