Configuration of Environment Variables
This guide covers all environment variables used to configure Agenta. These variables control various aspects of the platform, from core functionality to third-party integrations.
Configuration File Location
The default environment variables are specified in hosting/docker-compose/oss/.env.oss.gh (or hosting/docker-compose/oss/.env.oss.dev for development).
You can specify your own environment file using the --env-file flag when running docker compose:
docker compose -f hosting/docker-compose/oss/docker-compose.gh.yml --env-file .my-env-file --profile with-web --profile with-traefik up -d
Variable Categories
First-party (Required)
These variables are essential for Agenta to function properly:
| Variable | Description | Default |
|---|---|---|
AGENTA_LICENSE | License type (oss for open source) | oss |
AGENTA_API_URL | Base URL for the API backend | http://localhost/api |
AGENTA_WEB_URL | Base URL for the web frontend | http://localhost |
AGENTA_SERVICES_URL | URL prefix for Agenta services | http://localhost/services |
AGENTA_AUTH_KEY | Authentication key for internal services | replace-me |
AGENTA_CRYPT_KEY | Encryption key for sensitive data | replace-me |
First-party (Registry & Service)
Configuration for Docker and database connections:
| Variable | Description | Default |
|---|---|---|
AGENTA_WEB_IMAGE_TAG | Docker image tag for the web frontend | latest |
AGENTA_API_IMAGE_TAG | Docker image tag for the API backend | latest |
DOCKER_NETWORK_MODE | Docker networking mode | _(empty)_ (which falls back to bridge) |
POSTGRES_PASSWORD | PostgreSQL database password | password |
POSTGRES_USERNAME | PostgreSQL database username | username |
First-party (Optional)
Optional Agenta-specific configurations:
| Variable | Description | Default |
|---|---|---|
ALEMBIC_AUTO_MIGRATIONS | Enable automatic database migrations (legacy: AGENTA_AUTO_MIGRATIONS) | true |
AGENTA_PRICING | Enable pricing features | (empty) |
AGENTA_DEMOS | Enable demo applications | (empty) |
AGENTA_RUNTIME_PREFIX | Prefix for runtime containers | (empty) |
AGENTA_TELEMETRY_ENABLED | Enable telemetry collection | true |
AGENTA_SEND_EMAIL_FROM_ADDRESS | From address for system emails | mail@example.com |
AGENTA_API_INTERNAL_URL | Internal API URL for services | (empty) |
AGENTA_SERVICE_MIDDLEWARE_CACHE_ENABLED | Enable middleware caching in the chat and completion services | true |
AGENTA_ALLOWED_DOMAINS | Comma-separated list of email domains allowed to authenticate; when set, all other domains are rejected | (empty) |
AGENTA_OTLP_MAX_BATCH_BYTES | Max OTLP batch size before requests are rejected with 413 | 10485760 (10MB) |
Third-party (Required)
Essential third-party service configurations:
Traefik (Reverse Proxy)
| Variable | Description | Default |
|---|---|---|
TRAEFIK_DOMAIN | Domain for Traefik routing | localhost |
TRAEFIK_PORT | HTTP port for Traefik | 80 |
TRAEFIK_UI_PORT | Port for Traefik dashboard | 8080 |
TRAEFIK_HTTPS_PORT | HTTPS port for Traefik | 443 |
Redis (Task Queue, Caching & Sessions)
Use REDIS_URI when you have a single Redis, or split to two instances with the volatile/durable URLs below.
| Variable | Description | Default |
|---|---|---|
REDIS_URI | Single Redis URL used when the split URLs are not provided | redis://redis:6379/0 |
REDIS_URI_VOLATILE | Caches/PubSub channels; falls back to REDIS_URI | redis://redis-volatile:6379/0 |
REDIS_URI_DURABLE | Queues/Streams; falls back to REDIS_URI | redis://redis-durable:6381/0 |
PostgreSQL (Database)
| Variable | Description | Example |
|---|---|---|
POSTGRES_URI_SUPERTOKENS | SuperTokens database connection | postgresql://username:password@postgres:5432/agenta_oss_supertokens |
POSTGRES_URI_CORE | Core database connection | postgresql+asyncpg://username:password@postgres:5432/agenta_oss_core |
POSTGRES_URI_TRACING | Tracing database connection | postgresql+asyncpg://username:password@postgres:5432/agenta_oss_tracing |
Database Migrations
| Variable | Description | Default |
|---|---|---|
ALEMBIC_CFG_PATH_CORE | Core database migration config | /app/oss/databases/postgres/migrations/core/alembic.ini |
ALEMBIC_CFG_PATH_TRACING | Tracing database migration config | /app/oss/databases/postgres/migrations/tracing/alembic.ini |
SuperTokens (Authentication)
| Variable | Description | Default |
|---|---|---|
SUPERTOKENS_API_KEY | SuperTokens API key | (empty) |
SUPERTOKENS_CONNECTION_URI | SuperTokens service URL | http://supertokens:3567 |
Analytics
| Variable | Description | Example |
|---|---|---|
POSTHOG_API_KEY | PostHog analytics key | phc_xxxxxxxx |
Third-party (TLS/SSL)
Required for HTTPS/SSL configuration:
| Variable | Description | Example |
|---|---|---|
AGENTA_SSL_DIR | Directory for SSL certificates | /home/user/ssl_certificates |