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
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_SITE_NAME | Instance name returned by the API. | string | LearnHouse | API |
LEARNHOUSE_SITE_DESCRIPTION | Short instance description returned by the API. | string | LearnHouse is an open-source platform tailored for learning experiences. | API |
LEARNHOUSE_CONTACT_EMAIL | Contact email for the instance. | [email protected] | API | |
LEARNHOUSE_ENV | Environment label for backend and Sentry reporting. | string | dev | API, Web |
LEARNHOUSE_DEVELOPMENT_MODE | Enables development-only API behavior such as docs routes and EE dev override. | boolean | false | API, CLI |
LEARNHOUSE_SAAS | Enables SaaS deployment mode, plan gating, and platform endpoint warnings. | boolean | false | API |
LEARNHOUSE_SELF_HOSTED | Legacy self-hosting flag used in tenancy inference. Prefer LEARNHOUSE_TENANCYtrue1yesonfalse | boolean | unset (off) | API |
LEARNHOUSE_USE_DEFAULT_ORG | Legacy default-org flag used in tenancy inference. Prefer LEARNHOUSE_TENANCYtrue1yesonfalse | boolean | unset (off) | API |
LEARNHOUSE_TENANCY | Selects singlemulti | enum: singlemulti | single | API, EE CLI |
LEARNHOUSE_DOMAIN | Public domain used for org routing, cookie decisions, and custom-domain CNAME targets. Include the port for local development. | hostname | localhost:3000 | API, CLI |
LEARNHOUSE_FRONTEND_DOMAIN | Frontend host used by the API when it needs the public frontend domain separately from the backend host. | hostname | localhost:3000 | API, EE CLI |
LEARNHOUSE_SSL | Backend-side SSL flag: picks httpshttptrue1yesonfalse | boolean | false | API |
LEARNHOUSE_PORT | Backend port. Local config defaults to 13389000 | integer | 13389000 | API, CLI, API container |
LEARNHOUSE_ALLOWED_ORIGINS | Comma-separated CORS allowlist. | CSV of URLs | http://localhost:3000,http://localhost:3001 | API |
LEARNHOUSE_ALLOWED_REGEXP | Origin 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 | API |
LEARNHOUSE_MAX_REQUEST_BODY_MB | Largest JSON, form or raw request body the API accepts before returning 4130 | integer | 25 | API |
LEARNHOUSE_COOKIE_DOMAIN | Cookie domain for auth cookies in multi-organization mode (LEARNHOUSE_TENANCY=multi | hostname | unset | API, EE CLI |
LEARNHOUSE_COOKIE_DOMAIN_ALLOW_BROAD | Acknowledges intentionally broad cookie domains such as .example.com | boolean | false | API, EE CLI |
LEARNHOUSE_CUSTOM_DOMAIN_DEV_MODE | Skips DNS verification for all custom domains and marks them verified immediately. Development/testing only. | boolean | false | API |
LEARNHOUSE_PUBLIC | Docker 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 | boolean | false | Dockerfiles (root, API, Web), Web build |
LEARNHOUSE_PLATFORM_URL | Base URL for LearnHouse platform links, upgrade URLs, and email allowlist checks. | URL | unset; backend flows fall back to https://www.learnhouse.apphttps://learnhouse.app | API, Web |
LEARNHOUSE_PLATFORM_API_KEY | Shared 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 string | required for SaaS/platform endpoints | API |
CLOUD_INTERNAL_KEY | Shared secret for SaaS-internal endpoints (custom-domain sync and the cloud_internal | secret string | unset; required for SaaS custom-domain provisioning | API |
Database, Redis, and collaboration
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_SQL_CONNECTION_STRING | PostgreSQL connection string for the API and Alembic migrations. | PostgreSQL URL | postgresql://learnhouse:learnhouse@localhost:5432/learnhouse | API, API migrations, CLI |
LEARNHOUSE_DB_URL | Fallback database URL for the standalone apps/api/scripts/migrate.pyDATABASE_URL | PostgreSQL URL | postgresql://learnhouse:learnhouse@localhost:5432/learnhouse | API migration script |
LEARNHOUSE_AUTO_MIGRATE | Migrate the database schema when the API starts. Set to falseuv run python cli.py migrate | boolean | true | API |
LEARNHOUSE_DB_PING_AFTER_IDLE_SECONDS | A pooled database connection that sat idle this many seconds is checked before reuse. Lower it if a pooler or firewall drops idle connections sooner. | number | 10 | API |
LEARNHOUSE_PGBOUNCER | Uses the small client-side pool meant for a PgBouncer/Supavisor pooler even when the URL does not reveal one. | boolean | false | API |
LEARNHOUSE_DB_DRIVER | Async PostgreSQL driver for the API and CLI: asyncpgpsycopg | string | asyncpg | API, CLI |
LEARNHOUSE_REDIS_CONNECTION_STRING | Redis URL for the API cache/session/event clients. Required: password reset, invitations and email verification fail without Redis. | Redis URL | redis://localhost:6379/learnhouse | API, CLI |
LEARNHOUSE_REDIS_URL | Redis URL for the collaboration server. | Redis URL | redis://localhost:6379redis://redis:6379 | Collab, CLI |
LEARNHOUSE_API_URL | API base URL used by the collaboration server. | URL | http://localhost:8000http://localhost:9000 | Collab, CLI |
Security, setup, and auth
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_AUTH_JWT_SECRET_KEY | JWT signing key shared by the API and collaboration server. Must be at least 32 characters. | secret string | required | API, Collab, CLI |
LEARNHOUSE_INITIAL_ADMIN_EMAIL | Initial admin email used by the API install command and generated .env | [email protected] | API, CLI | |
LEARNHOUSE_INITIAL_ADMIN_PASSWORD | Initial admin password used by the API install command and generated .env | secret string | required for install/bootstrap | API, CLI |
LEARNHOUSE_INITIAL_ORG_NAME | Initial organization display name used during install. | string | Default Organization | API, CLI |
LEARNHOUSE_INITIAL_ORG_SLUG | Initial organization slug used during install. | slug string | default | API, CLI |
LEARNHOUSE_GOOGLE_CLIENT_ID | Google OAuth client ID used by web auth proxy routes. The API also accepts it as a fallback audience for backend token validation. | string | unset unless Google OAuth is enabled | Web, CLI, API |
LEARNHOUSE_GOOGLE_CLIENT_SECRET | Google OAuth client secret used by the web token exchange route. | secret string | unset unless Google OAuth is enabled | Web, CLI |
LEARNHOUSE_GOOGLE_OAUTH_CLIENT_ID | Expected Google OAuth audience for backend ID-token validation. Required to enable Google sign-in: if neither this nor LEARNHOUSE_GOOGLE_CLIENT_ID | string | unset | API |
Web runtime
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
NEXT_PUBLIC_LEARNHOUSE_API_URL | Explicit API URL for frontend API calls. If unset, the web app derives it from NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL | URL | derived as {backend}/api/v1/ | Web, CLI |
NEXT_PUBLIC_LEARNHOUSE_BACKEND_URL | Backend base URL used by the web app and server-side auth proxy routes. | URL | http://localhost/http://localhost:1338/ | Web, CLI |
LEARNHOUSE_INTERNAL_API_URL | Optional server-only backend base URL (same shape as NEXT_PUBLIC_LEARNHOUSE_BACKEND_URLhttp://learnhouse-api:9000/NEXT_PUBLIC_LEARNHOUSE_API_URLNEXT_PUBLIC_LEARNHOUSE_BACKEND_URL | URL | unset, server uses the public URL | Web |
NEXT_PUBLIC_LEARNHOUSE_DOMAIN | Public frontend domain. The web app can also fall back to runtime cookies set by the backend. | hostname | localhost | Web, CLI |
NEXT_PUBLIC_LEARNHOUSE_TOP_DOMAIN | Top-level/root domain used for cookie and subdomain helpers. | hostname | derived from NEXT_PUBLIC_LEARNHOUSE_DOMAIN | Web, CLI |
NEXT_PUBLIC_LEARNHOUSE_MULTI_ORG | Legacy public multi-org flag generated by the CLI. Backend LEARNHOUSE_TENANCY | boolean | false | CLI, legacy Web config |
NEXT_PUBLIC_LEARNHOUSE_DEFAULT_ORG | Default organization slug used by frontend routing fallbacks. | slug string | default | Web, CLI |
NEXT_PUBLIC_LEARNHOUSE_HTTPS | Selects https://http://true | boolean | false | Web, CLI |
NEXT_PUBLIC_LEARNHOUSE_MEDIA_URL | Base URL for direct media links. If unset, media URLs use the backend URL. | URL | unset, falls back to backend URL | Web |
NEXT_PUBLIC_LEARNHOUSE_PLATFORM_URL | Browser-safe platform base URL for upgrade and auth exchange flows. | URL | unset | Web |
NEXT_PUBLIC_LEARNHOUSE_SENTRY_DSN | Browser/server Sentry DSN for the web app. | URL | unset | Web |
NEXT_PUBLIC_LEARNHOUSE_ENV | Web Sentry environment label. | string | dev | Web |
NEXT_PUBLIC_POSTHOG_KEY | PostHog project key for product analytics. Analytics stay off unless this is set. | string | unset | Web |
AI
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_IS_AI_ENABLED | Kept for older configurations; not read by the API. AI features depend on a configured provider key. | boolean | false | CLI |
LEARNHOUSE_GEMINI_API_KEY | Legacy Google/Gemini key and fallback embeddings key for providers without embeddings. | secret string | unset | API, CLI |
LEARNHOUSE_AI_PROVIDER | Provider for generation: googleopenaianthropicdeepseekmoonshotmistralopenrouterbedrockollama | string | google | API |
LEARNHOUSE_AI_API_KEY | API key for the selected AI provider. Not required for ollamabedrock | secret string | unset; required for most providers | API |
LEARNHOUSE_AI_BASE_URL | Custom endpoint for OpenAI-compatible or local providers. | URL | unset; Ollama falls back to http://localhost:11434/v1 | API |
LEARNHOUSE_AI_MODEL_FAST | Low-latency model tier for titles, follow-ups, and migration tasks. | model id | gemini-3.1-flash-lite | API |
LEARNHOUSE_AI_MODEL_STANDARD | Standard model tier for chat, RAG, and standard-plan generation. | model id | gemini-3.5-flash | API |
LEARNHOUSE_AI_MODEL_PRO | Pro model tier for upgraded course planning and generation flows. | model id | gemini-3.1-pro-preview | API |
LEARNHOUSE_AI_IMAGE_MODEL | Google image-generation model ("nano banana"). Google-only path (uses the Gemini key regardless of provider). | model id | gemini-2.5-flash-image | API |
LEARNHOUSE_AI_TTS_MODEL | Google text-to-speech model for AI audio / podcast generation. Google-only path. | model id | gemini-3.8-flash-tts | API |
LEARNHOUSE_AI_EMBEDDING_PROVIDER | Optional provider override for RAG embeddings. | string | same as LEARNHOUSE_AI_PROVIDER | API |
LEARNHOUSE_AI_EMBEDDING_MODEL | Optional embedding model override. | model id | provider default, such as gemini-embedding-001text-embedding-3-smallnomic-embed-text | API |
LEARNHOUSE_AI_EMBEDDING_DIMENSIONS | Embedding vector size. Changing this requires a matching database migration and re-index. | integer | 768 | API |
MCP
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_MCP_ENABLED | Serves the MCP endpoint at /mcp | boolean | true | API |
LEARNHOUSE_MCP_PUBLIC_URL | Public URL of the MCP endpoint. Set it when a proxy changes the host or scheme, since sign-in tokens are bound to this URL. | URL | unset; derived from each request | API |
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_EMAIL_PROVIDER | Outbound email provider. | enum: resendsmtp | resend | API, CLI |
LEARNHOUSE_RESEND_API_KEY | Resend API key when LEARNHOUSE_EMAIL_PROVIDER=resend | secret string | unset; required to send via Resend | API, CLI |
LEARNHOUSE_SYSTEM_EMAIL_ADDRESS | Sender address for system email. | unset; CLI setup can emit noreply@{domain} | API, CLI | |
LEARNHOUSE_SYSTEM_EMAIL_SENDER_NAME | Display name on system email, as in Name <address> | string | LearnHouse | API |
LEARNHOUSE_SMTP_HOST | SMTP server hostname when LEARNHOUSE_EMAIL_PROVIDER=smtp | hostname | unset | API, CLI |
LEARNHOUSE_SMTP_PORT | SMTP server port. | integer | 587 | API, CLI |
LEARNHOUSE_SMTP_USERNAME | SMTP authentication username. | string | unset | API, CLI |
LEARNHOUSE_SMTP_PASSWORD | SMTP authentication password. | secret string | unset | API, CLI |
LEARNHOUSE_SMTP_USE_TLS | Enables TLS for SMTP. | boolean | true | API, CLI |
Content storage
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_CONTENT_DELIVERY_TYPE | Storage backend for uploaded content. | enum: filesystems3api | filesystem | API, CLI |
LEARNHOUSE_S3_API_BUCKET_NAME | S3-compatible bucket name when using s3api | string | unset; required for S3 storage | API, CLI |
LEARNHOUSE_S3_API_ENDPOINT_URL | S3-compatible endpoint URL. Leave unset for provider defaults where supported. | URL | unset | API, CLI |
LEARNHOUSE_S3_API_REGION | Region for the course import/export S3 client (falls back to AWS_REGIONAWS_DEFAULT_REGIONAWS_DEFAULT_REGION | string | auto | API |
LEARNHOUSE_MEDIA_URL | Public base URL that serves /contentLEARNHOUSE_BACKEND_URL{scheme}://api.{LEARNHOUSE_DOMAIN} | URL | unset | API |
LEARNHOUSE_LMS_IMPORT_MAX_MB | Largest file accepted by the LMS course import, in MB. | integer | 4096 | API |
Sessions and security
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_AUTH_REFRESH_TOKEN_DAYS | How 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 1414 | integer | 30 | API |
LEARNHOUSE_AUTH_LEGACY_SESSION_GRACE_DAYS | How long, in days, a session created before LearnHouse recorded the sign-in method keeps working after it is first refreshed. | integer | 30 | API |
LEARNHOUSE_MFA_ENCRYPTION_KEY | Key material used to encrypt users' MFA secrets in the database. | secret string | falls back to LEARNHOUSE_AUTH_JWT_SECRET_KEY | API |
LEARNHOUSE_SECURITY__TRUST_PROXY_HEADERS | Read the client IP from X-Forwarded-ForX-Real-IPfalse | boolean | true | API |
Logging and startup
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_LOG_LEVEL | API log level (DEBUGINFOWARNINGERROR | string | INFO | API |
LEARNHOUSE_DB_STARTUP_ATTEMPTS | How 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. | integer | 5 | API |
Background jobs and media processing
These jobs run inside the API process. Most of them need Redis.
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_HLS_ENABLED | Transcode uploaded videos to HLS streams. Needs Redis and ffmpegffprobePATHghcr.io/learnhouse/apptrue | boolean | false | API |
LEARNHOUSE_HLS_CONCURRENCY | Maximum transcodes running at once per API process. | integer | 1 | API |
LEARNHOUSE_HLS_FFMPEG_THREADS | Threads per ffmpeg0ffmpeg | integer | 1 | API |
LEARNHOUSE_HLS_MAX_RETRIES | Attempts per video before a transcode is marked failed. | integer | 6 | API |
LEARNHOUSE_HLS_ENCRYPT | Encrypt HLS segments. Any value other than true | boolean | true | API |
LEARNHOUSE_CAPTIONS_CONCURRENCY | Maximum AI caption jobs running at once per API process. | integer | 1 | API |
LEARNHOUSE_FFMPEG_PATH | ffmpeg | path | ffmpeg | API |
LEARNHOUSE_FFPROBE_PATH | ffprobe | path | ffprobe | API |
LEARNHOUSE_RAG_CONCURRENCY | Maximum AI search indexing jobs running at once. | integer | 2 | API |
LEARNHOUSE_RAG_BACKFILL_HOURS | Hours between sweeps that index course content missing from AI search. 0 | number | 3 | API |
LEARNHOUSE_RAG_BACKFILL_BATCH | Maximum items queued per indexing sweep. | integer | 500 | API |
LEARNHOUSE_BACKFILL_INTERVAL_HOURS | Hours 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 | number | 48 | API |
LEARNHOUSE_BACKFILL_HLS_LIMIT | Maximum videos one backfill run queues for HLS. | integer | 50 | API |
LEARNHOUSE_BACKFILL_CHAPTERS_LIMIT | Maximum videos one backfill run spends AI credits on for chapters. | integer | 100 | API |
LEARNHOUSE_DRIP_EMAILS_DISABLED | Any value turns off the hourly job that emails learners when drip content unlocks. | any value or unset | unset (job runs) | API |
LEARNHOUSE_MESSAGING_EMAILS_DISABLED | Any value turns off the job that emails unread messages and delivers reminders. | any value or unset | unset (job runs) | API |
Code execution
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_JUDGE0_API_URL | Judge0 API URL. Setting it enables code execution routes. | URL | unset | API |
LEARNHOUSE_JUDGE0_CLIENT_ID | Optional Judge0 client ID. | string | unset | API |
LEARNHOUSE_JUDGE0_CLIENT_SECRET | Optional Judge0 client secret. | secret string | unset | API |
Observability
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_SENTRY_DSN | Backend Sentry DSN; also used by the web edge Sentry config as a non-public fallback. | URL | unset | API, Web edge |
LEARNHOUSE_LOGFIRE_ENABLED | CLI-generated Logfire flag. The current OSS runtime does not read it directly. | boolean | False.env | CLI |
Development controls
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_DISABLE_EE | Set to 1ee/ | 1 | unset; CLI dev sets 1--ee | API, Web build, CLI dev |
LEARNHOUSE_FORCE_EE | Set to 1LEARNHOUSE_DEVELOPMENT_MODE | 1 | unset; CLI dev sets 1--ee | API, 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
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_LICENSE_KEY | Enterprise 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 string | required for Enterprise | EE backend, EE CLI |
LEARNHOUSE_LICENSE_SERVER_URL | License server URL. | URL | https://enterprise.learnhouse.app | EE backend |
LEARNHOUSE_LICENSE_GRACE_HOURS | How 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. | integer | 25 | EE backend |
LEARNHOUSE_DATA_DIR | Directory 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/data | EE backend |
LEARNHOUSE_DEPLOYMENT_ID | Deployment identifier reported to the license server. | string | the instance ID | EE backend |
LEARNHOUSE_VERSION | Version reported to the license server. | string | unknown | EE backend |
Payments (Stripe)
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_STRIPE_SECRET_KEY | Stripe secret key (sk_live_...sk_test_... | secret string | unset | API, EE backend |
LEARNHOUSE_STRIPE_PUBLISHABLE_KEY | Stripe publishable key (pk_... | string | unset | API, EE backend |
LEARNHOUSE_STRIPE_CLIENT_ID | Stripe Connect OAuth client ID (ca_... | string | unset | API, EE backend |
LEARNHOUSE_STRIPE_WEBHOOK_STANDARD_SECRET | Signing secret (whsec_...POST /api/v1/payments/stripe/webhook | secret string | unset | API, EE backend |
LEARNHOUSE_STRIPE_WEBHOOK_CONNECT_SECRET | Signing secret (whsec_...POST /api/v1/payments/stripe/webhook/connect | secret string | unset | API, EE backend |
Single sign-on
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
WORKOS_API_KEY | WorkOS API key. WorkOS-backed SSO is available only when both this and WORKOS_CLIENT_ID | secret string | unset | EE backend |
WORKOS_CLIENT_ID | WorkOS client ID. | string | unset | EE backend |
SSO_REDIRECT_URI | Full SSO callback URL. When set, it is used as is. | URL | unset | EE backend |
SSO_REDIRECT_URI_BASE | Base URL for the SSO callback when SSO_REDIRECT_URI/api/v1/auth/sso/callback | URL | falls back to LEARNHOUSE_DOMAINhttp://localhost:4000 | EE backend |
SCORM
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_SCORM_MAX_PACKAGE_SIZE_MB | Largest SCORM package upload, in MB. | integer | 5120 | EE backend |
LEARNHOUSE_SCORM_MAX_FILE_SIZE_MB | Largest single file inside a package, in MB. | integer | 2048 | EE backend |
LEARNHOUSE_SCORM_MAX_UNCOMPRESSED_MB | Cap on the total uncompressed size of a package, in MB (zip-bomb guard). | integer | 25600 | EE backend |
LEARNHOUSE_SCORM_TEMP_TTL_MINUTES | How long an uploaded package that was analyzed but not imported is kept, in minutes. | integer | 120 | EE backend |
Live sessions
See Live Sessions.
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_MEET_URL | Public websocket URL of the LearnHouse Meet media server (apps/meet | URL | unset | EE backend |
LEARNHOUSE_MEET_API_KEY | API key of that server. | string | unset | EE backend |
LEARNHOUSE_MEET_API_SECRET | Matching secret; signs room tokens and checks webhooks. | secret string | unset | EE backend |
LEARNHOUSE_MEET_INTERNAL_URL | How the API reaches the media server, when different from the public URL. | URL | LEARNHOUSE_MEET_URL | EE backend |
LEARNHOUSE_MEET_RECORDING | true | boolean | false | EE backend |
LEARNHOUSE_LIVE_GOOGLE_CLIENT_ID_SECRET | Platform Google OAuth app for live sessions. Unset: org admins can use their own app. | string / secret | unset | EE backend |
LEARNHOUSE_LIVE_ZOOM_CLIENT_ID_SECRET | Platform Zoom OAuth app for live sessions. | string / secret | unset | EE backend |
LEARNHOUSE_LIVE_OAUTH_REDIRECT_URI | Exact OAuth callback URL for live session providers. | URL | <API>/api/v1/live_sessions/oauth/callback | EE backend |
Analytics
See Analytics. Analytics is stored in PostgreSQL and needs no extra service.
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_ANALYTICS_MAINTENANCE | Run the analytics summary and retention job inside the API. Set to false | boolean | true | EE backend |
LEARNHOUSE_TINYBIRD_API_URL | Legacy. Only read by the one-time | URL | unset | EE import script |
LEARNHOUSE_TINYBIRD_READ_TOKEN | Legacy. Tinybird read token for the same import. | secret string | unset | EE import script |
LTI
See LTI.
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
LEARNHOUSE_LTI_BASE_URL | Public 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. | URL | unset; resolved like LEARNHOUSE_MEDIA_URL | EE backend |
LEARNHOUSE_LTI_ALLOW_PRIVATE_HOSTS | Allow LTI requests to LMS addresses on private or internal networks. Accepts true1yes | boolean | false | EE backend |
LearnHouse Cloud only
The hosted LearnHouse Cloud platform reads these variables. Self-hosted instances don't need them.
| Variable | Used by | Purpose |
|---|---|---|
LEARNHOUSE_NUDGES_ENABLEDLEARNHOUSE_NUDGES_NO_SCHEDULERLEARNHOUSE_NUDGES_BACKFILL_MODELEARNHOUSE_NUDGES_ACTIVATION_DATE | API | Lifecycle email nudges. The scheduler only runs in SaaS mode. |
LEARNHOUSE_RESEND_WEBHOOK_SECRET | API | Verifies Resend delivery webhooks for nudges |
LOOPS_API_KEY | API, Web | Marketing contact sync |
NEXT_PUBLIC_TURNSTILE_SITE_KEYTURNSTILE_SECRET_KEY | Web | Cloudflare Turnstile on auth forms, active only in SaaS mode |
RESEND_API_KEYRESEND_FROM_EMAILABSTRACT_EMAIL_API_KEY | Web | Platform emails and disposable-email checks |
STRIPE_SECRET_KEYSTRIPE_WEBHOOK_SECRETSTRIPE_PRICE_*CRON_SECRETLEARNHOUSE_CLOUD_INTERNAL_KEY | Web | Platform billing |
Related generated variables
These variables do not use the LEARNHOUSE_ prefix, but the CLI writes them into the same
.env file and several services require them.
| Variable | Description | Type | Default / required | Used by |
|---|---|---|---|---|
HTTP_PORT | Public HTTP port chosen during CLI setup. | integer | setup choice | CLI-generated compose |
NEXTAUTH_URL | Base URL for NextAuth-compatible auth helpers. | URL | generated from the configured domain | CLI, doctor |
NEXTAUTH_SECRET | Secret used by NextAuth-compatible auth helpers. | secret string | generated by CLI setup | CLI, doctor |
COLLAB_INTERNAL_KEY | Shared key for API-to-collaboration-server internal auth. | secret string | required for dev and production collab auth | API, Collab, CLI |
NEXT_PUBLIC_COLLAB_URL | Public WebSocket URL for the collaboration server. | WebSocket URL | ws://localhost:4000 | Web, CLI |
COLLAB_PORT | Local collaboration server port. | integer | 4000 | Collab, CLI dev |
COLLAB_TRUST_PROXY | Set to trueX-Forwarded-For | boolean | false | Collab |
POSTGRES_USER | PostgreSQL user for generated non-external database installs. | string | learnhouse | CLI-generated compose |
POSTGRES_PASSWORD | PostgreSQL password for generated non-external database installs. | secret string | generated by CLI setup | CLI-generated compose |
POSTGRES_DB | PostgreSQL database name for generated non-external database installs. | string | learnhouse | CLI-generated compose |
Full example
# 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