Skip to main content

Environment Variables

All configuration is provided to OpenCLM via environment variables. Copy .env.example to .env and fill in your values before starting the stack.

API Server Variables​

VariableRequiredDefaultDescription
DATABASE_URL✅—PostgreSQL connection string: postgresql://user:pass@host:5432/dbname
JWT_SECRET✅—At least 32 random characters. Used to sign access tokens
APP_URL✅—The public URL of your OpenCLM instance (e.g. https://openclm.yourcompany.com)
PORT❌4000API server listen port
NODE_ENV❌productionSet to development to enable verbose logging
LOG_LEVEL❌infoLog verbosity: error, warn, info, debug
CORS_ORIGINS❌APP_URLComma-separated list of allowed CORS origins
MAX_FILE_SIZE_MB❌25Maximum file upload size in megabytes
SESSION_TIMEOUT_MINUTES❌60Minutes of inactivity before session expires

Database Variables​

VariableRequiredDefaultDescription
POSTGRES_USER✅—PostgreSQL username
POSTGRES_PASSWORD✅—PostgreSQL password
POSTGRES_DB✅—PostgreSQL database name
POSTGRES_HOST❌dbPostgreSQL host (Docker service name or IP)
POSTGRES_PORT❌5432PostgreSQL port

Keycloak / Auth Variables​

VariableRequiredDefaultDescription
KEYCLOAK_URL✅—Keycloak server URL (e.g. https://openclm.yourcompany.com/auth)
KEYCLOAK_REALM✅openclmKeycloak realm name
KEYCLOAK_CLIENT_ID✅openclm-appKeycloak OIDC client ID
KEYCLOAK_CLIENT_SECRET✅—Keycloak OIDC client secret
KC_ADMIN_USER✅—Keycloak admin console username
KC_ADMIN_PASSWORD✅—Keycloak admin console password

SMTP / Email Variables​

VariableRequiredDefaultDescription
SMTP_HOST❌—SMTP server hostname
SMTP_PORT❌587SMTP port
SMTP_USER❌—SMTP username
SMTP_PASS❌—SMTP password
SMTP_FROM_NAME❌OpenCLMFrom display name in emails
SMTP_FROM_EMAIL❌—From email address
SMTP_SECURE❌trueUse TLS/STARTTLS

If SMTP is not configured, email notifications are disabled and only in-app notifications are sent.

OpenSign Variables​

VariableRequiredDefaultDescription
OPENSIGN_API_URL❌—OpenSign API base URL
OPENSIGN_API_KEY❌—OpenSign API key

OpenSign can also be configured via the UI at Settings → Integrations.

Frontend Variables (set at build time)​

VariableRequiredDefaultDescription
VITE_API_URL✅—The public URL of the API (e.g. https://openclm.yourcompany.com/api)
VITE_KEYCLOAK_URL✅—The public URL of Keycloak auth endpoint
VITE_KEYCLOAK_REALM✅openclmKeycloak realm name
VITE_KEYCLOAK_CLIENT_ID✅openclm-appKeycloak client ID

Security Recommendations​

  • Store secrets in a secrets manager (HashiCorp Vault, AWS Secrets Manager, Docker Secrets) rather than plain text .env files.
  • Never commit .env to version control — it is already in .gitignore.
  • Rotate JWT_SECRET and API keys periodically.
  • Use strong, randomly generated passwords for POSTGRES_PASSWORD and KC_ADMIN_PASSWORD.