Skip to main content

Self-Hosted Variables

These variables are configured in your .env file or passed directly to docker compose.
Self-hosted deployments use a .env file alongside docker-compose.yml. See the install guide for the recommended setup path.

Core

VariableRequiredDefaultDescription
GITHUB_APP_IDYesNumeric GitHub App ID from your app settings page
GITHUB_PRIVATE_KEYYesPEM-encoded RSA private key generated for the GitHub App
GITHUB_WEBHOOK_SECRETYesHMAC secret used to validate incoming webhook payloads
DATABASE_URLYesPostgres connection string, e.g. postgresql://user:pass@postgres:5432/mergewatch
LLM_PROVIDERYesanthropicLLM backend to use: anthropic, litellm, bedrock, or ollama
LLM_MODELNoOverride the default model for the selected provider
PORTNo3000Port the MergeWatch server listens on inside the container
GITHUB_APP_SLUGNoGitHub App slug, used to generate the installation link
GITHUB_PRIVATE_KEY_FILENoPath to PEM file — alternative to inline GITHUB_PRIVATE_KEY
DASHBOARD_BASE_URLNoPublic base URL of the dashboard (e.g., https://dashboard.example.com). Read by the server to generate deep links in PR comments.
DASHBOARD_URLNohttp://localhost:3001Consumed by docker-compose.yml to set NEXTAUTH_URL on the dashboard container. Set when serving the dashboard on a public domain.

Provider-specific: Anthropic

VariableRequiredDefaultDescription
ANTHROPIC_API_KEYIf LLM_PROVIDER=anthropicAPI key from console.anthropic.com

Provider-specific: LiteLLM

VariableRequiredDefaultDescription
LITELLM_BASE_URLIf LLM_PROVIDER=litellmBase URL of your LiteLLM proxy, e.g. http://litellm:4000
LITELLM_API_KEYNoOptional API key if your LiteLLM proxy requires authentication

Provider-specific: Ollama

VariableRequiredDefaultDescription
OLLAMA_BASE_URLIf LLM_PROVIDER=ollamahttp://localhost:11434Base URL of the Ollama server

Provider-specific: AWS Bedrock

VariableRequiredDefaultDescription
AWS_REGIONIf LLM_PROVIDER=bedrockAWS region for Bedrock API calls
AWS_ACCESS_KEY_IDIf LLM_PROVIDER=bedrockAWS access key (or use an instance profile instead)
AWS_SECRET_ACCESS_KEYIf LLM_PROVIDER=bedrockAWS secret key (or use an instance profile instead)
If you run MergeWatch on an EC2 instance or ECS task with an IAM instance profile or task role that has Bedrock permissions, you can omit AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. The AWS SDK will pick up credentials automatically.

Dashboard (Self-Hosted)

The dashboard container runs on port 3001 (the Express server uses 3000). These variables are set on the dashboard service in docker-compose.yml.
VariableRequiredDefaultDescription
GITHUB_CLIENT_IDYesOAuth client ID from your GitHub App’s OAuth Credentials section
GITHUB_CLIENT_SECRETYesOAuth client secret from your GitHub App
NEXTAUTH_SECRETYesRandom secret for session signing (generate with openssl rand -base64 32)
NEXTAUTH_URLNohttp://localhost:3001Public URL the dashboard is served from. Docker Compose sets this from DASHBOARD_URL.
DEPLOYMENT_MODENoself-hostedSet to saas to enable the billing UI.

SaaS Lambda Variables

These variables are used internally by the MergeWatch SaaS infrastructure. They are documented here for reference only and are not user-configurable.
The SaaS deployment runs on AWS Lambda and does not use LLM_PROVIDER, DATABASE_URL, or any of the self-hosted provider variables. Bedrock access is handled via the Lambda execution role.

Core Lambda

VariableDescription
DEPLOYMENT_MODEDeployment mode — saas or self-hosted. Gates billing and SaaS-only code paths.
INSTALLATIONS_TABLEDynamoDB table name for GitHub App installations
REVIEWS_TABLEDynamoDB table name for review records
REVIEW_AGENT_FUNCTION_NAMEName of the ReviewAgent Lambda (the WebhookHandler invokes it async)
DEFAULT_BEDROCK_MODEL_IDBedrock model used by the review agents (SAM parameter)

Billing Lambda (Stripe)

Configured when DeploymentMode=saas. Credentials are pulled from SSM at deploy time — see BILLING_SETUP.md for details.
VariableDescription
STRIPE_SECRET_KEYStripe API secret key (from /mergewatch/{stage}/stripe-secret-key)
STRIPE_WEBHOOK_SECRETStripe webhook signing secret (from /mergewatch/{stage}/stripe-webhook-secret)
BILLING_API_SECRETShared secret for dashboard → BillingHandler auth (from /mergewatch/{stage}/billing-api-secret)

Dashboard (Amplify) env vars for SaaS mode

VariableDescription
DEPLOYMENT_MODEsaas — toggles the billing UI in the dashboard
BILLING_API_URLBillingUrl from SAM stack outputs (e.g., https://…/dev/billing)
BILLING_API_SECRETSame value as above, read from SSM and set in Amplify

Next steps

Install Guide

Set up MergeWatch with Docker Compose.

Commands Reference

Manage your deployment with Docker and repo scripts.