Skip to Content
DocsDeploymentEnvironment Variables

Environment Variables

Complete reference for configuring a self-hosted Rhesis deployment. For a guided walkthrough of the essentials, see the Docker Compose guide.

Set variables in the .env.docker file you pass to Docker Compose:

docker compose --env-file .env.docker up -d

Empty values are treated as unset — the built-in default applies. In .env.example, commented lines show the default each variable falls back to, so you only uncomment a line to override it.

Required

These four secrets have no default; the stack refuses to start if any is unset.

VariableDescriptionGenerate with
DB_ENCRYPTION_KEYEncrypts sensitive fields (such as stored provider credentials) at restopenssl rand -base64 32 | tr '+/' '-_'
JWT_SECRET_KEYSigns backend-issued JWTsopenssl rand -hex 32
NEXTAUTH_SECRETSigns NextAuth (frontend) sessionsopenssl rand -hex 32
SESSION_SECRET_KEYSigns backend session cookiesopenssl rand -hex 32

Public URLs and ports

VariableDescriptionDefault
FRONTEND_URLPublic origin of the frontend; an https:// value enables secure cookieshttp://localhost:3000
API_BASE_URLPublic origin of the backend API; an https:// value enables secure cookieshttp://localhost:8080
FRONTEND_PORTHost port Docker publishes for the frontend3000
BACKEND_PORTHost port Docker publishes for the backend8080

Ports are the host bind ports and are independent of the URLs — behind a reverse proxy the published port and the public URL usually differ.

Branding

Replace the Rhesis colours, icon and product name with your own. All four are read at request time, so the same image serves every deployment — no rebuild, and no NEXT_PUBLIC_ counterpart. Each is independent; set only the ones you need.

VariableDescriptionDefault
BRAND_PRIMARY_COLOR6-digit hex colour, e.g. #6A1B9A. Drives the primary palette, app bar, buttons, brand-tinted surfaces and the sign-in accent(unset — Rhesis blue)
BRAND_SECONDARY_COLOR6-digit hex colour for the secondary/CTA accent — secondary buttons and anything using palette.secondary(unset — Rhesis orange)
BRAND_FAVICON_URLhttps:// URL or root-relative path, e.g. https://www.example.com/favicon.png. Used as the browser-tab icon and as the brand mark in the sidebar, onboarding and sign-in header/logos/rhesis-logo-favicon.svg
BRAND_PRODUCT_NAMEName in page titles (Architect becomes Architect | Acme), the sign-in header and footer, and the sidebar before the organisation loads. Max 60 charactersRhesis AI

Light and dark shades are derived from each colour, and button label text switches between white and near-black to stay readable — a pale brand colour does not need extra configuration. A malformed value is ignored with a warning in the frontend logs and the Rhesis default applies, so a typo cannot break a deployment.

One difference between the two colours: the built-in secondary uses a different hue for its hover (orange to yellow) and near-black for secondary.dark. A configured BRAND_SECONDARY_COLOR gets a plain lighten/darken ramp instead, so secondary buttons brighten on hover within your own hue rather than shifting to another colour.

Setting BRAND_PRODUCT_NAME also drops the Rhesis tagline from the page description and stops the sign-in wordmark linking to rhesis.ai.

Three things keep their Rhesis identity on purpose: chart palettes, which need distinguishable hues rather than tints of one colour; the sign-in page’s background artwork; and the Documentation, Blog and GitHub links in the sign-in header.

On Kubernetes, set these through the chart instead — see Kubernetes (Helm).

Database

Defaults point at the built-in postgres container. Set these to use your own database (see Database). DB_NAME and APP_DB_USER are fixed and cannot be changed — SQL scripts reference them by name, so your database and role must use exactly these values.

VariableDescriptionDefault
DB_HOSTDatabase hostpostgres
DB_PORTDatabase port5432
DB_NAMEDatabase name — fixed, cannot be changedrhesis-db
APP_DB_USERRuntime backend and worker role — fixed, cannot be changedrhesis-user
APP_DB_PASSPassword for the runtime rolerhesis-password
ADMIN_DB_USERMigration role; falls back to the app role when unset(unset)
ADMIN_DB_PASSPassword for the migration role(unset)

Redis and Celery

Defaults point at the built-in redis container. Set these to use an external Redis.

VariableDescriptionDefault
BROKER_URLCelery broker connection URLredis://:rhesis-redis-pass@redis:6379/0
CELERY_RESULT_BACKENDCelery result backend URLredis://:rhesis-redis-pass@redis:6379/1

AI models

Generation, evaluation, execution, and embeddings use Rhesis-hosted models by default, which require a RHESIS_API_KEY (get one at app.rhesis.ai ). To use your own provider, set that provider’s key and point the matching DEFAULT_*_MODEL at it.

VariableDescriptionDefault
RHESIS_API_KEYAPI key for Rhesis-hosted models(unset)
DEFAULT_GENERATION_MODELModel for test generationrhesis/rhesis-default
DEFAULT_EVALUATION_MODELModel for evaluation / judgingrhesis/rhesis-default
DEFAULT_EXECUTION_MODELModel for multi-turn executionrhesis/rhesis-default
DEFAULT_EMBEDDING_MODELModel for embeddingsrhesis/rhesis-embedding

Provider keys, read at runtime when a DEFAULT_*_MODEL targets that provider:

VariableProvider
OPENAI_API_KEYOpenAI
GEMINI_API_KEY, GOOGLE_API_KEYGoogle Gemini
AZURE_OPENAI_ENDPOINT, AZURE_OPENAI_API_KEY, AZURE_OPENAI_DEPLOYMENT_NAME, AZURE_OPENAI_API_VERSIONAzure OpenAI

Supported model-provider prefixes: openai, gemini, azure, anthropic, groq, mistral, together_ai, perplexity, replicate, openrouter, cohere, ollama. Supported embedding prefixes: rhesis, openai, gemini, vertex_ai.

Authentication and OAuth

Without OAuth credentials, only email/password authentication is available.

VariableDescriptionDefault
AUTH_EMAIL_PASSWORD_ENABLEDAllow email/password sign-intrue
AUTH_REGISTRATION_ENABLEDAllow new-user registrationtrue
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETEnable Google sign-in (set both)(unset)
GH_CLIENT_ID, GH_CLIENT_SECRETEnable GitHub sign-in (set both)(unset)

SMTP and email

Email (notifications, invitations) is disabled until SMTP_HOST is set.

VariableDescriptionDefault
SMTP_HOSTSMTP server host(unset)
SMTP_PORTSMTP server port587
SMTP_USERSMTP username(unset)
SMTP_PASSWORDSMTP password(unset)
FROM_EMAILDefault From addressnoreply@example.com

Object storage

VariableDescriptionDefault
STORAGE_SERVICE_URIStorage backend URI (file://, gs://, or s3://)file:///app/storage
STORAGE_SERVICE_ACCOUNT_KEYBase64 service-account credentials for GCS(unset)
LOCAL_STORAGE_PATHFilesystem path for the file:// backend/tmp/rhesis-files

Enterprise features

Only used when the Enterprise package is installed (see Enterprise Features). Each feature stays disabled until its secret is set and valid.

VariableDescriptionGenerate with
SSO_ENCRYPTION_KEYEncrypts stored SSO client_secrets; required for Single Sign-On. Must stay stable once set — changing it makes stored SSO credentials undecryptableopenssl rand -base64 32 | tr '+/' '-_'
AUDIT_HASH_KEYHMAC key for hashing emails in API-client audit logs; required for API Clientsopenssl rand -hex 32

Telemetry

VariableDescriptionDefault
OTEL_RHESIS_TELEMETRY_ENABLEDSelf-hosted telemetry (opt-out; set false to disable)true

See Telemetry System Documentation for what is collected.

Logging and tuning

VariableDescriptionDefault
LOG_LEVELLog verbosityINFO
QUICK_STARTEnable Quick Start mode (auto-login; not for production)false
CELERY_WORKER_CONCURRENCYWorker process concurrency8
CELERY_WORKER_PREFETCH_MULTIPLIERTasks prefetched per worker process4

Advanced

Rarely changed; the defaults are correct for most deployments.

VariableDescriptionDefault
JWT_ALGORITHMJWT signing algorithmHS256
JWT_ACCESS_TOKEN_EXPIRE_MINUTESAccess-token lifetime (minutes); refreshed automatically, and the window in which a deactivated user’s token stays valid15
RHESIS_BASE_URLBase URL for Rhesis-hosted modelshttps://api.rhesis.ai
DB_DRIVERSQLAlchemy database driverpostgresql
BROKER_READ_URLOptional read-replica broker URL(unset)
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint for telemetry exporthttps://telemetry.rhesis.ai
OTEL_SERVICE_NAMEReported service namerhesis
OTEL_DEPLOYMENT_TYPEcloud or self-hosted labelself-hosted

Cloud-only variables

For the Rhesis-hosted SaaS, not self-hosting. These drive the managed platform and are listed here for reference only — a self-hosted deployment does not need any of them.

Onboarding and lifecycle emails — the hosted SendGrid drip campaign and welcome flow.

VariablePurpose
SENDGRID_API_KEYSendGrid API key
SENDGRID_DAY_1_EMAIL_TEMPLATE_ID, SENDGRID_DAY_2_EMAIL_TEMPLATE_ID, SENDGRID_DAY_3_EMAIL_TEMPLATE_IDDrip-campaign template IDs
WELCOME_FROM_EMAIL, WELCOME_CALENDAR_LINK, AGENT_EMAIL_BCC, DEMO_USER_EMAILWelcome-email sender, calendar link, BCC, and demo recipient

Hosted UI enrichment — frontend NEXT_PUBLIC_* values baked in at build time. When unset the UI simply omits the extra media, so self-hosting is unaffected.

VariablePurpose
NEXT_PUBLIC_SUPPORT_EMAILSupport address in the UI (falls back to hello@rhesis.ai)
ONBOARDING_VIDEO_URL, NEXT_PUBLIC_ONBOARDING_VIDEO_URLOnboarding welcome video
NEXT_PUBLIC_<ENTITY>_EMPTY_STATE_VIDEO_URLEmpty-state demo video per entity
NEXT_PUBLIC_<ENTITY>_EMPTY_STATE_ARTICLE_URLSEmpty-state help-article links per entity (comma-separated)

The empty-state pair exists for each of TESTS, PROJECTS, TEST_SETS, TEST_RUNS, ENDPOINTS, BEHAVIORS, METRICS, and EXPERIMENTS.

Enterprise and GCP-hosted infrastructure — specific to Rhesis’s managed environment.

VariablePurpose
AUTH_SECRET, DATABASE_URLHosted frontend auth secret and direct database URL
VERTEX_AI_LOCATION, VERTEX_AI_PROJECT, GOOGLE_APPLICATION_CREDENTIALSVertex AI / GCP model access
PERSPECTIVE_API_KEY, CHATBOT_API_KEYHosted third-party API keys
DEFAULT_POLYPHEMUS_URLInternal Rhesis access-review service
SKIP_MIGRATIONSHosted runs migrations as a separate job
RHESIS_CONNECTOR_DISABLED, RHESIS_PROJECT_IDSDK connector settings
WORKER_API_URLExternal worker service URL