ZefiraZEFIRA Docs GitHub ↗

Configuration

Environment variables and panel settings.

Environment variables

Set in /opt/zefira/.env (installer-managed, mode 600) or exported before start:

VariableDefaultPurpose
ZEFIRA_ADMIN_USERNAMEadminFirst-run admin (lowercased, validated)
ZEFIRA_ADMIN_PASSWORDrandomFirst-run password (random if empty)
ZEFIRA_DOMAINPublic domain baked into configs & links
ZEFIRA_PORT8000Panel listen port (systemd unit)
ZEFIRA_SUB_PORT443Port in VLESS/VMess/Trojan/SS links
ZEFIRA_HY2_PORT8443Port in Hysteria2 links
ZEFIRA_WG_PORT51820WireGuard endpoint port
ZEFIRA_DNS1.1.1.1DNS in WireGuard configs
ZEFIRA_OVPN_PORT / ZEFIRA_OVPN_PROTO1194 / udpOpenVPN endpoint
DATABASE_URLSQLitemysql+pymysql://… or postgresql+psycopg2://…
SUBSCRIPTION_PATH/subSubscription URL prefix
ZEFIRA_SESSION_TTL28800Login session lifetime (seconds, 8h)
ZEFIRA_TRUSTED_PROXIESemptyCIDRs allowed to send X-Forwarded-For
TG_BOT_TOKEN / TG_CHAT_IDemptyTelegram notifications

Panel settings

Settings → Server / Hosts edits domain, ports, DNS, WireGuard public key, REALITY SNI list, obfuscation and CDN options live (no restart). Settings → Tunnel sets the public URL and trusted proxies — the latter decides whose X-Forwarded-For is believed for rate limiting and audit logs.

HTTPS / SSL

Behind Nginx the panel honors X-Forwarded-Proto from localhost/trusted proxies, so cookies get the Secure flag and HSTS is emitted.

Data locations

PathContent
/opt/zefira/.envSecrets (600)
/opt/zefira/instance/zefira.dbSQLite database (600)
/opt/zefira/instance/secret.keyJWT + encryption master key (600) — lose it and encrypted secrets become unreadable
/opt/zefira/instance/ca.key / ca.crtOpenVPN certificate authority