Overview
Genie Helper requires several environment variables for security, service connectivity, and feature configuration. This page documents all required and optional environment variables.Core Security Variables
Credential Encryption
Required for productionDirectus Admin Access
- Registration endpoint (creates users without exposing admin credentials to browser)
- RBAC sync operations
- Server-side Directus MCP tools
- Login to Directus admin panel (
http://localhost:8055/admin) - Settings → Access Tokens → Create New Token
- Name: “Server Admin Token”
- No expiration
- Copy token to
.env
RBAC Sync Webhook
Service Configuration
AnythingLLM (server/.env)
Directus CMS (cms/.env)
Stagehand Server (server/.env)
Media Worker (media-worker/.env)
Dashboard (dashboard/.env)
MCP Server Configuration
MCP servers are configured instorage/plugins/anythingllm_mcp_servers.json:
server/utils/boot/index.js.
Production Hardening
Change Default Passwords
Enable Password Policy (Directus)
- Minimum 8 characters
- At least 1 digit
- At least 1 lowercase letter
- At least 1 uppercase letter
- At least 1 special character
- No whitespace
Restrict Admin Access
For production, restrict admin panel access:- IP Allowlist: Configure Nginx to allow admin subdomains only from specific IPs
- VPN: Require VPN connection for admin access
- Cookie Gate: Use the cookie gate system (see nginx configs)
Database: SQLite → PostgreSQL
For production with multiple users, migrate Directus from SQLite to PostgreSQL:Environment Files Checklist
-
server/.env- AnythingLLM configuration -
cms/.env- Directus configuration -
media-worker/.env- BullMQ worker configuration -
dashboard/.env- React build variables -
storage/plugins/anythingllm_mcp_servers.json- MCP server config
Security Best Practices
- Never commit
.envfiles - Add to.gitignore - Use strong random values - Generate with
crypto.randomBytes() - Rotate secrets regularly - Especially admin tokens and encryption keys
- Restrict admin token scope - Use dedicated tokens per service if possible
- Enable HTTPS - Use SSL certificates (Let’s Encrypt via Plesk)
- Monitor logs - Check PM2 logs for unauthorized access attempts
