Skip to main content
Version: 1.0.4

Environment Variables

QUBIQ reads configuration from the environment and from a .env file in its data directory. The file is created automatically on first boot with generated secrets.

Most of these are set for you by the installer. Edit .env only for the deployment-specific settings — TLS, allowed origins, trusted proxies, login policy.

.env holds ENCRYPTION_KEY

Losing it makes every stored connection credential and the configuration database unrecoverable. Back it up separately from the data directory, and never commit it.

Secrets

VariableDefaultDescription
JWT_SECRETrequiredProtects Platform sign-ins. Generated on first run. Missing ⇒ hard startup failure — there is no insecure default.
ENCRYPTION_KEYrequired64 hex characters. Derives the key protecting the configuration database and connection secrets. Generated on first run. Missing or malformed ⇒ hard startup failure.
LIVE_JWT_SECRETderived from JWT_SECRETProtects LiveView sign-ins. Set it explicitly if you want to reset operator sign-ins without affecting engineers.

Network

VariableDefaultDescription
PORT8182CoreServer HTTP/WS port — the interface and API
REALTIME_PORT8183RealtimeGateway telemetry WebSocket
REST_GATEWAY_PORT8090RestGateway — pipeline-published REST ingress
SCRIPTING_GATEWAY_PORT8091ScriptingGateway
HOST0.0.0.0Bind address
ALLOWED_ORIGINShttp://localhost:3000,http://localhost:5173Comma-separated CORS origins. Set this to your real origins in production.
TRUSTED_PROXIES(none)Comma-separated CIDRs or IPs. Without it, X-Forwarded-For is ignored and the peer address is used — so a spoofed header cannot rotate the login-lockout bucket.

TLS and cookies

VariableDefaultDescription
TLS_ENABLEDfalseTerminate TLS at QUBIQ
TLS_CERT_FILE(none)Certificate chain path
TLS_KEY_FILE(none)Private key path
QUBIQ_COOKIE_SECUREfollows TLS_ENABLEDForce the Secure cookie flag. Set it when a proxy terminates TLS but this process serves HTTP.
CSRF_ENABLEDtrueCSRF protection

Cookie Secure derives from TLS so that an HTTP-only on-premise deployment is never broken by an unsendable cookie — with the explicit override for the proxy case.

Authentication

VariableDefaultDescription
LOGIN_MAX_ATTEMPTS10Failures before lockout
LOGIN_WINDOW15mWindow in which failures are counted
LOGIN_LOCKOUT15mLockout duration

Paths and storage

VariableDefaultDescription
QUBIQ_DATA_DIRSet by the installerThe data directory. Pinned at install time so a service account with no user profile resolves it.
ENVIRONMENTproduction (set by the installer)Deployment mode.
DATABASE_PATHin the data directoryConfiguration database
QUBIQ_DB_ENCRYPTIONonon/off. Applies to a fresh database only — there is no migration; the configuration database must be deleted to change mode.

Uploads and library folders are not environment variables. They are configured in Settings → Storage Folders and stored in the database, so there is one source of truth. Until set, storage fails closed.

Execution

VariableDefaultDescription
PYTHON_PATHThe bundled runtime, set by the installerInterpreter for the Python worker. Do not repoint this at a system Python — the bundled runtime is version-pinned against the worker.
PYTHON_WORKER_REPLICAS(platform default)Parallel Python workers
EXECUTION_TIMEOUT5mDefault execution timeout
MAX_CONCURRENT_JOBS10Concurrent execution ceiling
QUBIQ_BROWSER_SCRIPT_SCOPESonoff restores the earlier behaviour, where a Gateway script started from a browser button ran unclamped. On, its capabilities are derived from the caller's own realm and write level. → The sandbox 1.0.4

Connections and liveness

VariableDefaultDescription
LIVENESS_MODEpassivepassive (5 min safety-net probe), hybrid (30 s), active (10 s, probe everything)

First-run bootstrap

VariableDefaultDescription
QUBIQ_INIT_ENVproductionThe ENVIRONMENT written into a generated .env
QUBIQ_INIT_PYTHONThe bundled runtimeThe PYTHON_PATH written into a generated .env
QUBIQ_OPEN_BROWSER(unset)Open a browser on start

Diagnostics

VariableDefaultDescription
QUBIQ_MERGE_DEBUG(unset)1 logs the historian's live-tail merge decisions per series query. Look for [MERGE] in the historian's output. Off by default; for tuning flush-lag only.

Sample .env

.env — a Linux production install
# --- Written by the installer; do not hand-edit ---
ENVIRONMENT=production
QUBIQ_DATA_DIR=/var/lib/qubiq
PYTHON_PATH=/opt/qubiq/python/bin/python3

# --- Generated on first boot. Back these up SEPARATELY from the data dir ---
JWT_SECRET=<64 hex chars>
ENCRYPTION_KEY=<64 hex chars>
LIVE_JWT_SECRET=<64 hex chars>

# --- Yours to set for this deployment ---
PORT=8182
REALTIME_PORT=8183
REST_GATEWAY_PORT=8090
SCRIPTING_GATEWAY_PORT=8091
ALLOWED_ORIGINS=https://qubiq.example.com
TRUSTED_PROXIES=10.0.0.0/8
QUBIQ_COOKIE_SECURE=true # TLS terminated at a reverse proxy
LOGIN_MAX_ATTEMPTS=5
LOGIN_WINDOW=15m
LOGIN_LOCKOUT=30m

Precedence

  1. Process environment
  2. .env in the data directory
  3. Built-in defaults

.env is generated with owner-only permissions (0600) on first boot.

Next

Glossary