Skip to main content

Configuration

Environment variables for grid-core, install Compose, and the console.

How to update this page
Edit data/configuration.json, then run npm run sync:config.
Do not hand-edit the tables below — CI checks that the generated file matches the JSON.

Canonical templates in product repos:

Required = needed for production / install boot (npm run prod, Compose check-env.sh).

Paths & process​

Core process paths. Install Compose uses defaults inside the container; override only when you know the layout.

VariableRequiredPurposeTypical
PORTAPI listen port (inside the process / container)3000
GRID_HTTP_PORTHost port published by Compose for the UI/proxy80
GRID_DATA_DIRJSON store (users, sessions, audit, releases)./data or /var/lib/grid/data
GRID_WORK_DIRTerraform workspaces fallback root./workspaces or /var/lib/grid/workspaces
GRID_CLI_ROOTPath to the grid-cli package../grid-cli or /opt/grid/grid-cli
GRID_CONFIG_ROOTDesired-state working tree (GitOps checkout target)./data/desired-state
GRID_TERRAFORM_BINTerraform binary name or pathterraform
GRID_CORS_ORIGINOptional CORS allow-list (comma-separated origins). Empty = library defaulthttps://grid.example.com

Auth​

Bootstrap creates one superadmin. Change the password before any shared host.

VariableRequiredPurposeTypical
GRID_AUTH_ADMIN_EMAILyesBootstrap superadmin emailadmin@example.com
GRID_AUTH_ADMIN_PASSWORDyesBootstrap superadmin password (no placeholders). Keep in sync after grid admin superadmin rotates it(strong secret)
GRID_AUTH_ADMIN_NAMEOptional display name for the bootstrap userGrid Admin
GRID_AUTH_SESSION_TTL_HOURSAPI session length in hours168
GRID_AUTH_ALLOW_REGISTERPublic self-register (true/1). Keep off for self-hostfalse
GRID_AUTH_DISABLEDBypass auth — dev only, never on a public VMfalse

GitOps (intent sync)​

When GRID_GITOPS_REPO_URL is set, Core clones/pulls into GRID_CONFIG_ROOT. Works with any Git host. Prefer a clean URL. Production (npm run prod) hard-fails HTTPS remotes without username + host token + expiry (env or Admin → Sources). SSH remotes use host deploy keys instead.

VariableRequiredPurposeTypical
GRID_GITOPS_REPO_URLyesIntent repo URL (HTTPS or SSH) — any Git providerhttps://git.example.com/org/intent.git
GRID_GITOPS_BRANCHBranch to pullmain
GRID_GITOPS_PATHOptional subdirectory under the clone (relative, no ..)(empty = repo root)
GRID_GITOPS_SYNC_INTERVAL_SECAuto pull + reconcile interval. Default 600 when a repo URL is set; 0 = manual only600
GRID_GITOPS_USERNAMEyesRequired for HTTPS intent remotes in production (git, GitLab oauth2, Bitbucket x-token-auth, …). Also stored in gitops-secrets.json via Admin → Sources. Not required for SSH remotes.git
GRID_GITOPS_TOKENyesRequired for HTTPS intent remotes in production (host-issued PAT/deploy token; Grid does not generate it). Also accepted from GRID_DATA_DIR/gitops-secrets.json after Admin → Sources. Not required for SSH remotes.ghp_… / deploy token (or unset once secrets file is populated)
GRID_GITOPS_TOKEN_EXPIRES_ATyesRequired with HTTPS auth in production (YYYY-MM-DD from your Git host). Also stored via Sources as authExpiresAt / secrets tokenExpiresAt.2027-01-15
GRID_USE_DEMOForce demo-infra fixture path (local labs). Do not use in productionfalse

Module bank​

Terraform modules consumed by generate. Prefer a release tag, not main.

VariableRequiredPurposeTypical
GRID_MODULE_BANKModule bank git URL or local pathhttps://github.com/gridplatform/grid-terraform.git
GRID_MODULE_BANK_REFBranch or tag for the module bankv0.1.0
GRID_MODULE_BANK_SYNC_INTERVAL_SECAuto-refresh local module-bank checkout (seconds). 0 = manual. Default 20 when unset20
GRID_MODULE_SOURCEOptional: force remote module sources in generated HCLremote

Remote Terraform state​

Required for production / install. Create the store before the first apply — see Remote state. The same bucket also stores the generated archive mirror.

VariableRequiredPurposeTypical
GRID_TF_BACKENDyesBackend kinds3 \
GRID_TF_STATE_BUCKETBucket / container name (s3, gcs, oci, oss, cos, s3compat)mycompany-grid-tfstate
GRID_TF_LOCK_TABLEDynamoDB lock table (AWS S3 backend)mycompany-grid-tflock
GRID_TF_STATE_REGIONRegion for S3 / OSS / COS / s3compatus-east-1
GRID_TF_S3_ENDPOINTS3-compatible endpoint (OCI, Huawei OBS, Aliyun OSS, MinIO, …)https://obs.cn-north-1.myhuaweicloud.com
GRID_TF_S3_FORCE_PATH_STYLEForce path-style S3 addressing when the vendor requires ittrue
GRID_TF_AZURE_RESOURCE_GROUPAzure resource group (azurerm)grid-tfstate-rg
GRID_TF_AZURE_STORAGE_ACCOUNTAzure storage account (azurerm)gridtfstate
GRID_TF_AZURE_CONTAINERAzure blob container (azurerm)grid-tfstate
GRID_TF_OCI_NAMESPACEOCI Object Storage namespace<tenancy-namespace>

Monitoring​

Prometheus + Alertmanager run on the host (systemd or local binaries), not inside Grid Compose. Required for production boot. See Monitoring.

VariableRequiredPurposeTypical
GRID_PROMETHEUS_URLyesPrometheus query API base URLhttp://127.0.0.1:9090 or http://host.docker.internal:9090
GRID_ALERTMANAGER_URLyesAlertmanager API base URLhttp://127.0.0.1:9093 or http://host.docker.internal:9093
GRID_MONITORING_CONFIG_DIRDir for alert rules/ + alertmanager.yml written by the API./install/monitoring or /etc/prometheus
GRID_MONITORING_HOST_DIRHost path bind-mounted for Compose → systemd Prometheus config/etc/prometheus
GRID_PROMETHEUS_BEARER_TOKENOptional bearer token for Prometheus(secret)
GRID_PROMETHEUS_BASIC_USEROptional basic-auth user for Prometheus
GRID_PROMETHEUS_BASIC_PASSWORDOptional basic-auth password for Prometheus(secret)
GRID_PROMETHEUS_TIMEOUT_MSPrometheus HTTP timeout8000
GRID_PROMETHEUS_CACHE_TTL_MSIn-process metrics cache TTL20000
GRID_ALERTMANAGER_TIMEOUT_MSAlertmanager HTTP timeout8000

Argo CD / OpenShift GitOps​

Optional Kubernetes workload reconciler (Application CRD). Off by default.

VariableRequiredPurposeTypical
GRID_ARGO_ENABLEDEnable Argo / OpenShift GitOps integration (true/1)false
GRID_ARGO_KUBECONFIGkubeconfig for the cluster where Argo runs (falls back to KUBECONFIG)/path/to/kubeconfig
GRID_ARGO_CONTEXTOptional kubectl context name
GRID_ARGO_NAMESPACENamespace for Application CRsargocd
GRID_KUBECTL_BINkubectl binarykubectl

Install / Compose pins​

Used by install/.env and Compose. Not all apply to a bare npm run prod on a local machine.

VariableRequiredPurposeTypical
GRID_RELEASE_CHANNELGHCR channel when using release Compose (current or lts)current
GRID_VERSIONExact image tag (overrides channel), e.g. 0.1.00.1.0
GRID_CORE_IMAGEOverride core image referenceghcr.io/gridplatform/grid-core:0.1.0
GRID_UI_IMAGEOverride UI image referenceghcr.io/gridplatform/grid-ui:0.1.0
GRID_CLI_REFGit ref when building CLI into the core image from sourcemain or v0.1.0
GRID_UI_REFGit ref when building the UI image from sourcemain or v0.1.0
TERRAFORM_VERSIONTerraform version baked into the core image1.9.8

Console (grid-ui)​

Build-time Vite env. Production builds refuse to proceed without VITE_GRID_API_URL.

VariableRequiredPurposeTypical
VITE_GRID_API_URLyesBrowser → API base path or absolute URL/api/v1 (Compose) or http://localhost:3000/api/v1 (dev)

Secrets hygiene​

  • Never commit .env or install/.env.
  • Prefer instance roles / OIDC over long-lived keys on the VM when possible.
  • Rotate GRID_AUTH_ADMIN_PASSWORD after first login if the image was shared.
  • Keep bootstrap env vars in sync when you rotate the superadmin via CLI.