Handbook - Reference

Environment Variables

This table summarizes the current CloudGrid runtime variables. See Runtime environment../configuration/runtime-environment.md for validation context.

On this page

This table summarizes the current CloudGrid runtime variables. See Runtime environment for validation context.

Shared

VariableDefaultNotes
CLOUDGRID_IMAGE_REGISTRYghcr.io/cloudgrid-dev in release ComposeOCI image registry for release Compose.
CLOUDGRID_IMAGE_TAGcurrent release tagOCI image tag for release Compose.
CLOUDGRID_DEPLOYMENT_MODElocallocal or deployed.
CLOUDGRID_AUTH_MODElocallocal or sso; must match deployment mode.
CLOUDGRID_NATS_URLnats://localhost:4222Private message bridge.
CLOUDGRID_NATS_MAX_PAYLOAD8388608Local Compose and bundled chart NATS payload limit; external NATS must be at least as high as CLOUDGRID_OTLP_MAX_REQUEST_BYTES.
CLOUDGRID_STORAGE_ADAPTERsurrealdbMust match compiled Go adapter.
CLOUDGRID_LOG_LEVELinfodebug, info, warn, warning, or error. Keep production at info unless diagnosing a specific issue.
CLOUDGRID_PROVIDER_SECRET_ENCRYPTION_KEYlocal development keyStable control-plane key material for encrypted managed AI provider secrets. Required in deployed mode before storing or resolving production provider API keys. Mount only into control-plane.

BFF And Frontend

VariableDefaultNotes
CLOUDGRID_BFF_HOST0.0.0.0BFF bind host.
CLOUDGRID_BFF_PORT3000BFF port.
CLOUDGRID_MESSAGE_BRIDGE_REQUEST_TIMEOUT_MS12000BFF request/reply timeout for private NATS subjects. Keep this above CLOUDGRID_STORAGE_READ_QUERY_TIMEOUT_MS so storage-read can return bounded query failures instead of client-side bridge timeouts.
CLOUDGRID_FRONTEND_DEV_PORT5173Vite dev server port.
CLOUDGRID_FRONTEND_SERVE_STATICfalse in devBFF serves built frontend when true.
CLOUDGRID_FRONTEND_STATIC_DIR./apps/backend/publicStatic frontend directory.
CLOUDGRID_PUBLIC_URLunsetExternal browser base URL used in invitation emails.
CLOUDGRID_AI_CHAT_ENABLEDfalseEnables the BFF AI Chat runtime and route.
VITE_CLOUDGRID_AI_CHAT_ENABLEDunsetFrontend build-time override; set to false to hide the route.
CLOUDGRID_AI_CHAT_HARNESS_MODEproviderBFF AI Chat harness runtime. provider uses configured company credentials, mock is only for local smoke checks, and off disables execution.
CLOUDGRID_AI_CHAT_PROVIDER_KINDunsetOptional local-mode bootstrap provider kind.
CLOUDGRID_AI_CHAT_MODELunsetRequired when local-mode AI Chat provider bootstrap is enabled.
CLOUDGRID_AI_CHAT_CREDENTIAL_REFunsetOptional local-mode bootstrap credential reference for the configured AI Chat provider. UI-managed providers normally use encrypted managed: refs instead.

SSO

VariableDefaultNotes
CLOUDGRID_AUTH_PROVIDERSunsetComma-separated subset of github, google, azure; required for SSO.
CLOUDGRID_AUTH_COMPANY_IDunsetDeployed company boundary.
CLOUDGRID_SESSION_SECRETunsetRequired for SSO sessions.
CLOUDGRID_SESSION_TTL_SECONDS28800Session lifetime.
CLOUDGRID_AUTH_GITHUB_CLIENT_IDunsetRequired when GitHub is enabled.
CLOUDGRID_AUTH_GITHUB_CLIENT_SECRETunsetRequired when GitHub is enabled.
CLOUDGRID_AUTH_GITHUB_REDIRECT_URIunsetUsually https://<host>/auth/callback.
CLOUDGRID_AUTH_GOOGLE_ISSUERunsetUsually https://accounts.google.com.
CLOUDGRID_AUTH_GOOGLE_AUDIENCEclient ID fallbackExpected ID-token audience.
CLOUDGRID_AUTH_GOOGLE_JWKS_URLprovider defaultOptional JWKS override.
CLOUDGRID_AUTH_GOOGLE_CLIENT_IDunsetRequired when Google is enabled.
CLOUDGRID_AUTH_GOOGLE_CLIENT_SECRETunsetRequired when Google is enabled.
CLOUDGRID_AUTH_GOOGLE_REDIRECT_URIunsetUsually https://<host>/auth/callback.
CLOUDGRID_AUTH_AZURE_ISSUERunsetUsually https://login.microsoftonline.com/<tenant-id>/v2.0.
CLOUDGRID_AUTH_AZURE_AUDIENCEclient ID fallbackExpected ID-token audience.
CLOUDGRID_AUTH_AZURE_JWKS_URLderived from issuerOptional JWKS override.
CLOUDGRID_AUTH_AZURE_CLIENT_IDunsetRequired when Azure is enabled.
CLOUDGRID_AUTH_AZURE_CLIENT_SECRETunsetRequired when Azure is enabled.
CLOUDGRID_AUTH_AZURE_REDIRECT_URIunsetUsually https://<host>/auth/callback.

Invitation Email

These variables configure the control-plane SMTP invitation delivery path. Invite mutations write the invitation and outbox row first; the worker sends and retries email asynchronously.

VariableDefaultNotes
CLOUDGRID_INVITATION_EMAIL_MODEdisabled local, smtp deployed SSOdisabled or smtp.
CLOUDGRID_INVITATION_EMAIL_REQUIRE_DELIVERYfalse local, true deployed SSOFails invitation mutations when required delivery cannot be enqueued.
CLOUDGRID_INVITATION_EMAIL_FROMunsetSender identity; required for SMTP mode.
CLOUDGRID_INVITATION_EMAIL_REPLY_TOunsetOptional reply-to address.
CLOUDGRID_INVITATION_EMAIL_SMTP_HOSTunsetRequired for SMTP mode.
CLOUDGRID_INVITATION_EMAIL_SMTP_PORTunsetRequired for SMTP mode.
CLOUDGRID_INVITATION_EMAIL_SMTP_USERNAMEunsetOptional unless the SMTP provider requires auth.
CLOUDGRID_INVITATION_EMAIL_SMTP_PASSWORDunsetOptional unless the SMTP provider requires auth.
CLOUDGRID_INVITATION_EMAIL_SMTP_TLSstarttls deployedstarttls, tls, or none.
CLOUDGRID_INVITATION_EMAIL_SMTP_TIMEOUT_MS10000Valid range 1000..60000.
CLOUDGRID_INVITATION_EMAIL_MAX_ATTEMPTS5Valid range 1..20.
CLOUDGRID_INVITATION_EMAIL_RETRY_BASE_SECONDS60Valid range 5..3600.

OTLP Collector

VariableDefaultNotes
CLOUDGRID_OTLP_HTTP_ADDR0.0.0.0:4318OTLP/HTTP bind address.
CLOUDGRID_OTLP_GRPC_ADDR0.0.0.0:4317OTLP/gRPC bind address.
CLOUDGRID_OTLP_MAX_REQUEST_BYTES4194304HTTP body limit.
CLOUDGRID_OTLP_GRPC_MAX_MESSAGE_BYTESHTTP body limitgRPC message limit.
CLOUDGRID_OTLP_GRPC_COMPRESSIONgzipgzip or none.
CLOUDGRID_OTLP_LOCAL_PROJECT_IDdefaultSingle-project local fallback.
CLOUDGRID_OTLP_LOCAL_PROJECT_TOKENSunsetJSON bearer-token-to-project map.
CLOUDGRID_OTLP_MAX_SPANS_PER_REQUEST10000Reject oversized trace exports before publish.
CLOUDGRID_OTLP_MAX_LOGS_PER_REQUEST10000Reject oversized log exports before publish.
CLOUDGRID_OTLP_MAX_METRIC_POINTS_PER_REQUEST20000Reject oversized metric exports before publish.
CLOUDGRID_OTLP_PUBLISH_TIMEOUT_MS1000Collector NATS publish timeout.
CLOUDGRID_PROJECT_STATUS_CACHE_TTL_SECONDS60Fresh project-status authorization cache lifetime in deployed collector mode.
CLOUDGRID_PROJECT_STATUS_CACHE_STALE_SECONDS120Stale project-status cache reuse window during temporary control-plane failures.
CLOUDGRID_AUTH_ISSUERunsetRequired by the collector when CLOUDGRID_AUTH_MODE=sso; trusted issuer for OTLP ingest bearer tokens.
CLOUDGRID_AUTH_AUDIENCEunsetRequired by the collector when CLOUDGRID_AUTH_MODE=sso; expected audience for OTLP ingest bearer tokens.
CLOUDGRID_AUTH_JWKS_URLunsetRequired by the collector when CLOUDGRID_AUTH_MODE=sso; JWKS endpoint for OTLP ingest bearer-token signatures.

Self-Observability

VariableDefaultNotes
CLOUDGRID_SELF_OBSERVABILITY_ENABLEDtrue local, false deployedEnable service telemetry export.
CLOUDGRID_SELF_OBSERVABILITY_COMPANY_IDlocal in localRequired in deployed when enabled.
CLOUDGRID_SELF_OBSERVABILITY_PROJECT_IDcloudgrid-systemProject receiving CloudGrid telemetry.
CLOUDGRID_SELF_OBSERVABILITY_OTLP_ENDPOINThttp://localhost:4318 localRequired in deployed when enabled.
CLOUDGRID_SELF_OBSERVABILITY_OTLP_BEARER_TOKENunsetRequired whenever self-observability is enabled; in local mode it must map to cloudgrid-system.
CLOUDGRID_SELF_OBSERVABILITY_EXPORT_INTERVAL_SECONDS101..300.
CLOUDGRID_SELF_OBSERVABILITY_TRACES_ENABLEDtrue when enabledTrace export toggle.
CLOUDGRID_SELF_OBSERVABILITY_LOGS_ENABLEDtrue when enabledLog export toggle.
CLOUDGRID_SELF_OBSERVABILITY_METRICS_ENABLEDtrue when enabledMetric export toggle.

Benchmark Evidence

VariableDefaultNotes
CLOUDGRID_ENABLE_BENCHMARKSunsetMust be true to run benchmark probes.
CLOUDGRID_BENCH_DEPLOYMENT_PROFILElocalMust be production-like for production benchmark profiles.
CLOUDGRID_BENCH_ENVIRONMENT_IDlocalRequired for production benchmark profiles. Identifies the promoted environment in the JSON result.
CLOUDGRID_BENCH_IMAGE_TAGlocalRequired for production benchmark profiles. Identifies the release image in the JSON result.
CLOUDGRID_BENCH_GRAPHQL_URLunsetRequired for read and combined benchmark profiles.
CLOUDGRID_BENCH_OTLP_TRACES_URLunsetRequired for ingest and combined benchmark profiles.
CLOUDGRID_BENCH_OTLP_BEARER_TOKENunsetOptional ingest credential for benchmark OTLP probes.
CLOUDGRID_BENCH_REQUESTS1Integer 1..1000.
CLOUDGRID_BENCH_REQUIREDunsetSet to true to fail the command when thresholds fail.

Storage And Control-Plane

VariableDefaultNotes
CLOUDGRID_SURREALDB_URLhttp://localhost:8000/rpcStorage/control-plane only.
CLOUDGRID_SURREALDB_NAMESPACEobservabilitySurrealDB namespace.
CLOUDGRID_SURREALDB_DATABASEdevSurrealDB database.
CLOUDGRID_SURREALDB_USERNAMElocal rootDo not expose publicly.
CLOUDGRID_SURREALDB_PASSWORDlocal rootDo not expose publicly.
CLOUDGRID_STORAGE_READ_MAX_METRIC_POINTS5000Maximum metric points in one response.
CLOUDGRID_STORAGE_READ_QUERY_TIMEOUT_MS10000Single storage-read request deadline for trace, log, metric, facet, live-notification, and AI-eval read handlers.
CLOUDGRID_STORAGE_READ_MAX_PAGE_SIZE200Maximum trace/log/facet page size.
CLOUDGRID_LIVE_MAX_SUBSCRIPTIONS2000Maximum active live trace subscriptions per storage-read process.
CLOUDGRID_LIVE_EVENT_BUFFER_SIZE100Configured per-subscription live event buffer size for bounded live delivery.
CLOUDGRID_STORAGE_WRITE_HEALTH_HOST0.0.0.0storage-write health bind host.
CLOUDGRID_STORAGE_WRITE_HEALTH_PORT8082storage-write health port.
CLOUDGRID_STORAGE_MAINTENANCE_HEALTH_HOST0.0.0.0storage-maintenance health bind host.
CLOUDGRID_STORAGE_MAINTENANCE_HEALTH_PORT8087storage-maintenance health port.
CLOUDGRID_RETENTION_SCHEDULER_ENABLEDfalseEnables scheduled retention batches in storage-maintenance.
CLOUDGRID_RETENTION_SCHEDULER_INTERVAL_SECONDS3600Retention scheduler tick cadence, 300..86400.
CLOUDGRID_RETENTION_SCHEDULER_PROJECT_IDSunsetRequired comma-separated project IDs when the retention scheduler is enabled.
CLOUDGRID_RETENTION_BATCH_LIMIT1000Maximum rows processed per scheduled project/data-class batch.
CLOUDGRID_RETENTION_LEASE_SECONDS900Lease duration for project/data-class scheduler ownership.

Storage-read uses the live buffer setting to bound per-subscription publish work. A live subscription is dropped with retryable ERR-014 when its delivery path stalls or its buffer is full.

AI Evaluation

VariableDefaultNotes
CLOUDGRID_AI_EVAL_ENABLEDfalseEnables AI evaluation surfaces and runner integration.
CLOUDGRID_AI_EVAL_RUNNER_HEALTH_HOST0.0.0.0Runner health bind host.
CLOUDGRID_AI_EVAL_RUNNER_HEALTH_PORT8085Runner health port.
CLOUDGRID_AI_EVAL_HARNESS_URLunsetRequired when AI eval uses a harness adapter.

See .env.example for the current example file.

Last updated .