TurboPanel Docs
Using TurboPanel

Deploying and running an environment

Deploying is what turns a project's description into running containers on a server. It happens at the environment — the project holds the compose document; the environment is one copy of it, on one server (or a set of servers), with its own hostnames, storage and variables. This chapter covers the whole life of an environment: choosing where it runs, previewing what will be sent, deploying and redeploying, stopping and starting, destroying, reading logs and history, and what every refusal means.

The model

A deploy is a command the control plane sends to the daemon on the target server. The control plane does the thinking — it merges the project compose with the environment's overlay, resolves variables and secrets, schedules services across servers, allocates addresses, and compiles one runtime compose.yaml per participating server. The daemon does the doing — pulls images, checks out and builds source releases, writes the files, and runs Compose. What you see in the app is the command's progress, polled until it reaches a terminal state.

Three consequences shape how the buttons behave:

  • Nothing runs until a server is chosen. An environment resolves its server from its own pin or the project's default; without one, Deploy is disabled and points you at the Hosting tab.
  • Preview is free; Deploy is a command. Preview shows exactly what would be sent without sending it. Deploy enqueues a command that the app tracks to completion.
  • The daemon is the source of truth for status. Container status is what the daemon last reported; the app refreshes it after each tracked command and on Refresh, not on a timer.

Before you begin

  • A connected server in the organization (Servers shows Online).
  • A saved compose document with no blocking lint findings.
  • For any site or Node app in the document, a system user assigned — Deploy stays disabled with No system user — assign one in Bindings until then.
  • Manage rights on the organization.

Placement and scheduling

Open the project's Hosting tab. At Project scope, set Default project server; at an environment's scope, set its Server pin (or clear it to inherit the default).

Back on the environment's Overview, the lifecycle bar now shows Preview ▾ and Deploy instead of No server — set one in Hosting.

The pin is the anchor. Services that declare deploy.replicas or deploy.placement.* are placed by the planner across the organization's connected servers, respecting host-port conflicts, co-location and spread constraints and the per-server replica cap; services on more than one server must share a spanning (driver: overlay) network, which a shared trusted LAN or TurboFabric carries. Preview ▾ → Prepared compose shows one block per server whenever the plan spans more than one host.

Any connected server is a valid target, including the host a self-hosted control plane runs on. A one-server installation can deploy to itself.

Preview

Preview ▾ on the lifecycle bar opens Compose Preview.

Merged compose (the default) is the project compose with the environment's overlay applied, plus the live placement shown as x-turbopanel.placement for reading only — the stored document never holds it.

Prepared compose (via the caret) fetches what the daemon would receive: the compiled runtime compose.yaml, the generated .env of non-secret variables, the file paths secrets will be materialized at, and one YAML block per server when the plan spans more than one.

For a Node app the prepared preview also lists every variable its process will get and where each one was set; see Variables on a Node app.

Prepared preview runs the same validation Deploy does, so a refusal shows up here first — same code, same message.

Deploy, redeploy, cacheless

Deploy (an environment with nothing deployed) or Redeploy ▾ (one that has containers) opens Confirm Deployment, showing the prepared compose.

Confirm. The command is enqueued and the bar tracks it — queued, sent, acked, running, then succeeded or failed — and container status refreshes when it lands.

Redeploy ▾ → Cacheless redeploy sends the same command with noCache: true, so image pulls and source builds ignore their caches. Use it when a latest tag moved or a build cache is suspect.

A redeploy with no change is a no-op: the platform hashes the compose document together with each source service's resolved commit, and the daemon skips work whose hash it has already applied. Push a commit or change the document, and the same button does real work.

Health-check gates

Each service carries a Health check policy (its settings page): disabled, warn, or required. At deploy, a service with policy required and no healthcheck in its compose refuses the deploy outright (health_check_missing with required: true). A service with policy warn and no health check stops the deploy once with a prompt naming the services; confirming sends the deploy again with the warning acknowledged.

Deploy strategies

An environment has a deploy strategy, which decides how the new version replaces the old one.

StrategyWhat a deploy doesRolls back on its own?
sequentialStops the old version, runs any pre-deploy migration, starts the new version, then waits for every service to be healthy. This is the default for every new environment.Yes, while it is still safe (see below).
inplaceBrings the new containers up over the old ones, then waits for them to be healthy before it reports done. A service with no health check adds at least 30 s to every deploy, and the wait is capped by healthTimeoutSeconds (default 120 s). The strategy an environment created before it existed keeps.No: a service that does not become healthy fails the deploy, the new containers stay up so you can inspect them, and the hostings and certificates are not updated.
bluegreenStarts the new version beside the old one, then switches traffic. Coming in 0.2.x.—

A sequential deploy goes in this order:

  1. Prepare — networks, image pulls and source builds. If this fails, nothing has been stopped and the old version is still serving; the deploy simply fails.
  2. Stop the old version. Services that keep data on a writable volume (databases and the like) stay running so a migration has something to talk to.
  3. Migrate — any pre-deploy command runs. From here on the schema may have changed.
  4. Start the new version, then the health gate: every service must be healthy. A container with a healthcheck must report healthy; one without must stay running for a short stable window; a one-shot service must exit cleanly; a container that exits with an error or keeps restarting fails the gate. The gate gives up after healthTimeoutSeconds.

What the health step reports

The progress bar shows Check Service Health while a deploy waits for the new version. It has one live line that updates in place (for example Attempt 4, 6 s of up to 120 s: web health check is starting), and it ends under the title of what was actually proven, with the time it took:

Step ends asWhat it means
Service Is HealthyDocker reported the service's own health check as healthy. The line reads Healthy after 12 s.
Service Is RunningThe service has no health check, so the only thing checked was that its container stayed running for the stable window (30 s, or the health timeout if shorter). The transcript says this once, when the wait starts.
Service Is ReachableA site owner's Node or Deno app (started directly, without a container) answered an HTTP request on its loopback port. Any status code counts as an answer, so this proves the app is listening, not that it is healthy.
Service Health Not CheckedNothing in the deploy reports its own health: a stack made only of one-shot jobs that exited cleanly, or a deploy with no containers or apps.
Service Did Not Become Healthy or Service Did Not AnswerThe wait ended without a pass. The line gives the time waited and the last status, for example Did not become healthy within 120 s; last status: web (a1b2c3d4e5f6) health check is starting.

Known limits: a deploy that mixes Node or Deno apps with containers checks the apps first and the containers second, and the step ends with the result of the containers. On inplace (as on sequential) the wait happens before the post-deploy hooks run, so a service that only becomes healthy after a post-deploy hook now times out and fails the deploy. A stack that passed before can also fail now: a job that exits with an error, or a service stuck restarting. Services behind Compose profiles that are not enabled are not waited on. The rail shows the time the service first answered next to the line.

How a sequential deploy that does not finish ends is shown in Deployment history instead of a plain Failed:

OutcomeMeaningWhat to do
Rolled back (rolled_back)The new version failed before any migration ran, so the previous version was started again and is serving.Fix the cause (the history row gives the reason) and deploy again.
Needs attention (needs_attention)The environment was left stopped on purpose, or the previous version could not be restored. The usual cause: a migration had already run, so the old code is never started on a changed schema.Read the reason, fix forward and deploy again, or restore from a backup. Check the environment before assuming it is serving.

An environment that declares migrations: breaking is treated as past the point of no return from the start, so a failed health gate there is always Needs attention. A first deploy has no previous version to go back to, so a failure is an ordinary failure.

The strategy is set on the environment's options through the API (there is no screen for it yet), next to the compose overlay:

OptionValuesDefault
deployStrategyinplace, sequential, bluegreensequential for a new environment, inplace for an existing one with none set. bluegreen is accepted but runs as sequential until it is built.
migrationsnone, compatible, breaking, unknownunknown. Unknown is never treated as none.
healthTimeoutSeconds10 to 3600120
drainSeconds0 to 360030 (used by bluegreen)
rollbackWindowMinutes0 to 14400 (used by bluegreen)

A project's options may carry the three numbers as defaults for its environments; an environment's own value wins. Send null for a key to clear it. A value out of range, or a key that does not belong (a project cannot set deployStrategy), is refused with deploy_options_invalid and the field is named. Preview (GET /environments/:id/deploy-preview) reports the strategy requested, the one that would really run (effectiveStrategy), the migration status and, when the two differ, the fallbackReasons.

Rolling deploys across servers

An environment whose services land on more than one server (through deploy.replicas or deploy.placement, see Placement and scheduling) is deployed to each of them. A sequential deploy (and bluegreen, which runs as sequential for now) then updates the servers in batches, sized by the Compose deploy.update_config.parallelism of its services:

YAML
services:
  web:
    deploy:
      update_config:
        parallelism: 2   # two servers at a time
SettingEffect
parallelism (whole number, 0 or more)How many servers update at once. Default 1. 0 means every server at once. A negative or fractional value is refused.
Several services set itThe lowest value wins; 0 yields to any other value.
failure_action: pause or rollbackAccepted. Both stop the rollout when a server fails, exactly as the default does. rollback does not undo servers that already updated.
delay, monitor, order, max_failure_ratio, failure_action: continueRefused at deploy with compose_field_unsupported (a warning while you save), so nothing is silently ignored.

Only the first batch is queued. Each next batch is queued when every server in the batch before has applied the deploy. A single-server deploy is unchanged. The deploy response and the preview report rollout as { parallelism, batches }.

When a batch fails. The first server that fails or times out stops the rollout. Servers that have not started are marked failed in Deployment history with the reason rollout stopped … this server was not started, and their commands are cancelled. Servers that were already running finish. Servers that updated in an earlier batch stay on the new version: nothing rolls them back, so the environment can be left on two versions until you fix the cause and deploy again. Each server's own sequential deploy still rolls back to its previous version when it can (see the outcomes above).

An inplace environment ignores parallelism: it updates every server at once and reports parallelism: 0. A compose document that sets it gets a non-blocking warning from Preview and Deploy (deploy.update_config.parallelism is ignored: this environment deploys inplace); set the environment's deployStrategy to sequential to use it.

Coming in 0.2.x

Blue-green deploys, which keep the old version serving until the new one is healthy and then switch, are not built yet. Until they are, asking for bluegreen gives a sequential deploy. The other Swarm update_config settings are refused, as above.

Cancel a deploy

A deploy that is still waiting or running can be stopped. The previous version keeps serving and nothing is changed.

While a deploy is going, a notice above Deployment history shows Cancel deploy. Only people who can manage the environment see it.

Press it and confirm. The app asks once: Cancel this deploy? The current version keeps running and nothing is changed. You can deploy again any time. Choose Cancel deploy, or Keep deploying to carry on.

The notice reads Cancelling… while the server stops. The history row then ends as Cancelled, with a note that nothing changed and the previous version is still running.

What a cancel does depends on how far the deploy got:

The deploy isWhat happens
Queued, nothing sent to a server yetCancelled at once.
Running, before the server switches anything overThe server is told to stop. Git, the build and image pulls are stopped and the scratch files are cleaned up. The deploy reads Cancelling until the server reports back, then Cancelled.
Running, already switching overToo late. The deploy finishes normally and the history row says Finished before it could be cancelled.
FinishedNothing to cancel: This deploy has already finished.

The switch-over starts at the first step that changes what is being served: swapping a site or Node app release, running pre-deploy hooks, or stopping the old containers. A deploy with several Git services is past that point at its first release switch, so a cancel during the second service's build answers too late. A cancel stops the whole deploy, on every server of that deploy and any rollout batch still waiting. Cancelling a deploy that is already cancelled changes nothing.

Cancelling asks for no extra sign-in, because deploying again fully reverses it. It needs the same permission as deploying and stopping, and it is recorded in the audit log as deployment.cancel. A server whose daemon is too old to cancel refuses with cancel_unsupported and nothing changes; update the daemon first.

Start, stop, restart, destroy

ActionWhereWhat it doesData volumes
StopLifecycle barStops the environment's containers. Files, images and volumes stay on the server.Kept
StartLifecycle bar (shown when deployed but stopped)Starts the existing containers again. No preview, no rebuild.Kept
RestartAPI (action: restart)Stop then start.Kept
DestroyLifecycle bar, two pressescompose down --volumes: removes the containers, their networks, the site and Node releases, the secrets on disk and the hostnames from the server's web server. Only volumes Compose made itself go (anonymous ones, and ones whose compose entry sets its own name:).Kept, unless you tick Also Delete the Data Volumes

Stop and Start only touch existing containers, so they stay available even when Deploy is disabled for a missing system user.

Destroy and the data volumes

A Destroy keeps the environment's data volumes: the Docker volumes listed on its Storage tab, including the ones TurboPanel registered from your compose file. A later deploy finds the data where it left it.

To delete the data as well, tick Also Delete the Data Volumes when you arm Destroy. It is off every time. Ticked, the web interface lists the volumes that will be deleted and the ones that stay, and asks you to type the environment name before Confirm Destroy works. Each server the environment runs on removes the listed volumes once the containers are down. If the list changed before you confirmed, nothing is destroyed and the web interface shows the new list. A copy of a volume on a server the environment no longer runs on stays there, and the list says which server. Deleted data cannot be brought back.

Some volumes always stay, and the list says why:

  • a shared (common) volume, or one another environment uses;
  • an external volume your compose file names (external: true), which TurboPanel did not create;
  • a volume whose Docker name is not the one TurboPanel gave it;
  • a volume a container still uses when the server comes to remove it.

Deleting data needs the right to delete the environment, and every server the environment runs on needs a daemon that can do it; with an older daemon the web interface says which server to update and nothing is destroyed. The audit log records environment.data.delete with the volume names.

What Destroy leaves on the server

Destroy takes the environment off its servers; the environment and its settings stay in the app. On each server it also leaves:

  • Each service's folder under /srv/users/ (see Where your files live), with its uploads and logs. Only the published releases inside it are cleared.
  • What a service wrote through a relative bind mount such as ./data, in the environment's deployment folder. Only the daemon's own compose files are removed from that folder, so the stack does not come back after a restart of the server.
  • Images pulled from a registry or carrying a tag of their own. Only images built for this environment are removed.
  • The project's Hosting Accounts.
  • The data volumes, unless you ticked Also Delete the Data Volumes (see above).

The next deploy finds the folders and the ./data files where they were.

When a server leaves an environment

A server leaves an environment when a deploy no longer places the environment there: the pin moved to another server, or deploy.replicas or deploy.placement no longer picks it. That deploy sends the server it left the same teardown as Destroy, with one difference: each service's folder on that server is removed too, uploads included. The ./data files in the deployment folder, volume folders and Hosting Accounts stay on that server. Nothing is copied to the new server.

Deleting the environment (see Projects) goes further on every server it ran on: it also removes the deployment folder with its ./data files, every service folder, and the folder of each volume whose retention is delete. A volume whose retention is retain keeps its folder. Hosting Accounts that nothing else uses on that server are removed afterwards.

Container status and logs

The environment's Overview lists each service's containers with a status badge from the daemon's last report. Refresh asks again.

Logs on a container opens a live tail of its stdout and stderr, streamed from the host on demand. It is never stored: close the panel and it is gone. For the record of what a deploy did, see the next section.

Service run state

Besides each container's badge, the daemon reports one run state per service, so a service that starts and then dies shows as a crash and not as a healthy deploy. It is the latest report, not a history, and it is not there until the service's server has reported it. Read it as runState on GET /services and GET /services/:id:

StateMeaning
startingThe container was just created, has been up for less than 60 seconds, or its health check has not passed yet.
runningIt has stayed up for 60 seconds. Only this state sets running: true.
unhealthyIt is up and its health check is failing.
crashingDocker keeps restarting it.
stoppedThe container is down (exited, dead or paused) and has not crashed over and over.
stopped_after_crashesIt is down after a failed exit and 10 or more restarts.
unknownDocker reported a state the daemon does not recognise.

restartCount is how many times Docker has restarted it, lastError is the last log line of the failing container (at most 400 characters) and asOf is when the state last changed. A service that runs on several servers or containers reports its worst state. A deploy that dies ten seconds in is never shown as running.

This is reporting only. It does not change any restart policy: a service deployed with restart: always is reported crashing for as long as it keeps looping.

Deployment history

Deployment history on the environment's Overview lists past deploy attempts with their outcome, who or what started them (a person, the system, or Push to <branch> with the short commit when a git push did) and, for each, the transcript the daemon produced — image pulls, builds, the Compose output — kept for 90 days by default (an operator can change TURBOPANEL_EXECUTION_LOG_RETENTION_DAYS).

A deploy or command that fails shows one line that names the cause as the headline of its row, taken from the end of the daemon's output (a playbook failure ends with the failed task's own message). Show full error opens the rest. Signed download links in an error are removed before the text is stored.

A sequential deploy also names the engine it ran (Sequential or In place) and, when it did not finish, Rolled back or Needs attention with the reason; see Deploy strategies.

A deploy that never finished is recorded as stalled, with one of two reasons:

OutcomeMeaningSafe to deploy again?
stalled_undeliveredThe daemon never acknowledged the command — it was offline or the control plane restarted before delivery. Nothing happened on the host.Yes.
stalledThe daemon acknowledged the command but never reported an outcome — a restart mid-run on either side. It may still be running on the host.Check the host first.

Reference

POST /environments/:id/deploy

FieldTypeMeaning
acknowledgeHealthCheckWarningsbooleanProceed past the warn health-check prompt. Never bypasses required.
noCachebooleanCacheless redeploy.
strategyinplace | sequentialRun this one deploy with that strategy instead of the environment's. bluegreen is refused with 501 deploy_strategy_unsupported.
migrationstringRefused with 501 deploy_strategy_unsupported for now; declare the migration status on the environment.
refstringRefused with 501 source_ref_unsupported — services deploy their compose-declared branch, and accepting a ref the build would ignore is the one outcome a caller could not detect. Omit it.

Response: the queued command's id and the URL to poll. GET /environments/:id/deploy-preview returns the prepared shape without enqueueing.

POST /environments/:id/lifecycle

{ "action": "start" | "stop" | "restart" }. Operates on existing containers only.

POST /environments/:id/deployments/:deploymentId/cancel

Cancels a queued or running deploy. :deploymentId is the deploy's command id from the history. The answer is 200 with state set to cancelled (it was queued), cancelling (the server was asked to stop) or already_cancelled. It needs the same permission as deploy (manage on the environment). Refusals are listed under Cancel.

POST /environments/:id/stop

Destroy. Removes containers, tears down hostnames and releases, and keeps the registered data volumes. Send {"deleteVolumes": true, "confirmName": "<environment name>", "volumeIds": [...]} to delete them too, with the storage ids GET /environments/:id/data-volumes listed. A missing or wrong name is refused with confirm_name_required, a list that changed with data_volumes_changed, and a server with an older daemon with delete_volumes_needs_daemon_update, all before anything stops.

Command statuses

queued → dispatching → sent → acked → running → one of succeeded, failed, timed_out, cancelled. Commands carry a delivery deadline; one the daemon never picks up becomes timed_out and is recorded in history as stalled with the reason above. A deploy that is running also becomes timed_out when it runs past the organization's deploy time limit: 30 minutes by default, or a whole number from 5 to 240 minutes set by an organization manager. The time is counted only while the server keeps reporting; a server on an older daemon keeps a fixed 10 minute limit.

The prepared shape

PartContent
composeFiles[]One compose.yaml per participating server, role runtime.
.envNon-secret variables, ${service__KEY} interpolation resolved.
secretPlan[]The file path each secret will be materialized at under /run/turbopanel/deployments/<project>/<environment>/secrets/. Values travel sealed, never in YAML.
servers[]Present only when the plan spans more than one host.

Errors

Every refusal carries a stable error code and, where useful, a message and the offending names. Grouped by what to do about them.

Fix the document

CodeStatusMeaning
compose_empty400The merged document has no services.
compose_merged_invalid422Project and overlay each saved cleanly but their merge is not valid Compose. Open Preview ▾ → Merged compose.
compose_field_unsupported422An unsupported key is present; the message quotes why. Remove it.
compose_field_requires_org_opt_in403A host-level feature — a gated key (privileged, cap_add, use_api_socket, …) or a path outside the service's directory — and the organization has not turned them on. An owner enables them with PUT /organizations/:id/compose-privileged-fields. See Host-level features.
compose_host_access_requires_manager403Host-level features are on, but only an organization manager or owner can deploy them.
compose_host_access_requires_approval403A Git-triggered deploy of host-level content no manager or owner has deployed in this form. Deploy it once from the app.
invalid_deploy_hosting, invalid_deploy_storage400A hosting or storage row attached to the environment is malformed; the message names it.
principal_alias_unknown, principal_required_for_service_kind, site_principal_ambiguous, source_principal_ambiguous, site_cron_unowned, site_managed_directory_unowned422Ownership of a site or Node app is missing or ambiguous — declare x-turbopanel.principal, or assign a system user on Bindings.
source_ref_unresolved422A source service's branch does not exist or the provider refused the lookup.
variable_unresolved, variable_ref_invalid, variable_secret_interpolation422A ${KEY} reference has no value at any scope, is malformed, or interpolates a secret into a plain field.
docker_external_network_unregistered422external: true names a network not registered under Network → Docker networks.
datacenter_ip_required422A hosting row binds to the datacenter scope on a server with no datacenter network address.
cache_key_conflict422A cache would set a variable name that a service or hostname variable already sets. Rename the variable or change the cache's variable prefix.
helper_reach_invalid422A container's reach breaks a rule (more than one copy, not a site or Node app, services under different Hosting Accounts, or an account not set up yet). See Project caches.

Fix the placement or the servers

CodeStatusMeaning
server_placement_required409No server resolves for the environment — set the pin or the project default on Hosting. Also the answer when the planner finds no eligible server.
turbofabric_required422Services placed on different servers share a network that is not driver: overlay, or an overlay network reaches a server in another datacenter network while TurboFabric is off (the message names the servers). An overlay network whose servers all share a trusted LAN needs no TurboFabric.
host_port_conflict422Two services on the same server publish the same host port.
constraint_unsatisfiable, colocation_conflict, max_replicas_per_node_exceeded422The planner cannot satisfy deploy.placement or deploy.replicas with the servers available; the message names the constraint.
resource_limit_exceeded409A service asks for more CPU or memory than the organization or server ceiling allows.
fabric_reconcile_pending409TurboFabric is still converging on a server the plan needs; retry shortly.
fabric_reconcile_failed422TurboFabric could not converge; see the server's Network tab.
storage_location_unavailable422A storage entry's primary copy lives on a server other than the one scheduled, and its access mode does not allow that; the message names both servers.
daemon_update_needed409The environment has a project cache or a helper port and the target server's daemon does not support them yet. Update the daemon on that server.

Fix hostnames or TLS

CodeStatusMeaning
hosting_route_conflict409Two hosting rows in the environment claim the same hostname and path.
hosting_hostname_conflict409A hostname declared in compose is already served by another hosting in the organization.
hosting_tls_ref_unresolved, hosting_ip_ref_unresolved422A certificateRef or ipRef names something the organization does not have.
tls_pin_not_found, tls_pin_mismatch, tls_pin_not_ready400The pinned library certificate is gone, does not cover the hostname, or is not ready yet.
acme_requires_public_bind, acme_requires_org_opt_in, letsencrypt_hostname_unsupported400A Let's Encrypt certificate (a pinned library row, or compose tls.mode: automatic) needs a public bind, a name Let's Encrypt can issue for, and Allow Let's Encrypt certificates under Organization settings › Domains & certificates. The message names what to change. See Certificates.

Acknowledge and retry

CodeStatusMeaning
health_check_missing409Services with no healthcheck. required: true refuses; required: false is the warn prompt — resend with acknowledgeHealthCheckWarnings: true.
binding_endpoint_unavailable422A bound managed database has no listener endpoint yet; wait for its cluster to finish applying.
source_ref_unsupported501A ref was sent. Omit it.
deploy_strategy_unsupported501strategy: bluegreen or a per-deploy migration was sent. Use inplace or sequential and omit migration.

Cancel

CodeStatusMeaning
deploy_not_cancellable409The deploy has already finished.
deploy_too_late409The server is already switching over and will finish the deploy.
cancel_unsupported409The server's daemon is too old to cancel deploys. Update it.
daemon_unavailable503The control plane has no link to the server.
Edit on GitHub

Last updated on

On this page