Deployment
Configuration Reference
All configuration options for OpenAgent.
OpenAgent is configured via environment variables (recommended for Docker) or the conf/app.conf file (for source deployments).
| Variable | Default | Description |
|---|
APP_SECRET_KEY | — | Required. Secret key for session signing. Generate with openssl rand -hex 32. |
APP_HOST | 0.0.0.0 | Bind address for the HTTP server |
APP_PORT | 14000 | HTTP port |
APP_DOMAIN | — | Public domain (used for webhook URLs) |
APP_ENV | production | production or development |
LOG_LEVEL | info | debug, info, warn, error |
| Variable | Default | Description |
|---|
DB_HOST | localhost | MySQL host |
DB_PORT | 3306 | MySQL port |
DB_NAME | openagent | Database name |
DB_USER | openagent | Database user |
DB_PASSWORD | — | Required. Database password |
DB_MAX_OPEN_CONNS | 100 | Max open connections in pool |
DB_MAX_IDLE_CONNS | 10 | Max idle connections in pool |
OpenAgent uses Casdoor for SSO and user management.
| Variable | Default | Description |
|---|
CASDOOR_ENDPOINT | http://casdoor:8000 | Casdoor service URL |
CASDOOR_CLIENT_ID | — | OAuth2 client ID from Casdoor |
CASDOOR_CLIENT_SECRET | — | OAuth2 client secret from Casdoor |
CASDOOR_ORG_NAME | built-in | Casdoor organization name |
CASDOOR_APP_NAME | openagent | Casdoor application name |
The Docker Compose setup configures Casdoor automatically. These variables only need to be set manually for custom deployments.
| Variable | Default | Description |
|---|
STORAGE_PROVIDER | local | local, s3, gcs, azure_blob |
STORAGE_LOCAL_PATH | ./uploads | Path for local storage |
STORAGE_S3_BUCKET | — | S3 bucket name |
STORAGE_S3_REGION | — | AWS region |
STORAGE_S3_ACCESS_KEY | — | AWS access key ID |
STORAGE_S3_SECRET_KEY | — | AWS secret access key |
STORAGE_S3_ENDPOINT | — | Custom S3 endpoint (for MinIO, etc.) |
STORAGE_MAX_FILE_SIZE | 100MB | Maximum upload size |
| Variable | Default | Description |
|---|
KB_CHUNK_SIZE | 512 | Default chunk size in tokens |
KB_CHUNK_OVERLAP | 50 | Overlap between chunks in tokens |
KB_DEFAULT_TOP_K | 5 | Default number of chunks to retrieve |
KB_SIMILARITY_THRESHOLD | 0.7 | Minimum similarity score for retrieval |
| Variable | Default | Description |
|---|
RATE_LIMIT_ENABLED | true | Enable per-user rate limiting |
RATE_LIMIT_RPM | 60 | Requests per minute per user |
RATE_LIMIT_BURST | 10 | Burst capacity |
| Variable | Default | Description |
|---|
CORS_ORIGINS | * | Comma-separated allowed origins |
CSRF_ENABLED | true | Enable CSRF protection |
SECURE_COOKIES | true | Set Secure flag on cookies (requires HTTPS) |
ADMIN_EMAIL | — | Email for the initial admin account |
ADMIN_PASSWORD | — | Password for the initial admin account |
Required for password reset and email notifications.
| Variable | Default | Description |
|---|
SMTP_HOST | — | SMTP server hostname |
SMTP_PORT | 587 | SMTP port |
SMTP_USER | — | SMTP username |
SMTP_PASSWORD | — | SMTP password |
SMTP_FROM | — | Sender email address |
SMTP_TLS | true | Enable STARTTLS |
| Variable | Default | Description |
|---|
MULTI_TENANT | false | Enable multi-tenant mode |
TENANT_ISOLATION | database | database (separate DB per tenant) or schema |
| Variable | Default | Description |
|---|
WORKER_CONCURRENCY | 4 | Number of concurrent background workers |
CACHE_ENABLED | true | Enable in-memory caching |
CACHE_TTL | 300 | Cache TTL in seconds |
# Application
APP_SECRET_KEY=your-64-char-secret-here
APP_DOMAIN=https://ai.yourcompany.com
LOG_LEVEL=info
# Database
DB_HOST=db
DB_PORT=3306
DB_NAME=openagent
DB_USER=openagent
DB_PASSWORD=secure-db-password
DB_ROOT_PASSWORD=secure-root-password
# Storage (S3 example)
STORAGE_PROVIDER=s3
STORAGE_S3_BUCKET=my-openagent-uploads
STORAGE_S3_REGION=us-east-1
STORAGE_S3_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
STORAGE_S3_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
# Admin account (first run only)
ADMIN_EMAIL=admin@yourcompany.com
ADMIN_PASSWORD=change-me-after-first-login
# Email
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=SG.xxxxx
SMTP_FROM=noreply@yourcompany.com
Never commit .env files to version control. Add .env to your .gitignore.