Skip to Content
v1.39.1 · shipped More settings on the script tag · Script tag typos no longer slip through Read the changelog →
Self-hostingEnvironment variables

Environment variables

You need very few of these. npx mushi-mushi selfhost up sets the required function secrets for you, and npx mushi-mushi selfhost secrets writes the Compose .env. Everything else turns on an optional feature.

You runRequiredSet by
Your own Supabase projectMUSHI_INTERNAL_CALLER_SECRETselfhost up
Docker ComposePOSTGRES_PASSWORD, JWT_SECRET, SUPABASE_ANON_KEY, SUPABASE_SERVICE_ROLE_KEY, MUSHI_INTERNAL_CALLER_SECRETselfhost secrets
A console you build yourselfVITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEYyour build command

An AI key (ANTHROPIC_API_KEY or OPENAI_API_KEY) is optional: without one, reports get rule-based triage, and no plain-English diagnosis.

Set by the platform

Supabase sets these in every function. Compose passes them to the edge-functions service. Do not set them yourself on Supabase.

VariableNotes
SUPABASE_URLThe project URL. Compose passes the internal gateway, http://caddy:8000.
SUPABASE_ANON_KEYThe anon (public) key.
SUPABASE_SERVICE_ROLE_KEYThe service-role key. Server only.
SUPABASE_DB_URLDirect Postgres connection string.
SB_REGIONRegion the function runs in (read-only).

Function secrets

A Supabase function secret: supabase secrets set NAME=value (or Project Settings → Edge Functions → Secrets). In Docker Compose, add it to the edge-functions service environment.

Core (selfhost up sets these)

VariableRequiredDefaultWhat it does
MUSHI_INTERNAL_CALLER_SECRETRequired: selfhost up and the Compose secrets script generate it—Lets pg_cron call your functions; the same value goes in mushi_runtime_config
ADMIN_BASE_URLOptional—Where your console is served; links in Slack, Discord and email open it

AI keys (optional; one turns on the plain-English diagnosis and fix drafts)

VariableRequiredDefaultWhat it does
ANTHROPIC_API_KEYOptional——
OPENAI_API_KEYOptional—Either provider works; OpenAI also powers duplicate detection, semantic search and voice
OPENROUTER_API_KEYOptional—Optional fallback for the OpenAI models when the OpenAI key is out of credit or down
AGENT_PR_REVIEW_MODELOptionalclaude-opus-5-5Agent PR review model for every project that has not set its own (project_settings.agent_pr_review_model, ADR 0039). Default: claude-opus-5-5.

Operator notices and Slack routing (optional)

VariableRequiredDefaultWhat it does
MUSHI_FUNCTION_REGIONOptional—Your database’s region: pins the Slack bot’s Request URLs there (?forceFunctionRegion), so Slack’s US calls answer inside its 3 s limit
MUSHI_OPS_KEYOptional—Optional: this deployment’s own ops:write key; operator notices (payments, alerts) go to the Ops hub’s Slack bot, the webhooks are the fallback
MUSHI_OPS_API_URLOptionalthis project's own apiOptional: where those notices go (default: this project’s own api)

Discord triage feed (optional)

VariableRequiredDefaultWhat it does
MUSHI_DISCORD_WEBHOOK_URLOptional—Centralised Discord triage (_shared/discord-triage.README.md). Cross-project operator feed — distinct from the per-project project_settings.discord_webhook_url. Unset = silent no-op. Webhook mode:
MUSHI_DISCORD_THREAD_IDOptional—Optional; posts into an existing thread
MUSHI_TRIAGE_RELAY_URLOptional—Relay mode (channels where the bot lacks MANAGE_WEBHOOKS):
MUSHI_TRIAGE_RELAY_TOKENOptional—Sent as the x-relay-token header
MUSHI_TRIAGE_RELAY_THREADOptional—Default. Absent/other => relay posts to sales
MUSHI_DISCORD_MIN_LEVELOptionalerrorlow|medium|high|critical (error→high). Default: error

Code index (optional)

VariableRequiredDefaultWhat it does
MUSHI_REPO_INDEX_SWEEP_FILE_CAPOptional—Codebase index sweep (webhooks-github-indexer). The coverage ceiling (files a project’s index may hold) follows the plan: Free 300, Builder (indie) 1,500, Studio (pro) 5,000, Enterprise 20,000, or pricing_plans.feature_flags .codebase_index_file_cap. Setting the cap pins it for EVERY project, so leave it unset on Mushi Cloud; self-hosts (no billing plans) set it here.
MUSHI_REPO_INDEX_SWEEP_RUN_FILESOptional—Files one sweep fetches (bounded by the edge function’s wall clock and the GitHub token’s rate limit); a larger ceiling fills over hourly runs.

Public diagram pages (optional)

VariableRequiredDefaultWhat it does
MUSHI_PUBLIC_PAGES_BUCKETOptional—Public architecture-diagram pages (docs/operators/public-diagram-pages.md). An IAM user limited to s3:PutObject + s3:DeleteObject on arn:aws:s3:::<bucket>/mushi-mushi/r/*. Unset = the crawlable page and its .md twin are not written; the diagram still shows via the docs 404 fallback.
MUSHI_PUBLIC_PAGES_REGIONOptional——
MUSHI_PUBLIC_PAGES_ACCESS_KEY_IDOptional——
MUSHI_PUBLIC_PAGES_SECRET_ACCESS_KEYOptional——

Self-hosted Sentry hosts (optional)

VariableRequiredDefaultWhat it does
MUSHI_SENTRY_SELF_HOSTED_HOSTSOptional—Self-hosted Sentry (_shared/sentry-dsn.ts). A Sentry DSN on a published app or in Settings → General must point at sentry.io (or a subdomain such as o123.ingest.us.sentry.io). List extra hosts here, comma separated, to accept a self-hosted Sentry. IP addresses, localhost and internal names are refused even when listed. Unset = sentry.io only.
VariableRequiredDefaultWhat it does
ADMIN_ORIGINOptional——
MUSHI_ADMIN_URLOptional——
MUSHI_ADMIN_BASE_URLOptional——
SITE_URLOptional——
APP_URLOptional——
MUSHI_API_PUBLIC_URLOptional——
MUSHI_ADMIN_ORIGIN_ALLOWLISTOptional—First origin is the CLI device-auth approval page.
DEFAULT_BASE_URLOptional——
MCP_PUBLIC_BASE_URLOptional——
TELEGRAM_WEBHOOK_BASE_URLOptional——

Runtime name (optional; unset is treated as production)

VariableRequiredDefaultWhat it does
SUPABASE_ENVOptional——
DENO_ENVOptional——
MUSHI_CLUSTER_REGIONOptional——
MUSHI_VERSIONOptional——

GitHub App (optional)

VariableRequiredDefaultWhat it does
GITHUB_APP_IDOptional——
GITHUB_APP_PRIVATE_KEYOptional——
GITHUB_APP_PRIVATE_KEY_PEMOptional——
GITHUB_APP_WEBHOOK_SECRETOptional——
GITHUB_APP_SLUGOptional—“Connect GitHub” in the console (verified install + repository picker): the App’s slug, OAuth client id and secret. The App’s callback URLs must include <SUPABASE_URL>/functions/v1/api/v1/webhooks/github/app-authorize (or GITHUB_APP_OAUTH_REDIRECT_URL when set). MUSHI_GITHUB_CONNECT_SECRET signs the short-lived link and grant; unset uses the service role key.
GITHUB_APP_CLIENT_IDOptional——
GITHUB_APP_CLIENT_SECRETOptional——
GITHUB_APP_OAUTH_REDIRECT_URLOptional——
MUSHI_GITHUB_CONNECT_SECRETOptional——
GITHUB_TOKENOptional—The platform GITHUB_TOKEN serves only apps whose owner is listed here.
MUSHI_OPERATOR_USER_IDSOptional——
MUSHI_GITHUB_APP_TRUST_UNVERIFIED_INSTALLSOptional—Single-tenant self-host only. Hosted production leaves this unset.

Slack OAuth (optional; operator workspace)

VariableRequiredDefaultWhat it does
SLACK_BOT_TOKENOptional——
SLACK_CHANNEL_IDOptional——
SLACK_CLIENT_IDOptional——
SLACK_CLIENT_SECRETOptional——
SLACK_SIGNING_SECRETOptional——
SLACK_STATE_SECRETOptional——
SLACK_REDIRECT_URIOptional——

Linear OAuth (optional)

VariableRequiredDefaultWhat it does
LINEAR_OAUTH_CLIENT_IDOptional——
LINEAR_OAUTH_CLIENT_SECRETOptional——

Email (optional; both required before any mail is sent)

VariableRequiredDefaultWhat it does
RESEND_API_KEYOptional——
RESEND_FROM_EMAILOptional——
LIFECYCLE_UNSUB_SECRETOptional——

Tremendous tester payouts (optional; set the host explicitly)

VariableRequiredDefaultWhat it does
TREMENDOUS_API_KEYOptional——
TREMENDOUS_API_URLOptional——
TREMENDOUS_WEBHOOK_SECRETOptional——
TESTER_TIN_PEPPEROptional——

AWS Bedrock fine-tune (optional; off until the flag is 1)

VariableRequiredDefaultWhat it does
MUSHI_BEDROCK_FINETUNE_ENABLEDOptional——
AWS_ACCESS_KEY_IDOptional——
AWS_SECRET_ACCESS_KEYOptional——
AWS_SESSION_TOKENOptional——
AWS_REGIONOptional——
BEDROCK_REGIONOptional——
BEDROCK_ROLE_ARNOptional——
BEDROCK_OUTPUT_S3_URIOptional——
MUSHI_ALLOW_STUB_FINE_TUNEOptional——

Hosted LLM billing (optional; stays off without the wallet bridge)

VariableRequiredDefaultWhat it does
MUSHI_HOSTED_LLM_BILLINGOptional——
KENSAURUS_WALLET_URLOptional——
KENSAURUS_WALLET_INTERNAL_TOKENOptional——
MUSHI_HOSTED_LLM_PREFLIGHT_TIMEOUT_MSOptional——

KENSAURUS AI routes (optional; Mushi Mushi Cloud)

VariableRequiredDefaultWhat it does
KENSAURUS_ROUTES_URLOptional—Which provider and model each platform-key AI call uses comes from kenji’s kensaurus_ai_routes, read with KENSAURUS_ROUTES_TOKEN (read-only; never the wallet token). Without it (a self-host) nothing calls kenji and the built-in OpenAI-first list runs. An app’s own keys (BYOK) are not affected. The console edits routes on the Providers & AI routes page (KENSAURUS_OPS_URL / KENSAURUS_OPS_CONSOLE_TOKEN). Default: https://jghcferpoaqntpfqvayf.supabase.co/functions/v1/kensaurus-ai-routes 
KENSAURUS_ROUTES_TOKENOptional——
KENSAURUS_LLM_DRILLOptional—Test and smoke drills only: <provider>:payment fails that provider’s call with Anthropic’s low-credit error when the call asks for a drill. Leave unset.

OpenAI-compatible endpoint (optional)

VariableRequiredDefaultWhat it does
OPENAI_BASE_URLOptional——
OPENAI_WEBHOOK_SECRETOptional——
MUSHI_OPENAI_BASE_URL_ALLOWLISTOptional——
MUSHI_ALLOW_PRIVATE_LLM_BASE_URLOptional—Self-host: true lets OPENAI_BASE_URL (this server-wide setting only, never a per-key base URL) be your own http model server, e.g. http://ollama:11434/v1 .
MUSHI_OPENAI_MODELOptional—The model that server serves, for every chat call (any name, e.g. qwen3.8:27b).
MUSHI_OPENAI_EMBEDDING_MODELOptional—Its embedding model; must return 1536-dimension vectors. Unset = OpenAI’s id.
MUSHI_OPENAI_MODEL_MAPOptional—Per-tier renames, which win over MUSHI_OPENAI_MODEL: gpt-6-luna=small,gpt-6.1-terra=large

Self-host public address (optional; unset on the hosted platform)

VariableRequiredDefaultWhat it does
SUPABASE_PUBLIC_URLOptional—The address people use. Signed Storage links are rewritten to it when SUPABASE_URL is an internal gateway.

QA crawl providers (optional; project BYOK wins when set)

VariableRequiredDefaultWhat it does
FIRECRAWL_API_KEYOptional——
BROWSERBASE_API_KEYOptional——

Operators, bootstrap, and safety switches (optional)

VariableRequiredDefaultWhat it does
MUSHI_OPERATOR_USER_IDSOptional——
KENSAURUS_OPS_URLOptional—Providers & AI routes (/providers, operators only): the kensaurus-ops API and its console token. Both unset: the route answers 404. See docs/operators/providers-ai-routes.md.
KENSAURUS_OPS_CONSOLE_TOKENOptional——
MUSHI_FRESH_EYES_EMAIL_DOMAINOptional—Fresh-eyes test accounts (ADR 0053): the email domain; one no mailbox answers on. Default synthetic.kensaur.us.
MUSHI_INIT_OWNER_EMAILOptional——
MUSHI_INIT_ORG_NAMEOptional——
MUSHI_INIT_ORG_IDOptional——
MUSHI_INIT_PROJECT_NAMEOptional——
MUSHI_INIT_PROJECT_IDOptional——
MUSHI_INIT_REPORTER_KEYOptional——
MUSHI_EE_LICENSE_KEYOptional——
MUSHI_EE_PUBLIC_KEYOptional——
MUSHI_SELF_PROJECT_IDOptional——
MUSHI_ALLOW_INTERNAL_PUSHOptional——
MUSHI_ALLOW_LOCAL_SANDBOXOptional——
MUSHI_ALLOW_PRIVATE_STORAGE_ENDPOINTOptional——
MUSHI_SCREENSHOT_HOST_ALLOWLISTOptional——
JIRA_DONE_TRANSITION_IDOptional——
CURSOR_USE_V0_WEBHOOKOptional——
MUSHI_CI_SYNC_BATCHOptional——
MUSHI_FIX_MIN_RAG_CHUNKSOptional——
MUSHI_FREE_REPORTS_PER_MONTHOptional——
MUSHI_INVENTORY_DRIFT_ROUTESOptional——
MUSHI_INVENTORY_DRIFT_COOLDOWN_DAYSOptional——
MUSHI_INVENTORY_DRIFT_MAX_PER_RUNOptional——

Instance and support (optional)

VariableRequiredDefaultWhat it does
MUSHI_INSTANCE_MODEOptional—hosted | self-hosted. Unset: self-hosted unless SUPABASE_URL is Mushi Mushi Cloud’s project. GET /health reports it; mushi selfhost up and Compose set self-hosted.
MUSHI_CONSOLE_URLOptionalhttps://kensaurConsole address in key-created and usage-alert emails. Default: https://kensaur.us/mushi-mushi/admin 
MUSHI_API_ENDPOINTOptional—API address the console shows for SDK setup. Default: <SUPABASE_URL>/functions/v1/api
SUPPORT_EMAILOptional——
SUPPORT_URLOptional——
OPERATOR_SLACK_WEBHOOK_URLOptional—Operator alerts (payments, platform notices) when no Ops hub key is set.
OPERATOR_DISCORD_WEBHOOK_URLOptional——

Observability (optional)

VariableRequiredDefaultWhat it does
LANGFUSE_PUBLIC_KEYOptional—Langfuse LLM traces. LANGFUSE_HOST is an alias of LANGFUSE_BASE_URL.
LANGFUSE_SECRET_KEYOptional——
LANGFUSE_BASE_URLOptional——
LANGFUSE_HOSTOptional——
SENTRY_DSN_SERVEROptional—Server errors to Sentry. SENTRY_DSN_SERVER wins; SENTRY_DSN also works.
SENTRY_DSNOptional——
SENTRY_RELEASEOptional——
SENTRY_TRACES_SAMPLE_RATEOptional0Default: 0.05
OTEL_EXPORTER_OTLP_ENDPOINTOptional—OpenTelemetry span per classification (classify-report).
OTEL_EXPORTER_OTLP_HEADERSOptional——

Integration probes (optional; operator-wide tokens)

VariableRequiredDefaultWhat it does
CURSOR_API_KEYOptional—Used by the Integrations health probes when an app has no key of its own.
LINEAR_API_KEYOptional——

Mushi Mushi Cloud billing (hosted only; a self-host leaves these unset)

VariableRequiredDefaultWhat it does
STRIPE_SECRET_KEYOptional——
STRIPE_WEBHOOK_SECRETOptional——
STRIPE_LIVEMODEOptional——
STRIPE_SUCCESS_URLOptional——
STRIPE_CANCEL_URLOptional——
STRIPE_PORTAL_RETURN_URLOptional——
STRIPE_DEFAULT_PRICE_IDOptional——
STRIPE_METER_EVENT_NAMEOptional——
STRIPE_METER_REPORTS_EVENT_NAMEOptional——
STRIPE_METER_DIAGNOSES_EVENT_NAMEOptional——
STRIPE_METER_FIXES_EVENT_NAMEOptional——
STRIPE_PRICE_STARTER_BASEOptional——
STRIPE_PRICE_STARTER_OVERAGEOptional——
STRIPE_PRICE_INDIE_BASEOptional——
STRIPE_PRICE_INDIE_ANNUALOptional——
STRIPE_PRICE_INDIE_DIAGNOSES_OVERAGEOptional——
STRIPE_PRICE_PRO_BASEOptional——
STRIPE_PRICE_PRO_BASE_V2Optional——
STRIPE_PRICE_PRO_ANNUALOptional——
STRIPE_PRICE_PRO_OVERAGEOptional——
STRIPE_PRICE_PRO_DIAGNOSES_OVERAGEOptional——

Docker Compose (deploy/.env)

The deploy/.env file Compose reads. Generate it with npx mushi-mushi selfhost secrets or ./deploy/generate-secrets.sh; never fill it by hand.

VariableRequiredDefaultWhat it does
MUSHI_PUBLIC_URLOptional—Public address of the stack. Caddy serves the console at / and the API under /functions/v1, /auth/v1, /rest/v1 and /storage/v1 on the same origin. A domain name (https://mushi.example.com ) gets a certificate automatically.
MUSHI_SITE_ADDRESSOptional——
POSTGRES_PASSWORDRequired: generated—Required (generated)
JWT_SECRETRequired: generated——
SUPABASE_ANON_KEYRequired: generated (signed with JWT_SECRET)——
SUPABASE_SERVICE_ROLE_KEYRequired: generated (signed with JWT_SECRET)——
MUSHI_INTERNAL_CALLER_SECRETRequired: generated——
ANTHROPIC_API_KEYOptional—Optional: one LLM key turns on the plain-English diagnosis and fix drafts. Either provider works. Without one, reports get rule-based triage only.
OPENAI_API_KEYOptional——
LANGFUSE_SECRET_KEYOptional—Optional: Langfuse tracing
LANGFUSE_PUBLIC_KEYOptional——
LANGFUSE_BASE_URLOptional——
MUSHI_INIT_OWNER_EMAILOptional—Optional: headless bootstrap of the first team, app and reporter key (POST /v1/admin/bootstrap). The owner signs up in the console first.
MUSHI_INIT_ORG_NAMEOptional——
MUSHI_INIT_PROJECT_NAMEOptional——
MUSHI_INIT_REPORTER_KEYOptional——

Console build (VITE_*)

Build-time values for the admin console. Vite bakes them into the bundle, so changing one means rebuilding (a static build, docker build --build-arg, or apps/admin/.env for pnpm dev). A console built without them asks for the URL and anon key on first open.

Supabase (required for self-hosted, optional for cloud)

VariableRequiredDefaultWhat it does
VITE_SUPABASE_URLRequired: on a self-host——
VITE_SUPABASE_ANON_KEYRequired: on a self-host——

API endpoint (optional — defaults to ${VITE_SUPABASE_URL}/functions/v1/api)

VariableRequiredDefaultWhat it does
VITE_API_URLOptional—In pnpm dev, any VITE_API_URL that points at *.supabase.co is rewritten to the Vite same-origin proxy (/functions/v1/api) so the browser avoids CORS failures. Production builds use the absolute URL as-is (edge CORS must allow the console origin).

Instance type (optional — auto-detected from VITE_SUPABASE_URL)

VariableRequiredDefaultWhat it does
VITE_INSTANCE_TYPEOptional——

Sentry error monitoring (optional)

VariableRequiredDefaultWhat it does
VITE_SENTRY_DSNOptional—Leave blank to disable telemetry locally. The Sentry SDK no-ops when DSN is unset. DSNs are designed to be public — safe to bake into builds.
VITE_RELEASEOptional—Set in CI to tag releases (e.g. the package version or commit SHA).

GitHub App (one-click repo connect on /integrations)

VariableRequiredDefaultWhat it does
VITE_GITHUB_APP_SLUGOptional—The github.com/apps/<slug> segment of your Mushi GitHub App. Without it the “Install GitHub App” CTA renders an “unavailable” note instead of the button, and users must paste an installation id by hand. Self-hosted installs without a public webhook callback can leave this blank and use the PAT disclosure instead.

Cloud fork builds (GitHub Actions deploy-admin.yml)

VariableRequiredDefaultWhat it does
VITE_CLOUD_SUPABASE_URLOptional—When building a console that talks to Mushi Cloud Supabase while hosted elsewhere:
VITE_CLOUD_SUPABASE_ANON_KEYOptional——

Console self-analytics (optional; dogfood)

VariableRequiredDefaultWhat it does
VITE_MUSHI_SELF_PROJECT_IDOptional—When both are set the console reports its own bugs and funnel events to this Mushi project through the web SDK (apps/admin/src/lib/mushi-self.ts).
VITE_MUSHI_SELF_API_KEYOptional——
VITE_MUSHI_SELF_API_ENDPOINTOptional——
VariableRequiredDefaultWhat it does
VITE_DOCS_URLOptional——
VITE_DOCS_ORIGIN_ALLOWLISTOptional——
VITE_MCP_HTTP_URLOptional——
VITE_LANGFUSE_HOSTOptional——

Feature flags (optional)

VariableRequiredDefaultWhat it does
VITE_MUSHI_ASK_STREAMINGOptional—Ask streaming defaults on. Set 0 to opt out of production builds.
VITE_ACTIVATION_COCKPIT_V2Optional—Activation cockpit defaults on. Set false to disable.
Last updated on