Skip to main content

Environment Variables

Complete reference for all Cockpit configuration options.

Authentication

VariableDefaultDescription
AUTH_MODEkeykey (single-admin with API key) or users (multi-user with email/password)
API_KEY(required for key mode)Shared API key for authentication
JWT_SECRET(required)Secret for signing JWT tokens (min 32 chars recommended)
ADMIN_EMAILInitial admin email (users mode, first-run only)
ADMIN_PASSWORDInitial admin password (users mode, first-run only)

Server

VariableDefaultDescription
PORT3000API server port
SERVER_NAMEServerDisplay name shown in the mobile app

Security

VariableDefaultDescription
FORCE_HTTPSfalseRedirect HTTP to HTTPS (set true behind reverse proxy)
CORS_ORIGINS(empty)Comma-separated allowed origins (empty = allow all)
RATE_LIMIT_MAX100Max requests per minute per IP
METRICS_TOKEN(empty)Bearer token required for /metrics endpoint

Monitoring

VariableDefaultDescription
ENDPOINTS(empty)HTTP probe targets. Format: Name|URL|ExpectedStatus (comma-separated)
SSL_DOMAINS(empty)Domains to monitor SSL certificate expiry (comma-separated)

Licensing

VariableDefaultDescription
LICENSE_KEY(empty)JWT license key for Pro/Enterprise. CE mode if not set. Alternative: place key in data/license.key

Paths

VariableDefaultDescription
PROC_PATH/host/procMounted /proc path for system metrics
DOCKER_SOCKET/var/run/docker.sockDocker Engine socket path
DATA_DIR/app/dataSQLite database and state files
EXTENSIONS_DIR/app/extensionsPro/Enterprise extension modules directory

Push Notifications

VariableDefaultDescription
EXPO_ACCESS_TOKEN(empty)Expo push notification token (Pro feature)

Enterprise

VariableDefaultDescription
COCKPIT_BASE_URL(from Host header)Base URL for SAML SP metadata generation
MTLS_VERIFY_SECRET(empty)Shared secret for mTLS verify endpoint

Example .env

# === Required ===
API_KEY=change-me-to-a-strong-key
JWT_SECRET=change-me-to-a-64-char-random-string

# === Recommended ===
AUTH_MODE=users
ADMIN_EMAIL=admin@example.com
ADMIN_PASSWORD=change-after-first-login
SERVER_NAME=Production VPS
FORCE_HTTPS=true
CORS_ORIGINS=https://cockpit.example.com

# === Monitoring ===
ENDPOINTS=API|https://api.example.com/health|200,Website|https://example.com|200
SSL_DOMAINS=example.com,api.example.com
METRICS_TOKEN=your-prometheus-scrape-token

# === License (optional) ===
LICENSE_KEY=eyJhbGciOiJSUzI1NiIs...