Skip to content
Playbook: create a site (any type) Create a static, PHP (plain, Laravel, Symfony), Node.js, Python, Go or WordPress site with jobs_create site.create — the fields per type, TLS, PHP switching, git deploy and verification.

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).

  1. Pick the server. Call servers_list, then servers_sites {id} to check the domain isn’t already there. servers_sites_all searches the whole fleet.
  2. Read the schema. jobs_schema {type: "site.create"}.
  3. Dispatch. jobs_create {id: <server UUID>, body: {...}} with one of the bodies below.
  4. Poll jobs_get {id: job_id} until it reaches a terminal status (usually under a minute; WordPress takes a bit longer).
  5. Verify. Run servers_sites_refresh {id}, wait a few seconds, then servers_sites {id} should list the domain. site_get {domain, server} or jobs_create site.info {domain} returns its details. Then fetch https://<domain>.

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",
"wpTitle": "Acme Blog", "wpAdminUser": "acme_admin", "wpAdminEmail": "[email protected]",
"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.

NeedJob kind (body)Level
Switch PHP versionphp.switch {domain, version}operate
Issue or renew TLSssl.issue {domain} · ssl.renew {domain?, dryRun?}operate
Force HTTPSssl.https-redirect {domain, enabled}operate
Restart the runtime processsite.restart {domain}operate
Disable or enablesite.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 workerssite.laravel-status {domain} (read) · site.laravel {domain, scheduler?, queue?, queueProcs? 1-8}operate
Laravel artisansite.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, aboutoperate
Logssite.logs {domain, lines}, or core logs_tail {server, target: "site:<domain>"}read
Resource limitssite.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
Deletesite.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.

  • 400 bad_request on domain: use a lowercase bare hostname (app.example.com), not a URL.
  • Job failed: the site already exists. Check servers_sites first.
  • 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 failed with scaffold_failed: a create step (composer, .env, database, migrations) failed; the message names it. not_laravel means 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. Check site.logs and startCommand.