Edit

Environment Variables

This page is the deployment reference for LearnHouse environment variables. The backend loads apps/api/config/config.yaml first, then overrides matching settings from the environment. The web app reads NEXT_PUBLIC_* values from runtime config or process.env. The CLI-generated .env file is the recommended way to configure a self-hosted instance. See CLI Environment Variables for how that file is laid out and the variables the CLI itself reads.

Values shown as "required" have no safe production fallback. Values shown as "unset" are optional: the feature stays disabled or uses a runtime fallback when the variable is missing.

Instance and hosting

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_SITE_NAMEInstance name returned by the API.stringLearnHouseAPI
LEARNHOUSE_SITE_DESCRIPTIONShort instance description returned by the API.stringLearnHouse is an open-source platform tailored for learning experiences.API
LEARNHOUSE_CONTACT_EMAILContact email for the instance.email[email protected]API
LEARNHOUSE_ENVEnvironment label for backend and Sentry reporting.stringdevAPI, Web
LEARNHOUSE_DEVELOPMENT_MODEEnables development-only API behavior such as docs routes and EE dev override.booleanfalseAPI, CLI
LEARNHOUSE_SAASEnables SaaS deployment mode, plan gating, and platform endpoint warnings.booleanfalseAPI
LEARNHOUSE_SELF_HOSTEDLegacy self-hosting flag used in tenancy inference. Prefer LEARNHOUSE_TENANCY. Accepts true/1/yes/on (case-insensitive); anything else is off. Previously any non-empty value enabled it, including the string false.booleanunset (off)API
LEARNHOUSE_USE_DEFAULT_ORGLegacy default-org flag used in tenancy inference. Prefer LEARNHOUSE_TENANCY. Accepts true/1/yes/on (case-insensitive); anything else is off. Previously any non-empty value enabled it, including the string false.booleanunset (off)API
LEARNHOUSE_TENANCYSelects single host tenancy or multi subdomain tenancy. Multi-tenancy requires EE or SaaS mode.enum: single, multisingle unless inferred as multi-tenantAPI, EE CLI
LEARNHOUSE_DOMAINPublic domain used for org routing, cookie decisions, and custom-domain CNAME targets. Include the port for local development.hostnamelocalhost:3000API, CLI
LEARNHOUSE_FRONTEND_DOMAINFrontend host used by the API when it needs the public frontend domain separately from the backend host.hostnamelocalhost:3000API, EE CLI
LEARNHOUSE_SSLBackend-side SSL flag: picks https vs http for generated links (password reset, email verification, invites, magic links, SSO redirect, media URLs). Accepts true/1/yes/on (case-insensitive); anything else is off. Previously any non-empty value enabled it, including the string false, so check your value before upgrading.booleanfalseAPI
LEARNHOUSE_PORTBackend port. Local config defaults to 1338. In the Docker image it must stay 9000: the image's internal nginx sends API traffic there.integer1338 locally, 9000 in generated Docker installsAPI, CLI, API container
LEARNHOUSE_ALLOWED_ORIGINSComma-separated CORS allowlist.CSV of URLshttp://localhost:3000,http://localhost:3001API
LEARNHOUSE_ALLOWED_REGEXPOrigin regex used by CORS and CSRF checks, and when validating the base URL of emailed links. The default matches any origin, so set it to your own domain in production, for example ^https://(?:[a-z0-9-]+\.)*example\.com$.regex string\b((?:https?://)[^\s/$.?#].[^\s]*)\b (matches everything)API
LEARNHOUSE_MAX_REQUEST_BODY_MBLargest JSON, form or raw request body the API accepts before returning 413. Multipart uploads keep their own per-type limits. 0 disables the cap.integer25API
LEARNHOUSE_COOKIE_DOMAINCookie domain for auth cookies in multi-organization mode (LEARNHOUSE_TENANCY=multi). Ignored in single mode, where cookies are host-only.hostnameunsetAPI, EE CLI
LEARNHOUSE_COOKIE_DOMAIN_ALLOW_BROADAcknowledges intentionally broad cookie domains such as .example.com and silences the safety warning.booleanfalseAPI, EE CLI
LEARNHOUSE_CUSTOM_DOMAIN_DEV_MODESkips DNS verification for all custom domains and marks them verified immediately. Development/testing only.booleanfalseAPI
LEARNHOUSE_PUBLICDocker build argument that produces a community build by excluding non-community code. Also forces the community build of the web app when set to true.booleanfalseDockerfiles (root, API, Web), Web build
LEARNHOUSE_PLATFORM_URLBase URL for LearnHouse platform links, upgrade URLs, and email allowlist checks.URLunset; backend flows fall back to https://www.learnhouse.app and the web token-exchange to https://learnhouse.appAPI, Web
LEARNHOUSE_PLATFORM_API_KEYShared secret for platform-only internal endpoints such as packs. When unset, those endpoints reject every request with a 403 and the API logs an error on the first rejected request.secret stringrequired for SaaS/platform endpointsAPI
CLOUD_INTERNAL_KEYShared secret for SaaS-internal endpoints (custom-domain sync and the cloud_internal router). When unset, those endpoints reject every request and the API logs a startup warning.secret stringunset; required for SaaS custom-domain provisioningAPI

Database, Redis, and collaboration

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_SQL_CONNECTION_STRINGPostgreSQL connection string for the API and Alembic migrations.PostgreSQL URLpostgresql://learnhouse:learnhouse@localhost:5432/learnhouse; production installs should set itAPI, API migrations, CLI
LEARNHOUSE_DB_URLFallback database URL for the standalone apps/api/scripts/migrate.py migration helper when DATABASE_URL is unset.PostgreSQL URLpostgresql://learnhouse:learnhouse@localhost:5432/learnhouseAPI migration script
LEARNHOUSE_AUTO_MIGRATEMigrate the database schema when the API starts. Set to false to run migrations yourself (uv run python cli.py migrate); the API then only creates missing tables. See Database Migrations.booleantrueAPI
LEARNHOUSE_DB_PING_AFTER_IDLE_SECONDSA pooled database connection that sat idle this many seconds is checked before reuse. Lower it if a pooler or firewall drops idle connections sooner.number10API
LEARNHOUSE_PGBOUNCERUses the small client-side pool meant for a PgBouncer/Supavisor pooler even when the URL does not reveal one.booleanfalseAPI
LEARNHOUSE_DB_DRIVERAsync PostgreSQL driver for the API and CLI: asyncpg or psycopg (psycopg 3). psycopg sends each query in one round trip behind a transaction-mode pooler (PgBouncer, Supavisor) where asyncpg needs two, which roughly halves database time when the pooler is far away. Migrations always use psycopg2.stringasyncpgAPI, CLI
LEARNHOUSE_REDIS_CONNECTION_STRINGRedis URL for the API cache/session/event clients. Required: password reset, invitations and email verification fail without Redis.Redis URLredis://localhost:6379/learnhouseAPI, CLI
LEARNHOUSE_REDIS_URLRedis URL for the collaboration server.Redis URLredis://localhost:6379; CLI setup emits redis://redis:6379Collab, CLI
LEARNHOUSE_API_URLAPI base URL used by the collaboration server.URLhttp://localhost:8000; generated compose sets http://localhost:9000Collab, CLI

Security, setup, and auth

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_AUTH_JWT_SECRET_KEYJWT signing key shared by the API and collaboration server. Must be at least 32 characters.secret stringrequiredAPI, Collab, CLI
LEARNHOUSE_INITIAL_ADMIN_EMAILInitial admin email used by the API install command and generated .env files.email[email protected] for the API install command; CLI setup writes the chosen emailAPI, CLI
LEARNHOUSE_INITIAL_ADMIN_PASSWORDInitial admin password used by the API install command and generated .env files.secret stringrequired for install/bootstrapAPI, CLI
LEARNHOUSE_INITIAL_ORG_NAMEInitial organization display name used during install.stringDefault OrganizationAPI, CLI
LEARNHOUSE_INITIAL_ORG_SLUGInitial organization slug used during install.slug stringdefaultAPI, CLI
LEARNHOUSE_GOOGLE_CLIENT_IDGoogle OAuth client ID used by web auth proxy routes. The API also accepts it as a fallback audience for backend token validation.stringunset unless Google OAuth is enabledWeb, CLI, API
LEARNHOUSE_GOOGLE_CLIENT_SECRETGoogle OAuth client secret used by the web token exchange route.secret stringunset unless Google OAuth is enabledWeb, CLI
LEARNHOUSE_GOOGLE_OAUTH_CLIENT_IDExpected Google OAuth audience for backend ID-token validation. Required to enable Google sign-in: if neither this nor LEARNHOUSE_GOOGLE_CLIENT_ID is set the audience cannot be checked and Google sign-in is refused.stringunsetAPI

Web runtime

VariableDescriptionTypeDefault / requiredUsed by
NEXT_PUBLIC_LEARNHOUSE_API_URLExplicit API URL for frontend API calls. If unset, the web app derives it from NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL.URLderived as {backend}/api/v1/Web, CLI
NEXT_PUBLIC_LEARNHOUSE_BACKEND_URLBackend base URL used by the web app and server-side auth proxy routes.URLhttp://localhost/ in config helpers; local dev checker writes http://localhost:1338/Web, CLI
LEARNHOUSE_INTERNAL_API_URLOptional server-only backend base URL (same shape as NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL, e.g. http://learnhouse-api:9000/). When set, server-side rendering and the session lookup call the API over this internal address instead of the public URL. It takes precedence over NEXT_PUBLIC_LEARNHOUSE_API_URL on the server and is never sent to the browser. Sign-in/out still go through NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL.URLunset, server uses the public URLWeb
NEXT_PUBLIC_LEARNHOUSE_DOMAINPublic frontend domain. The web app can also fall back to runtime cookies set by the backend.hostnamelocalhost or runtime cookie fallbackWeb, CLI
NEXT_PUBLIC_LEARNHOUSE_TOP_DOMAINTop-level/root domain used for cookie and subdomain helpers.hostnamederived from NEXT_PUBLIC_LEARNHOUSE_DOMAIN when unsetWeb, CLI
NEXT_PUBLIC_LEARNHOUSE_MULTI_ORGLegacy public multi-org flag generated by the CLI. Backend LEARNHOUSE_TENANCY is authoritative for current behavior.booleanfalseCLI, legacy Web config
NEXT_PUBLIC_LEARNHOUSE_DEFAULT_ORGDefault organization slug used by frontend routing fallbacks.slug stringdefaultWeb, CLI
NEXT_PUBLIC_LEARNHOUSE_HTTPSSelects https:// instead of http:// in frontend URL helpers. The web app only treats the exact lowercase value true as enabled.booleanfalseWeb, CLI
NEXT_PUBLIC_LEARNHOUSE_MEDIA_URLBase URL for direct media links. If unset, media URLs use the backend URL.URLunset, falls back to backend URLWeb
NEXT_PUBLIC_LEARNHOUSE_PLATFORM_URLBrowser-safe platform base URL for upgrade and auth exchange flows.URLunsetWeb
NEXT_PUBLIC_LEARNHOUSE_SENTRY_DSNBrowser/server Sentry DSN for the web app.URLunsetWeb
NEXT_PUBLIC_LEARNHOUSE_ENVWeb Sentry environment label.stringdevWeb
NEXT_PUBLIC_POSTHOG_KEYPostHog project key for product analytics. Analytics stay off unless this is set.stringunsetWeb

AI

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_IS_AI_ENABLEDKept for older configurations; not read by the API. AI features depend on a configured provider key.booleanfalseCLI
LEARNHOUSE_GEMINI_API_KEYLegacy Google/Gemini key and fallback embeddings key for providers without embeddings.secret stringunsetAPI, CLI
LEARNHOUSE_AI_PROVIDERProvider for generation: google, openai, anthropic, deepseek, moonshot, mistral, openrouter, bedrock, ollama, or another supported Pydantic AI provider.stringgoogleAPI
LEARNHOUSE_AI_API_KEYAPI key for the selected AI provider. Not required for ollama; optional for bedrock.secret stringunset; required for most providersAPI
LEARNHOUSE_AI_BASE_URLCustom endpoint for OpenAI-compatible or local providers.URLunset; Ollama falls back to http://localhost:11434/v1API
LEARNHOUSE_AI_MODEL_FASTLow-latency model tier for titles, follow-ups, and migration tasks.model idgemini-3.1-flash-liteAPI
LEARNHOUSE_AI_MODEL_STANDARDStandard model tier for chat, RAG, and standard-plan generation.model idgemini-3.5-flashAPI
LEARNHOUSE_AI_MODEL_PROPro model tier for upgraded course planning and generation flows.model idgemini-3.1-pro-previewAPI
LEARNHOUSE_AI_IMAGE_MODELGoogle image-generation model ("nano banana"). Google-only path (uses the Gemini key regardless of provider).model idgemini-2.5-flash-imageAPI
LEARNHOUSE_AI_TTS_MODELGoogle text-to-speech model for AI audio / podcast generation. Google-only path.model idgemini-3.8-flash-ttsAPI
LEARNHOUSE_AI_EMBEDDING_PROVIDEROptional provider override for RAG embeddings.stringsame as LEARNHOUSE_AI_PROVIDERAPI
LEARNHOUSE_AI_EMBEDDING_MODELOptional embedding model override.model idprovider default, such as gemini-embedding-001, text-embedding-3-small, or nomic-embed-textAPI
LEARNHOUSE_AI_EMBEDDING_DIMENSIONSEmbedding vector size. Changing this requires a matching database migration and re-index.integer768API

MCP

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_MCP_ENABLEDServes the MCP endpoint at /mcp so members can connect AI apps such as Claude, ChatGPT or Cursor.booleantrueAPI
LEARNHOUSE_MCP_PUBLIC_URLPublic URL of the MCP endpoint. Set it when a proxy changes the host or scheme, since sign-in tokens are bound to this URL.URLunset; derived from each requestAPI

Email

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_EMAIL_PROVIDEROutbound email provider.enum: resend, smtpresendAPI, CLI
LEARNHOUSE_RESEND_API_KEYResend API key when LEARNHOUSE_EMAIL_PROVIDER=resend.secret stringunset; required to send via ResendAPI, CLI
LEARNHOUSE_SYSTEM_EMAIL_ADDRESSSender address for system email.emailunset; CLI setup can emit noreply@{domain}API, CLI
LEARNHOUSE_SYSTEM_EMAIL_SENDER_NAMEDisplay name on system email, as in Name <address>. The address itself is not configurable per sender.stringLearnHouseAPI
LEARNHOUSE_SMTP_HOSTSMTP server hostname when LEARNHOUSE_EMAIL_PROVIDER=smtp.hostnameunsetAPI, CLI
LEARNHOUSE_SMTP_PORTSMTP server port.integer587API, CLI
LEARNHOUSE_SMTP_USERNAMESMTP authentication username.stringunsetAPI, CLI
LEARNHOUSE_SMTP_PASSWORDSMTP authentication password.secret stringunsetAPI, CLI
LEARNHOUSE_SMTP_USE_TLSEnables TLS for SMTP.booleantrueAPI, CLI

Content storage

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_CONTENT_DELIVERY_TYPEStorage backend for uploaded content.enum: filesystem, s3apifilesystemAPI, CLI
LEARNHOUSE_S3_API_BUCKET_NAMES3-compatible bucket name when using s3api.stringunset; required for S3 storageAPI, CLI
LEARNHOUSE_S3_API_ENDPOINT_URLS3-compatible endpoint URL. Leave unset for provider defaults where supported.URLunsetAPI, CLI
LEARNHOUSE_S3_API_REGIONRegion for the course import/export S3 client (falls back to AWS_REGION, then AWS_DEFAULT_REGION). The default suits Cloudflare R2; set the real region for AWS S3 or MinIO, which check it against the endpoint. Uploads use AWS_DEFAULT_REGION.stringautoAPI
LEARNHOUSE_MEDIA_URLPublic base URL that serves /content files, used for images in emails (such as organization logos). LEARNHOUSE_BACKEND_URL is accepted as a fallback name. When unset, the API uses {scheme}://api.{LEARNHOUSE_DOMAIN} for a real domain, otherwise the request's own host.URLunsetAPI
LEARNHOUSE_LMS_IMPORT_MAX_MBLargest file accepted by the LMS course import, in MB.integer4096API

Sessions and security

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_AUTH_REFRESH_TOKEN_DAYSHow many days a user can stay away before having to sign in again. Each refresh starts a new window, so active users stay signed in. Values below 14 are raised to 14.integer30API
LEARNHOUSE_AUTH_LEGACY_SESSION_GRACE_DAYSHow long, in days, a session created before LearnHouse recorded the sign-in method keeps working after it is first refreshed.integer30API
LEARNHOUSE_MFA_ENCRYPTION_KEYKey material used to encrypt users' MFA secrets in the database.secret stringfalls back to LEARNHOUSE_AUTH_JWT_SECRET_KEYAPI
LEARNHOUSE_SECURITY__TRUST_PROXY_HEADERSRead the client IP from X-Forwarded-For / X-Real-IP for rate limiting, but only when the direct connection comes from a private or loopback address. Set to false to always use the connection address.booleantrueAPI

Logging and startup

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_LOG_LEVELAPI log level (DEBUG, INFO, WARNING, ERROR).stringINFOAPI
LEARNHOUSE_DB_STARTUP_ATTEMPTSHow many times the API retries a transient database connection error at startup before giving up. Permanent errors such as a wrong password fail at once.integer5API

Background jobs and media processing

These jobs run inside the API process. Most of them need Redis.

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_HLS_ENABLEDTranscode uploaded videos to HLS streams. Needs Redis and ffmpeg/ffprobe on the API's PATH; the community ghcr.io/learnhouse/app image includes them. Until a video is transcoded, the MP4 is served. Only the exact value true enables it.booleanfalseAPI
LEARNHOUSE_HLS_CONCURRENCYMaximum transcodes running at once per API process.integer1API
LEARNHOUSE_HLS_FFMPEG_THREADSThreads per ffmpeg transcode. 0 lets ffmpeg use all cores.integer1API
LEARNHOUSE_HLS_MAX_RETRIESAttempts per video before a transcode is marked failed.integer6API
LEARNHOUSE_HLS_ENCRYPTEncrypt HLS segments. Any value other than true turns it off.booleantrueAPI
LEARNHOUSE_CAPTIONS_CONCURRENCYMaximum AI caption jobs running at once per API process.integer1API
LEARNHOUSE_FFMPEG_PATHffmpeg executable used for AI captions.pathffmpegAPI
LEARNHOUSE_FFPROBE_PATHffprobe executable used for AI captions.pathffprobeAPI
LEARNHOUSE_RAG_CONCURRENCYMaximum AI search indexing jobs running at once.integer2API
LEARNHOUSE_RAG_BACKFILL_HOURSHours between sweeps that index course content missing from AI search. 0 turns the sweep off.number3API
LEARNHOUSE_RAG_BACKFILL_BATCHMaximum items queued per indexing sweep.integer500API
LEARNHOUSE_BACKFILL_INTERVAL_HOURSHours between scheduled backfill runs, which catch up work that predates a feature: HLS transcodes for older videos (when HLS is enabled), AI search indexing, and AI chapters for captioned videos on paid plans. 0 turns them off.number48API
LEARNHOUSE_BACKFILL_HLS_LIMITMaximum videos one backfill run queues for HLS.integer50API
LEARNHOUSE_BACKFILL_CHAPTERS_LIMITMaximum videos one backfill run spends AI credits on for chapters.integer100API
LEARNHOUSE_DRIP_EMAILS_DISABLEDAny value turns off the hourly job that emails learners when drip content unlocks.any value or unsetunset (job runs)API
LEARNHOUSE_MESSAGING_EMAILS_DISABLEDAny value turns off the job that emails unread messages and delivers reminders.any value or unsetunset (job runs)API

Code execution

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_JUDGE0_API_URLJudge0 API URL. Setting it enables code execution routes.URLunsetAPI
LEARNHOUSE_JUDGE0_CLIENT_IDOptional Judge0 client ID.stringunsetAPI
LEARNHOUSE_JUDGE0_CLIENT_SECRETOptional Judge0 client secret.secret stringunsetAPI

Observability

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_SENTRY_DSNBackend Sentry DSN; also used by the web edge Sentry config as a non-public fallback.URLunsetAPI, Web edge
LEARNHOUSE_LOGFIRE_ENABLEDCLI-generated Logfire flag. The current OSS runtime does not read it directly.booleanFalse in CLI-generated .envCLI

Development controls

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_DISABLE_EESet to 1 to disable Enterprise hooks even if the ee/ folder exists. The web build also drops Enterprise code when it is set.1 or unsetunset; CLI dev sets 1 unless --ee is usedAPI, Web build, CLI dev
LEARNHOUSE_FORCE_EESet to 1 to serve Enterprise features without a license. Only honored when LEARNHOUSE_DEVELOPMENT_MODE is on.1 or unsetunset; CLI dev sets 1 with --eeAPI, EE backend, CLI dev

Enterprise Edition

These variables only take effect on Enterprise builds, which include the ee/ code. Enterprise features also need an active license (or LEARNHOUSE_FORCE_EE=1 in development mode).

License

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_LICENSE_KEYEnterprise license key. The API checks it with the license server at startup and on a periodic heartbeat. The CLI also uses it as the password for the Enterprise image registry.secret stringrequired for EnterpriseEE backend, EE CLI
LEARNHOUSE_LICENSE_SERVER_URLLicense server URL.URLhttps://enterprise.learnhouse.appEE backend
LEARNHOUSE_LICENSE_GRACE_HOURSHow long, in hours since the license server last answered, Enterprise features keep working while the server can't be reached. Clamped to 1 to 168. A revoked or expired license is deactivated at once.integer25EE backend
LEARNHOUSE_DATA_DIRDirectory where the API stores the cached license token, the instance ID and the time of the last successful license check. Mount it on a volume so they survive container recreation.path/app/dataEE backend
LEARNHOUSE_DEPLOYMENT_IDDeployment identifier reported to the license server.stringthe instance IDEE backend
LEARNHOUSE_VERSIONVersion reported to the license server.stringunknownEE backend

Payments (Stripe)

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_STRIPE_SECRET_KEYStripe secret key (sk_live_... or sk_test_...). Required to enable Stripe.secret stringunsetAPI, EE backend
LEARNHOUSE_STRIPE_PUBLISHABLE_KEYStripe publishable key (pk_...). Required to enable Stripe.stringunsetAPI, EE backend
LEARNHOUSE_STRIPE_CLIENT_IDStripe Connect OAuth client ID (ca_...), needed for organizations to connect their own Stripe account.stringunsetAPI, EE backend
LEARNHOUSE_STRIPE_WEBHOOK_STANDARD_SECRETSigning secret (whsec_...) for the standard webhook endpoint, POST /api/v1/payments/stripe/webhook.secret stringunsetAPI, EE backend
LEARNHOUSE_STRIPE_WEBHOOK_CONNECT_SECRETSigning secret (whsec_...) for the Connect webhook endpoint, POST /api/v1/payments/stripe/webhook/connect.secret stringunsetAPI, EE backend

Single sign-on

VariableDescriptionTypeDefault / requiredUsed by
WORKOS_API_KEYWorkOS API key. WorkOS-backed SSO is available only when both this and WORKOS_CLIENT_ID are set.secret stringunsetEE backend
WORKOS_CLIENT_IDWorkOS client ID.stringunsetEE backend
SSO_REDIRECT_URIFull SSO callback URL. When set, it is used as is.URLunsetEE backend
SSO_REDIRECT_URI_BASEBase URL for the SSO callback when SSO_REDIRECT_URI is unset. /api/v1/auth/sso/callback is appended unless the value already ends with it.URLfalls back to LEARNHOUSE_DOMAIN, then http://localhost:4000EE backend

SCORM

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_SCORM_MAX_PACKAGE_SIZE_MBLargest SCORM package upload, in MB.integer5120 (5 GB)EE backend
LEARNHOUSE_SCORM_MAX_FILE_SIZE_MBLargest single file inside a package, in MB.integer2048 (2 GB)EE backend
LEARNHOUSE_SCORM_MAX_UNCOMPRESSED_MBCap on the total uncompressed size of a package, in MB (zip-bomb guard).integer25600 (25 GB)EE backend
LEARNHOUSE_SCORM_TEMP_TTL_MINUTESHow long an uploaded package that was analyzed but not imported is kept, in minutes.integer120EE backend

Live sessions

See Live Sessions.

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_MEET_URLPublic websocket URL of the LearnHouse Meet media server (apps/meet).URLunsetEE backend
LEARNHOUSE_MEET_API_KEYAPI key of that server.stringunsetEE backend
LEARNHOUSE_MEET_API_SECRETMatching secret; signs room tokens and checks webhooks.secret stringunsetEE backend
LEARNHOUSE_MEET_INTERNAL_URLHow the API reaches the media server, when different from the public URL.URLLEARNHOUSE_MEET_URLEE backend
LEARNHOUSE_MEET_RECORDINGtrue when the recorder runs; shows hosts the record button.booleanfalseEE backend
LEARNHOUSE_LIVE_GOOGLE_CLIENT_ID / _SECRETPlatform Google OAuth app for live sessions. Unset: org admins can use their own app.string / secretunsetEE backend
LEARNHOUSE_LIVE_ZOOM_CLIENT_ID / _SECRETPlatform Zoom OAuth app for live sessions.string / secretunsetEE backend
LEARNHOUSE_LIVE_OAUTH_REDIRECT_URIExact OAuth callback URL for live session providers.URL<API>/api/v1/live_sessions/oauth/callbackEE backend

Analytics

See Analytics. Analytics is stored in PostgreSQL and needs no extra service.

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_ANALYTICS_MAINTENANCERun the analytics summary and retention job inside the API. Set to false only if another process runs it.booleantrueEE backend
LEARNHOUSE_TINYBIRD_API_URLLegacy. Only read by the one-time Tinybird import.URLunsetEE import script
LEARNHOUSE_TINYBIRD_READ_TOKENLegacy. Tinybird read token for the same import.secret stringunsetEE import script

LTI

See LTI.

VariableDescriptionTypeDefault / requiredUsed by
LEARNHOUSE_LTI_BASE_URLPublic API origin used in the tool URLs you give the LMS (login, launch, keyset, registration). Set it when the LMS reaches the API through a different host than browsers do.URLunset; resolved like LEARNHOUSE_MEDIA_URLEE backend
LEARNHOUSE_LTI_ALLOW_PRIVATE_HOSTSAllow LTI requests to LMS addresses on private or internal networks. Accepts true/1/yes. Ignored on LearnHouse Cloud.booleanfalseEE backend

LearnHouse Cloud only

The hosted LearnHouse Cloud platform reads these variables. Self-hosted instances don't need them.

VariableUsed byPurpose
LEARNHOUSE_NUDGES_ENABLED, LEARNHOUSE_NUDGES_NO_SCHEDULER, LEARNHOUSE_NUDGES_BACKFILL_MODE, LEARNHOUSE_NUDGES_ACTIVATION_DATEAPILifecycle email nudges. The scheduler only runs in SaaS mode.
LEARNHOUSE_RESEND_WEBHOOK_SECRETAPIVerifies Resend delivery webhooks for nudges
LOOPS_API_KEYAPI, WebMarketing contact sync
NEXT_PUBLIC_TURNSTILE_SITE_KEY, TURNSTILE_SECRET_KEYWebCloudflare Turnstile on auth forms, active only in SaaS mode
RESEND_API_KEY, RESEND_FROM_EMAIL, ABSTRACT_EMAIL_API_KEYWebPlatform emails and disposable-email checks
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_*, CRON_SECRET, LEARNHOUSE_CLOUD_INTERNAL_KEYWebPlatform billing

These variables do not use the LEARNHOUSE_ prefix, but the CLI writes them into the same .env file and several services require them.

VariableDescriptionTypeDefault / requiredUsed by
HTTP_PORTPublic HTTP port chosen during CLI setup.integersetup choiceCLI-generated compose
NEXTAUTH_URLBase URL for NextAuth-compatible auth helpers.URLgenerated from the configured domainCLI, doctor
NEXTAUTH_SECRETSecret used by NextAuth-compatible auth helpers.secret stringgenerated by CLI setupCLI, doctor
COLLAB_INTERNAL_KEYShared key for API-to-collaboration-server internal auth.secret stringrequired for dev and production collab authAPI, Collab, CLI
NEXT_PUBLIC_COLLAB_URLPublic WebSocket URL for the collaboration server.WebSocket URLws://localhost:4000; CLI setup generates it from the configured domainWeb, CLI
COLLAB_PORTLocal collaboration server port.integer4000 in local dev checkerCollab, CLI dev
COLLAB_TRUST_PROXYSet to true when the collaboration server runs behind a reverse proxy so client IPs (used for WebSocket rate limiting) are read from X-Forwarded-For.booleanfalseCollab
POSTGRES_USERPostgreSQL user for generated non-external database installs.stringlearnhouseCLI-generated compose
POSTGRES_PASSWORDPostgreSQL password for generated non-external database installs.secret stringgenerated by CLI setupCLI-generated compose
POSTGRES_DBPostgreSQL database name for generated non-external database installs.stringlearnhouseCLI-generated compose

Full example

.env
# Domain and hosting
LEARNHOUSE_DOMAIN=learn.example.com
HTTP_PORT=443
NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL=https://learn.example.com/
NEXT_PUBLIC_LEARNHOUSE_API_URL=https://learn.example.com/api/v1/
NEXT_PUBLIC_LEARNHOUSE_DOMAIN=learn.example.com
NEXT_PUBLIC_LEARNHOUSE_TOP_DOMAIN=example.com
NEXT_PUBLIC_LEARNHOUSE_HTTPS=true
NEXT_PUBLIC_LEARNHOUSE_DEFAULT_ORG=default

# Backend
LEARNHOUSE_SQL_CONNECTION_STRING=postgresql://learnhouse:change-me@db:5432/learnhouse
LEARNHOUSE_REDIS_CONNECTION_STRING=redis://redis:6379/learnhouse
LEARNHOUSE_PORT=9000

# Security and bootstrap
# Generate each secret with: openssl rand -hex 32
LEARNHOUSE_AUTH_JWT_SECRET_KEY=
LEARNHOUSE_INITIAL_ADMIN_EMAIL[email protected]
LEARNHOUSE_INITIAL_ADMIN_PASSWORD=change-this-password
LEARNHOUSE_INITIAL_ORG_NAME=Default Organization
LEARNHOUSE_INITIAL_ORG_SLUG=default

# Collaboration
COLLAB_INTERNAL_KEY=
LEARNHOUSE_REDIS_URL=redis://redis:6379
NEXT_PUBLIC_COLLAB_URL=wss://learn.example.com/collab

# AI, email, and storage
LEARNHOUSE_IS_AI_ENABLED=False
LEARNHOUSE_EMAIL_PROVIDER=resend
LEARNHOUSE_CONTENT_DELIVERY_TYPE=filesystem