Skip to content

Environment variables

The backend is configured through a single .env file. In a provisioned installation it lives at /root/copula/.env (mode 0600); in a manual installation it is the .env you create from the ready template on the Manual installation page.

Core

VariableDefaultDescription
BACKEND_PORT8080Port the backend listens on inside the container. The compose stacks publish host port 8901 to this port.
LOG_LEVELLogging verbosity.
CORS_ALLOWED_ORIGINS*Allowed CORS origins.
JWT_SECRETRequired. Signing secret for JWTs; exactly 128 hex characters.
ENCRYPTION_KEYRequired. AES-256 encryption key; 32 characters.
LICENSE_TOKENRequired. License token from the cabinet; also the bearer for the cabinet LLM router.
CABINET_URLhttps://api.copul4.comCabinet API endpoint.
ADMIN_USER / ADMIN_PASSInitial admin credentials; the backend auto-creates the admin account from them.

Database

VariableDefaultDescription
POSTGRES_HOSTpostgresPostgreSQL host.
POSTGRES_PORT5432PostgreSQL port.
POSTGRES_USERagentDatabase user.
POSTGRES_PASSWORD(empty)Database password.
POSTGRES_DBagentdbDatabase name.

Model provider

VariableDefaultDescription
MODEL_PROVIDERopenrouteropenrouter, custom or copula. Empty means openrouter; an unknown value logs a fatal message and falls back to openrouter.
MODEL_BASE_URLhttps://openrouter.ai/api/v1Base URL of the OpenAI-compatible API.
MODEL_API_KEYAPI key for the provider (not needed for copula — the license token is the credential).
MODEL_NAMEModel name. New wizard installs default to copula-base.
MODEL_MAX_TOKENS25000Max tokens per model response.

Smart / Basic profiles

SMART_MODEL_* and BASIC_MODEL_* override the MODEL_* values per profile. Resolution follows the fallback chain SMART_*BASIC_*MODEL_* for each value.

Variable groupPurpose
SMART_MODEL_PROVIDER / SMART_MODEL_BASE_URL / SMART_MODEL_API_KEY / SMART_MODEL_NAME / SMART_MODEL_MAX_TOKENSOverrides for the smart (heavy) profile.
BASIC_MODEL_PROVIDER / BASIC_MODEL_BASE_URL / BASIC_MODEL_API_KEY / BASIC_MODEL_NAME / BASIC_MODEL_MAX_TOKENSOverrides for the basic (light) profile.

Legacy provider keys OPENROUTER_API_KEY and MINIMAX_API_KEY are also recognized.

Agents and runtime

VariableDefaultDescription
AGENT_WORKSPACEWorkspace path for agent repositories.
AGENT_CONTEXT_TOKEN_LIMIT120000Token limit for agent context.
MAX_REPO_WORKERS20Maximum concurrent repository workers.
SESSION_STORAGE_TYPEdatabase or file.
SESSION_FILE_PATHPath for file-based session storage.
FILE_STORAGE_PATH./uploadsWhere uploaded files are stored.
MAX_FILE_SIZE_MB50Maximum upload size.

Integrations and updates

VariableDefaultDescription
SP_DISTRIBUTOR_URLhttps://get.copul4.comDistributor endpoint.
SELF_UPDATE_IMAGEOptional image reference override used by self-update availability checks.
COCOINDEX_CODE_IMAGEcocoindex/cocoindex-code:fullCode-search image override (compose-level).