Bỏ qua để đến nội dung
Projects & environments Group apps, stacks, sites and databases from any server into projects with production, staging and other environments, share variables across them, and clone an environment, from the dashboard or over MCP and REST.

Projects & environments

Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.

Projects (/projects) group the things that make up one product, from any server, into environments such as production and staging. A project might hold the API container and its PostgreSQL database on one box, the marketing site on another, and a staging copy of both. Projects are on every plan and unlimited. Shared variables and environment clones need Pro.

A project is an organizing layer on the control plane. Adding something to a project, moving it between environments, or deleting a project never changes or deletes the app, site or database on its server.

  • A project has one or more environments (up to 20). Each environment has a kind: production, staging, preview, development or custom. A new project starts with a protected production environment.
  • An environment holds resources: apps, stacks, sites and databases, each identified by its server, kind and name (an app or stack name, a site domain, or a database as <engine>:<name>, for example mariadb:shop).
  • A resource belongs to at most one environment of one project.
  • A protected environment makes the dashboard ask twice before destructive actions. The API does not enforce it, so an AI agent should confirm with the person first.
  1. Open Projects in the sidebar and click New project. Give it a name and, optionally, a description, color and icon.
  2. Open the project. Use Add resources to file existing apps, stacks, sites and databases into an environment, or to deploy a new app or stack straight into it.
  3. Add more environments from the ⋯ menu (Environments…). You can also pick a project from any row on /sites or /apps.
  4. The project page lists its resources by type (Sites, Apps, Stacks, Databases) with live status from each server. A resource’s environment is the colored badge on its row; pick another badge to move it.

Rows open the usual drawers: apps and stacks open their detail and edit drawers (and Move to server…, see Moves & clones), sites open the site shell, databases open the server’s Databases page.

Shared variables are environment variables you define once and apply to many apps and stacks (Pro). There are three scopes, from widest to narrowest:

  1. Organization variables (Settings > Organization variables) reach only projects that have inherit org variables turned on.
  2. Project variables apply to every app and stack in the project.
  3. Environment variables apply to one environment.

Narrower scopes win, and an app’s own env value wins over all of them. Values are sealed; new keys are secret by default. Up to 200 keys per scope, single-line values.

Changes are staged: nothing reaches the servers until you Apply. Applying recreates each changed container (a brief restart), and offline servers get the new set when they reconnect. Each resource then shows a sync status: synced, pending, applying, out_of_sync or failed.

Clone … (in the ⋯ menu, Pro) creates a new environment with its variables (secret values copied sealed, or blanked for you to re-enter), then a live copy of each app and stack (a move-style clone) and a site clone for each site, with domains from a pattern such as staging.{domain} ({domain} and {env} are placeholders). Copies can land on each source’s server or all on one target server. Progress appears in the project’s status area.

REST and MCP are on every plan. Project operations span servers, so a token limited to a server allowlist is refused (fleet_wide).

TaskMCP toolREST
List projectsprojects_listGET /v1/projects
Which project each resource is inprojects_resourcesGET /v1/projects/resources
One project with live statusprojects_getGET /v1/projects/{id}
Create / edit / deleteprojects_create (name), projects_update, projects_delete (level full)POST /v1/projects, PATCH/DELETE /v1/projects/{id}
Environmentsprojects_environment_create, projects_environment_update, projects_environment_delete/v1/projects/{id}/environments[/{envId}]
File resources into an environmentprojects_resources_set (resources: [{serverId, kind, ref}], 1 to 100)PUT /v1/projects/{id}/environments/{envId}/resources
Take a resource outprojects_resource_removeDELETE /v1/projects/{id}/resources/{rid}
Shared variablesenv_vars_list, env_vars_set (Pro), env_vars_deleteGET/PUT /v1/env-vars, DELETE /v1/env-vars/{id}
Apply variablesprojects_env_apply (Pro), then projects_env_statusPOST /v1/projects/{id}/env/apply
Preview the merged setprojects_env_preview (?resource= or ?environmentId=)GET /v1/projects/{id}/env/preview
Clone an environmentprojects_environment_clone (Pro, backups:restore), projects_environment_clones, projects_environment_clone_getPOST /v1/projects/{id}/environments/{envId}/clone

A typical AI workflow:

  1. projects_create with { "name": "shop" } and keep the returned production environment id.
  2. projects_resources_set with the app, its database and the site.
  3. env_vars_set with { "scope": "project", "projectId": "…", "vars": [...] } (or dotenv), then projects_env_apply and projects_env_status.
  4. For staging: projects_environment_clone with dryRun: true to show the planned names and domains, then again without it, then poll projects_environment_clone_get.

When you deploy a new app or stack yourself, pass ?environmentId= on the deploy to file it straight into an environment.

  • 409 resource_in_project. The resource is already in another project (details.conflicts). Remove it there first.
  • 409 name_taken, 409 environment_limit, 409 last_environment. Duplicate name, more than 20 environments, or deleting the only environment.
  • Variables didn’t change the app. They are staged until applied. Run projects_env_apply and check projects_env_status.
  • 400 too_many_vars / value_required. More than 200 keys in one scope, or a new key without a value.
  • Clients never see project names. An app shared with a client appears in their “Shared with you” list without its project.