Skip to main content
Openfuse

Configuration

Complete environment variable reference for self-hosted Openfuse deployments. Covers platform settings, database, authentication, SMTP, and social login.

All configuration is done through environment variables. In Docker Compose deployments, set them in the .env file. In orchestrated deployments, use your platform's secret manager and environment configuration.

Platform

VariableRequiredDefaultDescription
ROOT_DOMAINYesRoot domain for the platform. All subdomains are derived from this.
OPENFUSE_VERSIONNolatestDocker image version tag. Always pin to a specific version in production.

Derived URLs

From ROOT_DOMAIN, the platform automatically configures:

  • API: *.api.<ROOT_DOMAIN> (e.g., admin.api.example.com, acme.api.example.com)
  • SSO: sso.<ROOT_DOMAIN> (Keycloak login pages)
  • UI: <ROOT_DOMAIN>, app.<ROOT_DOMAIN>, <company>.<ROOT_DOMAIN>

Database

VariableRequiredDefaultDescription
DATABASE_HOSTNodbPostgreSQL host. Change when using an external database.
DATABASE_PORTNo5432PostgreSQL port.
DATABASE_USERYesDatabase username.
DATABASE_PASSWORDYesDatabase password.
DATABASE_NAMENoopenfuseDatabase name for the API.
DATABASE_SSLNofalseEnable SSL for database connections. Set true for managed databases.
KC_DB_NAMENokeycloakDatabase name for Keycloak.
KC_DB_HOSTNoSame as DATABASE_HOSTSeparate host for Keycloak's database, if needed.
KC_DB_USERNAMENoSame as DATABASE_USERSeparate username for Keycloak's database.
KC_DB_PASSWORDNoSame as DATABASE_PASSWORDSeparate password for Keycloak's database.

Using an external database

By default, Openfuse bundles a PostgreSQL container. For production, use a managed database service (Amazon RDS, Google Cloud SQL, Azure Database for PostgreSQL).

  1. Create two databases on your PostgreSQL server: openfuse and keycloak
  2. Remove the bundled database profile in .env:
    #COMPOSE_PROFILES=bundled-db
  3. Set the connection variables:
    DATABASE_HOST=your-rds-endpoint.amazonaws.com
    DATABASE_PORT=5432
    DATABASE_USER=openfuse
    DATABASE_PASSWORD=your-password
    DATABASE_SSL=true
    
    # If Keycloak uses the same server (recommended):
    KC_DB_HOST=your-rds-endpoint.amazonaws.com
    KC_DB_USERNAME=openfuse
    KC_DB_PASSWORD=your-password

The database user must have permission to create schemas and tables in the openfuse database. The API creates the meta schema on first run — no additional SQL setup needed.

SSL for managed databases

The API uses DATABASE_SSL=true to enable SSL. Keycloak uses JDBC, where SSL is configured in the connection URL. For manual setup with SSL, set KC_DB_URL:

KC_DB_URL=jdbc:postgresql://your-host:5432/keycloak?sslmode=require

Common sslmode values: require (encrypted, no cert verification), verify-ca, verify-full.

API / Sessions

VariableRequiredDefaultDescription
SESSION_SECRETYes32+ character secret for session encryption. Generate with openssl rand -hex 32. Must be identical across all API replicas.

Keycloak

Openfuse uses Keycloak for authentication.

VariableRequiredDefaultDescription
KC_BOOTSTRAP_ADMIN_USERNAMENoadminKeycloak admin console username.
KC_BOOTSTRAP_ADMIN_PASSWORDYesKeycloak admin console password.
KC_STAFF_REALM_NAMENoopenfuse-staffStaff realm name.
KC_TENANTS_REALM_NAMENoopenfuse-tenantsTenants realm name.

Client secrets

Each Keycloak client requires a unique secret. Generate with openssl rand -hex 24.

VariableRequiredDescription
KC_STAFF_BACKEND_CLIENT_SECRETYesStaff backend client.
KC_STAFF_BFF_CLIENT_SECRETYesStaff backend-for-frontend client.
KC_TENANTS_BACKEND_CLIENT_SECRETYesTenants backend client.
KC_TENANTS_BFF_CLIENT_SECRETYesTenants backend-for-frontend client.
KC_TENANTS_SDK_CLIENT_SECRETYesSDK authentication client.

Root user

VariableRequiredDescription
ROOT_USER_EMAILYesEmail for the first admin user.
ROOT_USER_PASSWORDYesPassword — min 12 characters, at least 1 uppercase, 1 digit, 1 special character.

Email (SMTP)

SMTP is optional. Without it, the platform works but team invites and password reset emails won't be sent. Configure it for production use.

VariableRequiredDefaultDescription
SMTP_HOSTNoSMTP server hostname. Omit to disable emails.
SMTP_PORTNo587SMTP server port.
SMTP_SECURENofalseUse TLS for SMTP (true for port 465).
SMTP_USERNoSMTP username.
SMTP_PASSWORDNoSMTP password.
SMTP_FROM_DOMAINNoROOT_DOMAINDomain used in "from" email addresses.
SMTP_FROM_NAMENoOpenfuseDisplay name for sent emails.

Social login

Social login providers are disabled by default. Enable by setting the _ENABLED flag and providing OAuth credentials.

VariableDefaultDescription
KC_GOOGLE_ENABLEDfalseEnable Google OAuth login.
KC_GOOGLE_CLIENT_IDGoogle OAuth client ID.
KC_GOOGLE_CLIENT_SECRETGoogle OAuth client secret.
KC_MICROSOFT_ENABLEDfalseEnable Microsoft OAuth login.
KC_MICROSOFT_CLIENT_IDMicrosoft OAuth client ID.
KC_MICROSOFT_CLIENT_SECRETMicrosoft OAuth client secret.
KC_GITHUB_ENABLEDfalseEnable GitHub OAuth login.
KC_GITHUB_CLIENT_IDGitHub OAuth client ID.
KC_GITHUB_CLIENT_SECRETGitHub OAuth client secret.

Logging

VariableDefaultDescription
LOG_LEVELinfoAPI log level (debug, info, warn, error).

Orchestrator-specific variables

These variables are set automatically by the Docker Compose files. In orchestrated deployments (Kubernetes, ECS, Cloud Run), you need to set them explicitly. See the platform guides (Kubernetes, AWS ECS, Cloud Run, Azure Container Apps) for details.

API

VariableRequiredExampleDescription
API_PORTNo3000API listen port.
API_BASE_URLYeshttps://admin.api.example.comAdmin API base URL.
SSO_BASE_URLYeshttps://sso.api.example.comBFF auth callback URL (API subdomain, not Keycloak URL).
COOKIE_DOMAINYes.example.comCookie domain (note leading dot).
KEYCLOAK_URLYeshttp://keycloak:8080Internal Keycloak URL.
KEYCLOAK_EXTERNAL_URLYeshttps://sso.example.comPublic Keycloak URL.
STAFF_FRONTEND_BASE_URLYeshttps://staff.example.comStaff frontend URL.
TENANTS_FRONTEND_BASE_URLYeshttps://example.comTenants frontend URL.
ALLOW_DEV_HOSTSNofalseAllow dev-friendly CORS origins (localhost, lvh.me). Only for testing.

Keycloak

VariableRequiredExampleDescription
KC_DBYespostgresDatabase type.
KC_DB_URLYesjdbc:postgresql://host:5432/keycloakJDBC connection URL.
KC_DB_USERNAMEYesopenfuseDatabase username.
KC_DB_PASSWORDYesDatabase password.
KC_HOSTNAMEYessso.example.comPublic hostname.
KC_PROXY_HEADERSYesxforwardedSet when behind a load balancer.
KC_HTTP_ENABLEDNotrueEnable HTTP (TLS terminated at LB).
KC_HEALTH_ENABLEDNotrueEnable health endpoint on port 9000.

Config Importer

The ghcr.io/openfuseio/openfuse-config-importer image has realm YAML files baked in — no file mounting needed. Set the environment variables and run as a one-time task.

VariableRequiredDefaultDescription
KEYCLOAK_URLYesInternal Keycloak URL.
KEYCLOAK_USERYesKeycloak admin username.
KEYCLOAK_PASSWORDYesKeycloak admin password.
KEYCLOAK_AVAILABILITYCHECK_ENABLEDNotrueWait for Keycloak to be ready before importing.
KEYCLOAK_AVAILABILITYCHECK_TIMEOUTNo120sMax wait time for Keycloak.
IMPORT_FILES_LOCATIONSNo/config/*Path to realm configuration files. The Docker image has them baked in at /config/.
IMPORT_VARSUBSTITUTION_ENABLEDYesSet to true.
IMPORT_VARSUBSTITUTION_UNDEFINEDISTERRORYesSet to true.
SSO_API_BASE_URLYesBFF auth callback base URL (e.g., https://sso.api.example.com).
STAFF_FRONTEND_BASE_URLYesStaff frontend URL.
TENANTS_FRONTEND_BASE_URLYesTenants frontend URL.
TENANTS_FRONTEND_APP_URLYesTenants app URL (e.g., https://app.example.com).

The Config Importer also requires all five KC_*_CLIENT_SECRET variables and the SMTP variables (set SMTP_HOST=disabled to skip email configuration).

UI

VariableRequiredDescription
VITE_API_BASE_HOSTYesAPI hostname (e.g., api.example.com).
VITE_API_PROTOCOLNohttps
VITE_APP_ENVNoproduction
VITE_UI_BASE_HOSTYesUI hostname (e.g., example.com).
VITE_UI_PROTOCOLNohttps

Secrets management

For production, store secrets in your platform's secret manager instead of .env files.

SecretServices that need it
Database credentialsAPI, Keycloak
SESSION_SECRETAPI
KC_BOOTSTRAP_ADMIN_PASSWORDKeycloak, Config Importer
KC_*_CLIENT_SECRET (5 secrets)API, Config Importer
SMTP credentialsAPI, Config Importer
ROOT_USER_PASSWORDAPI

Generate all secrets with openssl rand -hex <length> — use 24 for client secrets, 32 for session secret.

On this page