Environment Variables
Required and optional environment variables for local, mixed, and Docker deployments.
by @saifyxpro
HeadlessX uses a small set of hard requirements and a larger set of service-specific variables.
Main workspace file
Use the root workspace file as the main source of truth:
This drives the shared runtime for:
- API
- queue worker
- yt-engine
- HTML-to-Markdown service
- shared web runtime values
Root example
Current local example:
Optional values are still common in some deployments:
INTERNAL_API_URLFRONTEND_URL
Docker example
Full Docker uses:
Important Docker values:
Required core variables
| Variable | Purpose |
|---|---|
DATABASE_URL | PostgreSQL connection string |
REDIS_URL | Redis connection for BullMQ and crawl jobs |
PORT | backend API port |
WEB_PORT | dashboard port |
NEXT_PUBLIC_API_URL | browser-facing backend URL for the dashboard |
DASHBOARD_INTERNAL_API_KEY | server-side dashboard to API secret |
CREDENTIAL_ENCRYPTION_KEY | encryption key for stored secrets |
Service URLs
| Variable | Purpose |
|---|---|
HTML_TO_MARKDOWN_SERVICE_URL | markdown extraction service |
YT_ENGINE_URL | YouTube engine base URL |
YT_ENGINE_PORT | local yt-engine port override |
HTML_TO_MARKDOWN_PORT | local markdown service port override |
Search and integration keys
| Variable | Purpose |
|---|---|
TAVILY_API_KEY | Tavily routes |
EXA_API_KEY | Exa routes |
Security values
Generate long random values for:
DASHBOARD_INTERNAL_API_KEYCREDENTIAL_ENCRYPTION_KEY
Example:
Failure modes to know
- missing
REDIS_URL: queue-backed crawl features fail - missing
YT_ENGINE_URL: YouTube endpoints fail - missing dashboard internal key: protected dashboard proxy flows break
- mismatched
NEXT_PUBLIC_API_URLandFRONTEND_URL: web-to-API communication issues