- 30 Jun 2025
- 1 Minute to read
-
Print
-
DarkLight
Server Environment Variables
- Updated on 30 Jun 2025
- 1 Minute to read
-
Print
-
DarkLight
Server environment variables can be configured by modifying the .env
file located at /app/.env
.
Modifications to the .env
file will require a restart of the Polarity Server's Docker containers:
cd /app && ./down.sh && ./up.sh
Variables
MIX_ENV=prod
POLARITY_HOSTNAME={{hostname of Polarity server}}
POLARITY_HTTPS_PORT=4001
POLARITY_HTTP_PORT=4000
POLARITY_TLS_KEY_PATH=/app/certs/polarity_key.pem
POLARITY_TLS_CERT_PATH=/app/certs/polarity.pem
POLARITY_LICENSE=/app/license/polarity.lic
POLARITY_PUBLIC_LICENSE_KEY=/app/license/server.crt
POLARITY_DB_DATABASE=breach
POLARITY_DB_HOST={{DB Host}}
POLARITY_DB_PORT=5432
POLARITY_DB_USER=polarity
POLARITY_DB_PASSWORD={{Password]]
POLARITY_DB_CONNECTION_POOL_SIZE=50
POLARITY_DB_SECRET_KEY={{Secret_key}}
POLARITY_DB_SUPERUSER_USER=breach
POLARITY_DB_SUPERUSER_PASSWORD={{Secret Key}}
POLARITY_METRICS_CACHE_HOST={{Cache Host}}
POLARITY_METRICS_CACHE_PORT=8379
POLARITY_METRICS_CACHE_DB=1
POLARITY_METRICS_CACHE_MEMORY=0.1
POLARITY_USER_METRICS_COLLECTION=true
POLARITY_INTEGRATION_CACHE_HOST={{cache host}}
POLARITY_INTEGRATION_CACHE_PORT=7379
POLARITY_INTEGRATION_CACHE_DB=1
POLARITY_INTEGRATION_CACHE_MEMORY=0.1
POLARITY_INITIALIZE_REDIS_CONFIGS_ON_START=true
POLARITY_INTEGRATIONS_ASSETS_FOLDER=/app/integrations/assets
POLARITY_INTEGRATIONS_FOLDER=/app/integrations
POLARITY_SECRET_SIGNING_SALT={{salt}}
POLARITY_SECRET_KEY_BASE={{Key}}
POLARITY_GUARDIAN_KEY_BASE={{Key}}
POLARITY_LAUNCH_DARKLY_API_KEY=INVALID_POLARITY_LAUNCH_DARKLY_API_KEY
POLARITY_RBAC_MODEL=/app/rbac_model.conf
POLARITY_PLATFORM_API_HOSTNAME=https://polarity_platform:4001
POLARITY_LOG_INTEGRATION_LOOKUPS=verbose
HTTP_PROXY=http://{{proxyhosntame}}:{{Proxy Port}}
HTTPS_PROXY=https://{{proxyhosntame}}:{{Proxy Port}}
NO_PROXY={{hostnames/IPS of services to ignore}},polarity_platform
POLARITY_CONTAINER_GATEWAY=172.18.0.1
Environment Variable Details
Variable | Description | Default Value | Required? |
---|---|---|---|
| Server mode |
| Yes |
| Server hostname | Hostname of the server | Yes |
| Platform container SSL service port |
| Yes |
| Platform container HTTP service port (if needed) |
| No |
| Path to Platform container private key |
| Yes |
| Path to Platform container public key |
| Yes |
| Path to Polarity Server License |
| Yes |
| Path to Polarity public signing key |
| Yes |
| Name of PostgreSQL database |
| Yes |
| Name of PostgreSQL database container or host serving PG database |
| Yes |
| PostgreSQL service port |
| Yes |
| PostgreSQL user name |
| Yes |
| PostgreSQL user password | Generated at install | Yes |
| Maximum number of connections for PostgreSQL database (50 is the maximum) |
| Yes |
| PostgreSQL access secret key | Generated at install | Yes |
| PostgreSQL super user name |
| No |
| PostgreSQL super user password | Password from v4 Server | No |
| Name of Metrics Cache database container or host serving Metrics Cache database |
| Yes |
| Metrics Cache service port |
| Yes |
| Index number of Redis database to use for metrics cache |
| Yes |
| Percent of system memory allowed for Metrics Cache database |
| Yes |
| Collect user metrics* |
| Yes |
| Name of Integration Cache database container or host serving Integration Cache database |
| Yes |
| Integration Cache service port |
| Yes |
| Index number of Redis database to use for integration cache |
| Yes |
| Percent of system memory allow for Integration Cache database |
| Yes |
| Allow Polarity to configure Redis-based caches on start (for non-containerized installs) |
| Yes |
| Location of integration assets directory |
| Yes |
| Location of integrations directory |
| Yes |
| Session key generation salt | Generated at install | Yes |
| Session key generation base | Generated at install | Yes |
| Signing key base used for JWTs | Generated at install | Yes |
| Logging level for integration lookups (used in Polarity Source Analytics)* |
| Yes |
| 3rd party feature flag monitoring and collection platform (disabled by default) |
| Yes |
| Location of RBAC configuration template |
| Yes |
| Server hostname (must match certificate hostname for proper operation) | Hostname of the server | Yes |
| Platform container API service port |
| Yes |
| HTTPS traffic proxy | N/A | No |
| HTTP traffic proxy | N/A | No |
| Proxy exception settings |
| Yes |
| Container environment network gateway |
| Yes |
* Note regarding Collection and Logging on Polarity Systems
Polarity by ThreatConnect does not receive or collect any information or telemetry from your on-premise Polarity instance.
Polarity by ThreatConnect will only collect metrics and telemetry from our SaaS instances as needed to ensure availability and user experience.
Please reach out to us if you have any questions.