Server Security & Authentication
ELIZA_SERVER_AUTH_TOKEN
Controls API authentication for the ElizaOS server..env
- 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
Web UI Control
ELIZA_UI_ENABLE
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 UI
- Default Behavior:
- Development (
NODE_ENV=development
): UI enabled - Production (
NODE_ENV=production
): UI disabled for security
- Development (
- Usage:
- Security: Disabling UI reduces attack surface by removing web interface
- API Access: API endpoints remain available regardless of UI setting
When the UI is disabled, non-API routes return a 403 Forbidden response with a message explaining that the web UI is disabled. The dashboard URL is only shown on startup when the UI is enabled.
Environment Mode
NODE_ENV
Controls the application environment and affects various behaviors including default UI settings and security policies.- Values:
development
,production
- Default:
development
- Effects:
- CSP (Content Security Policy) configuration
- Default UI enable/disable behavior
- Error message verbosity
- Debugging features availability
Examples
Production Deployment (Secure)
.env
Development Setup (Convenient)
.env
Headless API Server
.env
Public Web Application
.env
Security Considerations
API Authentication: In production, always set
ELIZA_SERVER_AUTH_TOKEN
to prevent unauthorized access to your agent’s API endpoints.-
Default Security: In production mode with default settings:
- Web UI is disabled
- API endpoints are open (no authentication)
- This prevents accidental exposure of the dashboard but leaves APIs accessible
-
Recommended Production Setup:
- Set
ELIZA_SERVER_AUTH_TOKEN
to a strong, random value - Keep
ELIZA_UI_ENABLE=false
unless you need the web interface - Use HTTPS in production (configure via reverse proxy)
- Set
-
Development Convenience:
- Default settings optimize for easy development
- UI is enabled automatically
- No authentication required
Related Configuration
For a complete list of all available environment variables including database connections, model providers, and plugin settings, see:- Project Overview - Environment Configuration
.env.example
in the repository - Template file showing all available environment variables with example values
.env
vs .env.example
:.env
- Your actual working environment file with real secret values (never commit this file).env.example
- Template file with example/placeholder values (safe to commit as reference)