Core environment variables are centralized in api/constants.py. Variables marked Required in the description must be explicitly set β€” the application will either fail to boot or behave insecurely without them.

Deployment Modes

Peachdesk supports two deployment modes, set via DEPLOYMENT_MODE:
  • OSS: The default mode. Designed for self-hosted deployments using Docker Compose β€” the fastest way to get Peachdesk running. Uses local JWT authentication and MinIO for storage.
  • SaaS: Intended for customised deployments outside of Docker. Authentication and API key management are handled through Peachdesk Managed Platform Services (MPS), allowing greater flexibility in how the platform is hosted and integrated.
The relevant required variables for each mode are noted in the descriptions below.

Application

VariableDefaultDescription
ENVIRONMENTlocalRuntime environment. Affects logging and behaviour. One of local, production, test
DEPLOYMENT_MODEossDeployment mode. Use oss for self-hosted
AUTH_PROVIDERlocalAuthentication provider. Use local for OSS

Database

VariableDefaultDescription
DATABASE_URLN/ARequired. PostgreSQL connection string. e.g. postgresql+asyncpg://user:pass@host:5432/dbname
REDIS_URLN/ARequired. Redis connection string. e.g. redis://localhost:6379

Authentication (OSS)

VariableDefaultDescription
OSS_JWT_SECRETN/ARequired for OSS deployments. Secret used to sign JWT tokens. Must be set to a strong random value in production
OSS_JWT_EXPIRY_HOURS720JWT token lifetime in hours (default: 30 days)
Never use the placeholder OSS_JWT_SECRET in a production deployment. Generate a strong random secret and store it securely.

URLs

VariableDefaultDescription
BACKEND_API_ENDPOINThttp://localhost:8000Internal URL of the backend API
UI_APP_URLhttp://localhost:3010URL of the frontend application
MPS_API_URLhttp://localhost:8000Base URL of the self-hosted Model Proxy Service (the API’s own URL). Use https://api.peachdeskai.com for the hosted platform.
PEACHDESK_MPS_SECRET_KEYnullRequired for non-OSS deployments. Secret key for authenticating with MPS

Storage

Peachdesk uses MinIO by default, which is bundled with the self-hosted deployment and requires no external setup. Set ENABLE_AWS_S3=true to switch to AWS S3 β€” typically used for cloud or managed deployments where S3 is already part of the infrastructure.

MinIO (OSS default)

VariableDefaultDescription
MINIO_ENDPOINTlocalhost:9000MinIO server host and port
MINIO_PUBLIC_ENDPOINTnullPublicly accessible MinIO URL (for download links)
MINIO_ACCESS_KEYN/ARequired for OSS deployments. MinIO access key. Must be set to a secure value in production
MINIO_SECRET_KEYN/ARequired for OSS deployments. MinIO secret key. Must be set to a secure value in production
MINIO_BUCKETvoice-audioBucket name for audio files
MINIO_SECUREfalseUse HTTPS for MinIO connections

AWS S3 (alternative)

VariableDefaultDescription
ENABLE_AWS_S3falseSet to true to use AWS S3 instead of MinIO
S3_BUCKETnullS3 bucket name
S3_REGIONus-east-1AWS region

WebRTC

VariableDefaultDescription
TURN_HOSTlocalhostTURN server hostname for WebRTC NAT traversal
TURN_PORT3478TURN server port
TURN_TLS_PORT5349TURN server TLS port
TURN_SECRETnullRequired for WebRTC. Shared secret for TURN credential generation
TURN_CREDENTIAL_TTL86400TURN credential validity in seconds (default: 24h)
FORCE_TURN_RELAYfalseDiagnostic flag. When true, restricts ICE to relay-only candidates on both server (SDP filter) and browser (iceTransportPolicy: 'relay'). Use to verify TURN connectivity end-to-end β€” calls fail cleanly if TURN is misconfigured instead of silently falling back to a direct path.

Tracing (Langfuse)

VariableDefaultDescription
LANGFUSE_HOSTnullLangfuse server URL
LANGFUSE_PUBLIC_KEYnullLangfuse public key
LANGFUSE_SECRET_KEYnullLangfuse secret key
Tracing activates automatically as soon as credentials are available β€” either via these environment variables (applied to all organizations) or per-organization in the UI under Platform Settings. If neither is set, spans are dropped silently. See the Tracing guide for setup instructions.

Monitoring

VariableDefaultDescription
SENTRY_DSNnullSentry DSN for error tracking
ENABLE_TELEMETRYfalseEnable anonymous telemetry collection

Logging

VariableDefaultDescription
LOG_LEVELDEBUGLog level: DEBUG, INFO, WARNING, ERROR
LOG_FILE_PATHnullWrite logs to this file path (in addition to stdout)
LOG_ROTATION_SIZE100 MBRotate log file when it reaches this size
LOG_RETENTION7 daysHow long to keep rotated log files
LOG_COMPRESSIONgzCompression format for rotated logs
SERIALIZE_LOG_OUTPUTfalseOutput logs as JSON (useful for log aggregation)

Campaigns

VariableDefaultDescription
DEFAULT_ORG_CONCURRENCY_LIMIT2Maximum concurrent outbound calls per organization

Billing & Credits (Stripe)

Billing is opt-in and SaaS-only. Leave it off for OSS / on-premises / Enterprise self-host deployments β€” usage is then unlimited, the billing routes return 404, and no Stripe client is constructed.
VariableDefaultDescription
ENABLE_BILLINGtrue if DEPLOYMENT_MODE=saas, else falseMaster switch. When true: new orgs get a free credit allowance, managed (PeachDesk-keyed) calls consume credits, and the Stripe routes are mounted. BYOK calls (the user’s own provider keys) always run free and are never gated.
FREE_TIER_CREDIT_TOKENS100Free managed credits granted to each new org (1 token = 1 US cent of managed cost; 100 β‰ˆ $1.00 β‰ˆ ~10–13 min).
PEACHDESK_QUOTA_RESERVE_TOKENS1Tokens reserved at call admission (refunded at reconcile, so calls are charged actual cost).
STRIPE_SECRET_KEYβ€”Stripe secret key. The Stripe routes go live only when this is set and ENABLE_BILLING is true. Store in a secret manager, never in the repo.
STRIPE_WEBHOOK_SIGNING_SECRETβ€”whsec_… for verifying webhook signatures. The webhook returns 503 until set.
STRIPE_PUBLISHABLE_KEYβ€”Publishable key (not required for hosted checkout; included for completeness).
STRIPE_PRICE_PLAN_PRO, STRIPE_PRICE_PLAN_ENTERPRISEβ€”Stripe recurring Price IDs for subscription plans. Only plans with a Price ID set appear in the catalog.
STRIPE_PLAN_PRO_TOKENS, STRIPE_PLAN_ENTERPRISE_TOKENS0Recurring credit allowance granted each cycle for each plan.
STRIPE_PRICE_TOPUP_SMALL, _MEDIUM, _LARGEβ€”Stripe one-off Price IDs for credit top-up packs.
STRIPE_TOPUP_SMALL_TOKENS, _MEDIUM_TOKENS, _LARGE_TOKENS0Credits granted per top-up pack.
BILLING_SUCCESS_URL, BILLING_CANCEL_URL{UI_APP_URL}/billing?status=…Stripe redirect targets after hosted checkout.
To enable billing in a non-saas deployment (for example DEPLOYMENT_MODE=enterprise), set ENABLE_BILLING=true and populate STRIPE_SECRET_KEY (plus the webhook signing secret and at least one Price ID). With ENABLE_BILLING=true but no Stripe key, free-tier credit limiting still applies and exhausted users can add their own provider keys (BYOK), but the purchase and subscribe routes stay disabled until the Stripe secret is configured.
A superadmin (is_superuser) can view every organization’s token usage and balances, and grant credits manually, at /admin/credits (API: GET /api/v1/admin/credits/overview, POST /api/v1/admin/credits/grant).

Further Customisation

The variables documented here cover the standard configuration surface. For advanced customisation β€” such as integrating additional services or tuning internal behaviour β€” consult the relevant module alongside api/constants.py to understand how each variable is consumed.