packages/docs/projects/environment-variables.mdx
This document describes the server configuration environment variables for ElizaOS.
Controls API authentication for the ElizaOS server.
ELIZA_SERVER_AUTH_TOKEN=your-secret-token
How it works:
Set this as your server's required API key
External apps must send X-API-KEY: your-secret-token header when calling your /api/* endpoints
Server rejects requests with wrong/missing keys (401 Unauthorized)
Default: Unset (no authentication required)
Security: When unset, all API endpoints are publicly accessible
CORS: OPTIONS requests are always allowed for preflight
Example:
# API call with authentication
curl -H "X-API-KEY: mysecrettoken123" \
-H "Content-Type: application/json" \
http://localhost:3000/api/agents
Controls whether the web user interface is served by the server.
Purpose: Enable or disable the web UI for security and deployment flexibility
Values:
true - Force enable UIfalse - Force disable UIDefault Behavior:
NODE_ENV=development): UI enabledNODE_ENV=production): UI disabled for securityUsage:
# Force enable in production
ELIZA_UI_ENABLE=true
# Force disable in development
ELIZA_UI_ENABLE=false
# Use automatic behavior
ELIZA_UI_ENABLE=
Security: Disabling UI reduces attack surface by removing web interface
API Access: API endpoints remain available regardless of UI setting
Controls the application environment and affects various behaviors including default UI settings and security policies.
development, productiondevelopmentNODE_ENV=production
ELIZA_SERVER_AUTH_TOKEN=secure-random-token-here
ELIZA_UI_ENABLE=false
NODE_ENV=development
# ELIZA_SERVER_AUTH_TOKEN= # Unset for easy development
# ELIZA_UI_ENABLE= # Unset for automatic behavior (UI enabled)
ELIZA_SERVER_AUTH_TOKEN=api-only-token
ELIZA_UI_ENABLE=false
NODE_ENV=production
ELIZA_SERVER_AUTH_TOKEN=my-api-key
ELIZA_UI_ENABLE=true
Default Security: In production mode with default settings:
Recommended Production Setup:
ELIZA_SERVER_AUTH_TOKEN to a strong, random valueELIZA_UI_ENABLE=false unless you need the web interfaceDevelopment Convenience:
For a complete list of all available environment variables including database connections, model providers, and plugin settings, see:
.env.example in the repository - Template file showing all available environment variables with example values<Card title="CLI Environment Commands" icon="terminal" href="/cli-reference/env"
Manage environment variables with the CLI </Card>
<Card title="REST Reference" icon="code" href="/rest-reference"> Explore the REST API that these variables protect </Card> <Card title="Project Overview" icon="folder" href="/projects/overview"> Return to the complete project documentation </Card> </CardGroup>