Skip to content

Deployment Configuration ​

SurgePilot stores deployment settings in a root .env file. Normal users do not need to create this file by hand: the official startup command creates it on the first run, generates private values, validates the result, and keeps it for later starts.

Choose the correct template ​

SurgePilot intentionally has two templates because the release and source lifecycles have different networking, Runtime, and build requirements.

DeploymentTemplate in this repositoryOrdinary command
Tagged releaseinfra/release/.env.example, shipped inside each immutable release payloadsurgepilot up or ./surgepilot up
Source checkoutRoot .env.examplemake start-full-stack or make start-preview

Do not copy one template over the other. The release template requires final node-facing LAN origins and secure-cookie intent. The source template contains development ports, source-build mirrors, and locally generated Runtime inputs that do not belong in a release deployment.

For an installer-managed release, the generated .env stays at the deployment root while release payloads live below .releases/vX.Y.Z. Supported upgrades preserve that root .env; do not move or duplicate it into a version directory.

How .env is managed ​

  1. If .env is missing, official startup copies the correct template, generates the private bootstrap values, and writes owner-only deployment state.
  2. If .env already exists, startup treats it as authoritative. It does not overwrite, rotate, or repair existing values.
  3. Bootstrap values explicitly supplied through the process environment are persisted only during first-run creation. Supplying a conflicting value on a later run fails closed.
  4. Release first-run asks for the host and two published ports, then persists the final API and InfluxDB node-write origins. On later interactive starts, answering No at the configuration confirmation can update only those four network fields.
  5. Source startup does not use the release reconfiguration flow. Edit the source .env deliberately when an override is needed.

After a manual change, run surgepilot up for a release or make restart-full-stack for a running source stack. Both paths validate the effective configuration before starting services.

Keep generated secrets stable

Do not rotate deployment secrets by editing .env. In particular, losing or changing the SSH credential encryption key makes existing stored Load Node credentials unreadable. Existing database and object-storage volumes also retain the identities used when they were initialized.

Reading the reference ​

  • No means the generated or template value is suitable for ordinary use.
  • First run means the release prompt supplies the deployment-specific value.
  • Conditional means change it only for the described deployment mode.
  • Advanced means leave it unchanged without an operational reason and a restart plan.
  • Managed means an official startup or Runtime command supplies the value; do not persist it manually in normal use.
  • Not present means that template does not expose the setting.

Startup and network settings ​

VariableReleaseSourceConfigure? Meaning
COMPOSE_PROJECT_NAMEsurgepilotsurgepilotNo. Docker Compose resource namespace. Changing it selects a different stack and different named volumes.
SURGEPILOT_HTTP_PORT80808080First run for release; conditional for source. Host port published by Nginx for the Web UI, API, and Grafana path. Use a free port.
POSTGRES_HOST_PORTNot present5432Source only, conditional. Host port published by the source PostgreSQL service. Release PostgreSQL is not published.
SURGEPILOT_API_HOST_PORTNot present8000Source only, conditional. Direct host port for the source API container; this is separate from the normal Nginx entry.
DEFAULT_WORKSPACE_NAMEDefault WorkspaceDefault WorkspaceConditional. Name used when the first Admin creates the initial Workspace. It does not rename an existing Workspace.
SURGEPILOT_NODE_API_BASE_URLActive LAN example, replaced at first runCommented exampleFirst run for release; conditional for source external nodes. Final API origin reachable by Load Nodes. Source Demo uses a Compose-internal origin when this is absent. A DB-backed System Setting can override the application fallback.
SURGEPILOT_MONITORING_INFLUXDB_HOST_PORT80868086First run for release; conditional for source. Host port published for authenticated Load Node writes to InfluxDB. It must differ from the HTTP port.
SURGEPILOT_MONITORING_INFLUXDB_NODE_WRITE_URLActive LAN example, replaced at first runCommented exampleFirst run for release; conditional for source external nodes. Final InfluxDB origin reachable by Load Nodes. Set it together with the node API origin.
SESSION_COOKIE_SECUREfalseNot presentConditional. Release HTTP mode requires false; an operator-managed HTTPS deployment sets true and uses an HTTPS node API origin.
SURGEPILOT_DEMO_LOAD_NODE_ENABLEDfalsetrueConditional. Enables the optional Compose-internal Demo Load Node. Release defaults it off; the source full stack defaults it on; preview forces it off without rewriting .env.
SURGEPILOT_RUNTIME_ARCHITECTURESamd64,arm64autoNo for normal startup. Architectures prepared for Load Node Runtime assets. Release first-run keeps both supported architectures; source auto selects the native Docker daemon architecture. Valid values are auto, amd64, arm64, and amd64,arm64.
APP_ENVNot presentdevelopmentSource direct-host development only. Selects application environment defaults. Official Compose supplies its own fixed value.
DATABASE_URLNot presentLocal PostgreSQL URLSource direct-host development only. Database connection used by make dev-api, make dev-worker, and migrations outside Compose. Official Compose supplies an internal URL.
MINIO_ENDPOINTNot presenthttp://localhost:9000Source direct-host development only. MinIO endpoint for API processes outside Compose. Official Compose supplies its internal endpoint.

Deployment identity, secrets, and MinIO ​

VariableTemplate valueConfigure? Meaning
RUNNER_INTERNAL_TOKENPlaceholder replaced with a random tokenManaged. Shared internal authentication material used between the API and Runner. Keep it private and stable.
SSH_CREDENTIAL_ENCRYPTION_KEYPlaceholder replaced with a random base64 keyManaged. AES-256-GCM key for stored Load Node credentials. It must decode to exactly 32 bytes and must remain stable while the database is reused.
MINIO_BUCKETsurgepilotNo. Object-storage bucket used for dependency files and Run artifacts.
MINIO_ACCESS_KEYminioadminNo for the bundled service. API-side MinIO access identity. It must equal the MinIO root user in the bundled deployment.
MINIO_SECRET_KEYPlaceholder replaced with a random passwordManaged. API-side MinIO secret. It must equal the MinIO root password in the bundled deployment.
MINIO_ROOT_USERminioadminNo for the bundled service. MinIO initialization user; must match the access key.
MINIO_ROOT_PASSWORDSame generated value as the MinIO secretManaged. MinIO initialization password; must match the API-side secret. Changing it does not reinitialize an existing MinIO volume.
MINIO_REGIONCommentedAdvanced, direct-host only. Optional region passed to the MinIO client when the endpoint does not already determine it. Official Compose does not pass this override.
MINIO_SECURECommented, default falseAdvanced, direct-host only. Enables TLS when a scheme-less direct-host MinIO endpoint is used. An explicit https endpoint already selects TLS.
VariableTemplate valueConfigure? Meaning
SURGEPILOT_MONITORING_INFLUXDB_USERNAMEsurgepilotNo for ordinary first run. InfluxDB initialization username. Do not expect edits to reinitialize an existing volume.
SURGEPILOT_MONITORING_INFLUXDB_PASSWORDPlaceholder replaced with a random passwordManaged. InfluxDB initialization password. It must not begin with -, because the setup CLI parses such a value as a flag.
SURGEPILOT_MONITORING_INFLUXDB_TOKEN_FILE_HOSTExample path replaced with a private generated fileManaged. Host path mounted as the InfluxDB token secret. Official startup creates the private token file and writes the correct path for the selected layout.
SURGEPILOT_MONITORING_INFLUXDB_ORGsurgepilotNo. InfluxDB organization used by setup, the Backend Listener, and monitoring links.
SURGEPILOT_MONITORING_INFLUXDB_BUCKETjmeterNo. InfluxDB bucket receiving Standard Run metrics.
SURGEPILOT_GRAFANA_ADMIN_USERadminConditional. Grafana bootstrap Admin username. Set it before the Grafana volume is initialized if a different name is required.
SURGEPILOT_GRAFANA_ROOT_URLCommented, Grafana subpath expressionAdvanced. Grafana server root URL used when it is served below /grafana/. The template value matches the bundled proxy layout.
SURGEPILOT_MONITORING_DASHBOARD_UIDCommented, surgepilot-jmeter-13644Advanced. UID used to build links to the provisioned read-only JMeter dashboard. Change only with matching Grafana provisioning.
SURGEPILOT_MONITORING_DASHBOARD_SLUGCommented, jmeter-load-testAdvanced. Slug used to build links to the provisioned dashboard. Change only with matching Grafana provisioning.
SURGEPILOT_MONITORING_ENABLEDCommented, default false for a direct-host APIDirect-host only. Official full-stack Compose enables monitoring explicitly, so this .env override does not disable bundled monitoring.
SURGEPILOT_MONITORING_INFLUXDB_TOKEN_CONFIGUREDCommented, default false for a direct-host APIDirect-host only. Tells a directly started API whether monitoring token state was configured externally. Official Compose supplies the correct value.
SURGEPILOT_MONITORING_GRAFANA_BASE_PATHCommented, /grafanaDirect-host only. Base path used for generated Grafana links. Official Compose fixes the bundled path to /grafana.
SURGEPILOT_MONITORING_TIME_PADDING_SECONDSCommented, 60Advanced. Seconds added around a Run time range when generating monitoring links.

The InfluxDB initialization username, password, organization, and bucket must not start with -; the InfluxDB setup CLI would parse such a value as a flag.

Source Runtime and image-build settings ​

These settings exist only in the source template. Tagged releases pull pinned application images and validated Runtime assets instead of building them from source.

VariableTemplate valueConfigure? Meaning
LOAD_NODE_RUNTIME_VERSIONCommentedManaged. Runtime version written to generated runtime.env state by the official Runtime builder.
LOAD_NODE_RUNTIME_ARTIFACT_HOST_DIRCommented absolute-path exampleManaged. Host directory written to generated Runtime state and mounted read-only into API services.
SURGEPILOT_SKIP_RUNTIME_PREFLIGHTCommented, 1Advanced manual/debug only. Skips Runtime preparation for source full-stack startup. It does not skip deployment bootstrap and does not promise Load Node or Run readiness.
RUNTIME_JMETER_SHA256CommentedAdvanced. Optional expected checksum supplied to the source Runtime builder for its JMeter download.
RUNTIME_CASUTG_SHA256CommentedAdvanced. Optional expected checksum supplied to the source Runtime builder for the Concurrency Thread Group plugin.
RUNTIME_JSON_SHA256CommentedAdvanced. Optional expected checksum supplied to the source Runtime builder for the JSONPath plugin.
RUNTIME_TST_SHA256CommentedAdvanced. Optional expected checksum supplied to the source Runtime builder for the Throughput Shaping Timer plugin.
RUNTIME_RANDOM_CSV_SHA256CommentedAdvanced. Optional expected checksum supplied to the source Runtime builder for the Random CSV Data Set plugin.
RUNTIME_INFLUXDB2_LISTENER_SHA256CommentedAdvanced. Optional expected checksum supplied to the source Runtime builder for the InfluxDB2 listener plugin.
SURGEPILOT_PIP_INDEX_URLCommented mirror exampleConditional. Python package index used by source Docker builds and the Runtime builder. Leave unset for the upstream default.
SURGEPILOT_NPM_REGISTRYCommented mirror exampleConditional. npm registry used by the source Web image build. Leave unset for the upstream default.
SURGEPILOT_DOCKER_BUILD_UBUNTU_APT_MIRRORCommented invalid exampleConditional. Ubuntu package mirror used only during source Docker builds. Replace the example with a real mirror before enabling it.
SURGEPILOT_DOCKER_BUILD_UBUNTU_APT_SECURITY_MIRRORCommented invalid exampleConditional. Ubuntu security mirror used only during source Docker builds.
SURGEPILOT_DOCKER_BUILD_DEBIAN_APT_MIRRORCommented invalid exampleConditional. Debian package mirror used only during source Docker builds.
SURGEPILOT_DOCKER_BUILD_DEBIAN_APT_SECURITY_MIRRORCommented invalid exampleConditional. Debian security mirror used only during source Docker builds.
VITE_API_BASE_URLCommented direct-API exampleAdvanced source build only. Build-time seed for the Web client. The bundled Web runtime uses same-origin /api, so ordinary deployments leave it unset.

DB-backed System Settings fallbacks ​

The following .env values are used only when the corresponding database System Setting is absent. For normal policy changes, use Admin → System Settings instead of editing .env. A deployment restart is required for an environment fallback change to be loaded; an existing DB value still wins.

VariableFallbackMeaning
ALLOW_SIGNUPtrueWhether users after the first Admin may register. The first Admin bootstrap remains available when setup is incomplete.
DEPENDENCY_FILE_MAX_BYTES104857600Maximum dependency-file upload size in bytes.
DEPENDENCY_FILE_ALLOWED_EXTENSIONSEmptyComma-separated allowlist. Empty means no extension allowlist is applied; filename safety checks still apply.
DEPENDENCY_FILE_PREVIEW_MAX_BYTES65536Maximum bytes returned by the single-file text preview.
DEPENDENCY_FILE_PREVIEW_BINARY_DENY_EXTENSIONSTemplate extension listComma-separated extensions that are never rendered as text previews.
SURGEPILOT_MAX_SCENARIO_ITEMS_PER_TEST_PLAN20Maximum enabled Scenario items in one Test Plan.
SURGEPILOT_SINGLE_NODE_CONCURRENCY_SOFT_LIMIT1000Per-node concurrency threshold that requires explicit high-concurrency confirmation.
SURGEPILOT_MAX_RUN_DURATION_SECONDS86400Maximum configured Run duration.
SURGEPILOT_MAX_RAMP_UP_SECONDS86400Maximum ramp-up duration; it cannot exceed the effective Run-duration limit.
SURGEPILOT_MAX_DELAY_SECONDS86400Maximum configured start delay.
SURGEPILOT_MAX_ITERATIONS1000000Maximum iteration count in an iteration-based load model.
SURGEPILOT_MAX_TARGET_RPS100000Maximum target requests per second accepted by load-model validation. This is a configuration ceiling, not a performance claim.
SURGEPILOT_MAX_SLA_RULES_PER_TEST_PLAN5Maximum enabled SLA rules in a Standard Test Plan.
SURGEPILOT_JMETER_MEMORY_XMX4GJMeter maximum heap written into execution configuration. Valid values are a positive integer followed by K, M, or G.

Advanced operational guardrails ​

These values already have application and Compose defaults. Leave them commented unless measured behavior justifies a change. A restart is required.

Load Node initialization ​

VariableDefaultMeaning
LOAD_NODE_INIT_COMMAND_TIMEOUT_SECONDS30Timeout for an individual command during Load Node initialization.
LOAD_NODE_RUNTIME_INSTALL_TIMEOUT_SECONDS120Timeout for installing the Runtime on a Load Node.
LOAD_NODE_DEFAULT_RUNNER_HOME/opt/surgepilot/runnerDefault remote Runner home used when a Load Node does not specify another path.
LOAD_NODE_SSH_CONNECT_TIMEOUT_SECONDS15SSH connection timeout for Load Node operations.
LOAD_NODE_INIT_TIMEOUT_SECONDS120Age threshold used to recover stale initialization attempts and nodes left in initialization state.
LOAD_NODE_INIT_LOG_TAIL_BYTES65536Maximum initialization-log tail retained for status and failure reporting.
LOAD_NODE_GENERATED_KEY_TYPEed25519SSH key type used when SurgePilot generates a Load Node keypair.

Run control and artifacts ​

VariableDefaultMeaning
SURGEPILOT_RUN_HEARTBEAT_TIMEOUT_SECONDS60Maximum wait after Runner acceptance for execution to start, and maximum gap between heartbeats after it is running.
SURGEPILOT_RUN_ACCEPTED_TIMEOUT_SECONDS120Maximum wait for the Runner to accept a remotely requested allocation.
SURGEPILOT_RUN_STOP_GRACE_SECONDS60Grace period allowed for a normal stop before force-kill handling.
SURGEPILOT_RUN_FORCE_KILL_SSH_TIMEOUT_SECONDS30SSH timeout used by force-kill control.
SURGEPILOT_RUNNER_CALLBACK_RETENTION_DAYS30Retention period for persisted Runner callback records.
SURGEPILOT_RUN_CONTROL_STALE_SECONDS120Age after which claimed Run-control work is considered stale for recovery.
SURGEPILOT_NODE_COOLDOWN_SECONDS300Cooldown period after a force-kill before that Load Node may be allocated again.
SURGEPILOT_RUN_ARTIFACT_MAX_BYTES209715200Maximum accepted ordinary Run artifact size.
SURGEPILOT_RUN_TERMINAL_LATE_ARTIFACT_MAX_BYTES1048576Maximum accepted artifact size after the Run has already reached a terminal state.
SURGEPILOT_RUN_TERMINAL_LATE_ARTIFACT_SECONDS300Time window in which a bounded late artifact may be accepted after terminal state.
SURGEPILOT_SINGLE_NODE_CONCURRENCY_HARD_LIMIT10000Hard per-node concurrency ceiling. It cannot be bypassed by confirmation and is not DB-editable.

API Catalog and Debug HTTP Trace ​

VariableDefaultMeaning
SURGEPILOT_API_CATALOG_SPEC_MAX_BYTES10485760Maximum uploaded API Catalog specification size.
SURGEPILOT_DEBUG_TRACE_MAX_REQUESTS100Maximum request records retained from one Debug HTTP Trace.
SURGEPILOT_DEBUG_TRACE_BODY_MAX_BYTES65536Maximum inline request or response body bytes retained per trace record.
SURGEPILOT_DEBUG_TRACE_ARTIFACT_MAX_BYTES10485760Maximum Debug HTTP Trace artifact size accepted for parsing.
SURGEPILOT_DEBUG_TRACE_RECORD_MAX_BYTES131072Maximum encoded size of one trace record.
SURGEPILOT_DEBUG_TRACE_BODY_BLOB_MAX_BYTES5242880Maximum size of one separately stored trace body blob.
SURGEPILOT_DEBUG_TRACE_BODY_BLOB_TOTAL_MAX_BYTES20971520Maximum total separately stored trace body bytes for one trace artifact.

Before editing manually ​

  1. Confirm whether the value belongs in the release or source template.
  2. Stop if the setting is marked Managed.
  3. Preserve .env ownership and owner-only permissions.
  4. Never commit .env or generated secret files.
  5. For a release network change, prefer the surgepilot up confirmation flow over direct editing.
  6. Run the official startup command after the change and read its effective configuration summary before services start.

For startup behavior and supported modes, continue with Startup Modes. For product terms, see Terms and FAQ.