Environment Variables

All configuration options for Insights Plus.

Environment Variables

VariableDescription
SECRET_KEYEncryption key for stored API keys, UniFi credentials, and session tokens. Recommended but optional — falls back to POSTGRES_PASSWORD or DB_PASSWORD if not set
AUTH_ENABLEDSet to true to enable built-in authentication. Requires HTTPS. Default: false
POSTGRES_PASSWORDPostgreSQL password for the embedded database user. Not required when using an external database with SECRET_KEY set
ABUSEIPDB_API_KEYEnables threat scoring on blocked inbound IPs. Free tier: 1,000 check lookups/day + 5 blacklist pulls/day
MAXMIND_ACCOUNT_IDEnables GeoIP auto-update. Without it, manually place .mmdb files
MAXMIND_LICENSE_KEYPaired with account ID for auto-update
TZTimezone for cron schedules. Defaults to UTC. Examples: Europe/London, Asia/Amman, America/New_York
LOG_LEVELLogging verbosity: DEBUG, INFO, WARNING, ERROR, CRITICAL. Defaults to INFO
UNIFI_HOSTUniFi Controller URL (e.g., https://192.168.1.1). Can also be set via Settings UI
UNIFI_API_KEYUniFi API key (Local Admin). For UniFi OS controllers only. Can also be set via Settings UI
UNIFI_USERNAMELocal username for self-hosted UniFi controllers. Use instead of UNIFI_API_KEY. Can also be set via Settings UI
UNIFI_PASSWORDLocal password for self-hosted UniFi controllers. Paired with UNIFI_USERNAME. Can also be set via Settings UI
UNIFI_SITEUniFi site name. Defaults to 'default'
UNIFI_VERIFY_SSLSet to false for self-signed certificates. Defaults to true
UNIFI_POLL_INTERVALDevice polling interval in seconds. Defaults to 300 (5 minutes)
UNIFI_ENABLEDMaster toggle for UniFi integration. Auto-enables when both UNIFI_HOST and UNIFI_API_KEY are set
PIHOLE_HOSTPi-hole v6 base URL (e.g., http://10.10.10.229:60080). See Pi-hole docs page
PIHOLE_PASSWORDPi-hole admin password. Setting both PIHOLE_HOST and PIHOLE_PASSWORD auto-enables the integration
PIHOLE_POLL_INTERVALPi-hole poll interval in seconds (15-86400). Defaults to 60
PIHOLE_ENABLEDMaster toggle for the Pi-hole integration. Defaults to auto-enable when host + password are set
RETENTION_DAYSLog retention in days for firewall/DHCP/Wi-Fi/system. Defaults to 60
DNS_RETENTION_DAYSDNS log retention in days. Defaults to 10
DB_HOSTExternal PostgreSQL host. When set to a non-localhost address, embedded PG is disabled
DB_PORTExternal PostgreSQL port (default: 5432)
DB_NAMEDatabase name (default: unifi_logs)
DB_USERDatabase user (default: unifi)
DB_PASSWORDDatabase password (falls back to POSTGRES_PASSWORD)
DB_SSLMODESSL mode: require, verify-ca, verify-full
DB_SSLROOTCERTPath to CA certificate file
DB_SSLCERTPath to client certificate (mTLS)
DB_SSLKEYPath to client key (mTLS)

Ports

PortProtocolPurpose
514UDPSyslog receiver (incoming logs from UniFi)
8090TCPWeb UI and REST API

Retention Policy

Log TypeDefaultRange
Firewall, DHCP, Wi-Fi, System60 days1-3650 days
DNS (when enabled)10 days1-3650 days

Configurable via Settings > Data & Backups slider, or via environment variables. Cleanup runs daily at 03:00.