Environment Variables
Koios is configured through environment variables passed to the Docker container. Most deployments work with the defaults, but you can customize network ports, performance tuning, logging, authentication, and reverse proxy settings.
Setting Environment Variables
Add -e flags to the docker run command in your systemd service file:
After editing the service file, reload and restart:
Network & TLS
Control how Koios handles HTTPS, HTTP, and port assignments.
Common Scenarios
Standard deployment (default): No variables needed — Koios listens on ports 443 (HTTPS) and 80 (HTTP redirect).
Custom ports:
Behind a TLS-terminating proxy (e.g., NGINX, HAProxy, AWS ALB):
Koios serves plain HTTP on port 8080. The proxy handles HTTPS and forwards traffic to this port.
Performance Tuning
Adjust worker threads and timeouts for your deployment size.
Authentication
Control JWT token lifetimes for user sessions.
Logging
Control log output destination, format, and verbosity.
Log Forwarding (OpenTelemetry)
Forward logs from Koios to an external observability platform using the built-in OpenTelemetry Collector.
Example: Forwarding to Grafana Cloud
OPC-UA Configuration
Reverse Proxy Settings
When running behind a reverse proxy, you may need to configure CSRF protection and cookie settings so that the proxy's domain and protocol are trusted.
CSRF Protection
Session Cookies
Proxy Headers
Example: Behind NGINX with Custom Domain
Debugging
These variables are intended for troubleshooting and should not be enabled in normal operation.
