Skip to content

Environment variables

Reference list of every environment variable read by the Phlix Media Server, its default, and a one-line description. Each entry links back to the file that consumes it.

Container & bootstrap

VariableDefaultDescription
PHLIX_CONTAINER_COMPILEunsetWhen truthy (1, true, yes, on) enables PHP-DI's compiled-container cache in var/cache/container/. Disabled by default for dev parity. See Phlix\Common\Container\ContainerFactory.

Events

VariableDefaultDescription
PHLIX_DEBUG_EVENTS0When truthy (1, true, yes, on) wraps the PSR-14 dispatcher in Tukio's DebugEventDispatcher, which logs every dispatched event class at debug level on the events channel (.logs/events.log). Useful for tracing plugin behaviour; leave off in production. See Phlix\Common\Events\EventDispatcherFactory and docs/dev/event-reference.md.

Plugins

VariableDefaultDescription
PHLIX_PLUGINS_ALLOW_HTTP0When truthy (1, true, yes, on) lets the plugin loader accept plain http:// source URLs. Default off — HTTPS or file:// only. See Phlix\Plugins\Installer\HttpInstaller.
PHLIX_PLUGINS_REQUIRE_SIGNATURE0When truthy, the plugin loader refuses to install unsigned plugins and refuses signatures missing from the trusted-key allowlist. Default off, which means unsigned plugins install with a warning on the plugins log channel. See Phlix\Plugins\Signature\SignatureVerifier.
PHLIX_PLUGINS_COMPOSER_TIMEOUT120Hard timeout (seconds) on the per-plugin composer install --no-dev subprocess. See Phlix\Plugins\Installer\ComposerRunner.

Auth

VariableDefaultDescription
JWT_SECRETdefault-secret-change-meHMAC secret used to sign / verify JWT access and refresh tokens. The default is intentionally insecure so a missing env var fails closed in production deployments. Read by Phlix\Common\Container\Providers\AuthServicesProvider.

Hub / Pairing

VariableDefaultDescription
PHLIX_HUB_URLunsetBase URL of the Phlix Hub to pair with (e.g. https://hub.example.com). When set, the server initiates pairing automatically on startup if enrolled. See Phlix\Hub\HubClient and config/hub.php.
PHLIX_HUB_JWKS_URLunsetURL of the hub's JWKS endpoint for validating hub-issued JWTs. Typically set automatically during enrollment. See Phlix\Hub\HubJwtValidator and config/hub.php.
PHLIX_HUB_ENROLLMENT_TOKENunsetWhen set, overrides the enrollment token read from config/hub-enrollment.json. Mostly useful for automation / container orchestration. See Phlix\Hub\HubClient::loadEnrollment().
PHLIX_HUB_HEARTBEAT_INTERVAL60Interval in seconds between hub heartbeat calls. Must be between 30 and 3600. See Phlix\Hub\HubClient::startHeartbeatLoop() and config/hub.php.
PHLIX_SUBDOMAIN_AUTO_CLAIM1When truthy (1, true, yes, on) automatically claims a *.phlix.media subdomain from the hub after enrollment. See Phlix\Hub\SubdomainClient and config/hub.php.
PHLIX_TLS_ENABLED1When truthy enables TLS/HTTPS for the server's public hostname. Requires a subdomain to be allocated. See config/hub.php.
PHLIX_DOMAINphlix.mediaThe base domain for server subdomains (e.g. abc12345.phlix.media). See config/hub.php.

Relay tunnel

VariableDefaultDescription
PHLIX_RELAY_ENABLED0When truthy (1, true, yes, on) enables the persistent WSS relay tunnel to the hub. Requires the server to be enrolled. See Phlix\Hub\RelayConfig and config/relay.php.
PHLIX_RELAY_HUB_URLwss://hub.example.com/api/v1/servers/{id}/relayWebSocket URL of the hub relay endpoint. {id} is replaced with the server's UUID from enrollment. See Phlix\Hub\RelayConsumer and config/relay.php.
PHLIX_RELAY_TUNNEL_HOSTNAMEemptyPublic hostname assigned to this server's relay tunnel (e.g. my-server.phlix.media). See Phlix\Hub\RelayConfig and config/relay.php.
PHLIX_RELAY_RECONNECT_DELAY5Seconds to wait before attempting to reconnect after the relay tunnel is disconnected. See Phlix\Hub\RelayConfig and config/relay.php.
PHLIX_RELAY_PING_INTERVAL30Seconds between keep-alive ping frames sent over the relay tunnel. See Phlix\Hub\RelayConfig and config/relay.php.
PHLIX_RELAY_PING_TIMEOUT10Seconds to wait for a pong response before considering the relay connection dead. See Phlix\Hub\RelayConfig and config/relay.php.

Port forwarding / remote access

VariableDefaultDescription
PHLIX_PORT_FORWARD_AUTO1When truthy (1, true, yes, on) enables automatic port forwarding via UPnP-IGD on startup. See Phlix\Network\PortForwardService and config/port-forward.php.
PHLIX_EXTERNAL_PORT32400Port to use for automatic port forwarding. Both external and internal ports use this value by default. See Phlix\Network\PortForwardService and config/port-forward.php.
PHLIX_EXTERNAL_HTTP_PORT8080External HTTP port for the web portal when accessed remotely. See config/port-forward.php.
PHLIX_EXTERNAL_HTTPS_PORT8443External HTTPS port for the web portal when accessed remotely. See config/port-forward.php.
PHLIX_UPNP_ENABLED1When truthy enables UPnP-IGD port mapping attempts. When falsy, only STUN-based external IP detection is used. See Phlix\Network\UpnpIgdClient and config/port-forward.php.
PHLIX_STUN_SERVERstun.l.google.comSTUN server hostname for discovering the server's public IP address. See Phlix\Network\StunClient and config/port-forward.php.
PHLIX_STUN_PORT19302STUN server port. See Phlix\Network\StunClient and config/port-forward.php.

Database (test only)

These are consumed by phpunit.xml only and have no effect on production.

VariableDefaultDescription
APP_ENVtestingMarks the runtime as a test environment.
DB_HOST127.0.0.1MySQL host used by integration tests.
DB_PORT3306MySQL port used by integration tests.
DB_DATABASEphlix_testMySQL database name used by integration tests.
DB_USERrootMySQL username used by integration tests.
DB_PASSWORDemptyMySQL password used by integration tests.

Server

VariableDefaultDescription
PHLIX_HTTP_PORT32400HTTP port the server listens on. Overridden by config/server.php server.port at runtime. See config/server.php.
PHLIX_PUBLIC_URLunsetPublic URL used in Hub relay and DLNA announcements. Must be set if the server is behind a reverse proxy. See Phlix\Server\Core\Application.
PHLIX_LOG_LEVELinfoMinimum log level for application logs written to .logs/app.log. Valid values (in order of verbosity): debug, info, notice, warning, error, critical, alert, emergency. See config/logger.php.

Database

VariableDefaultDescription
PHLIX_DATABASE_HOST127.0.0.1MySQL host; maps to config/database.php connections.mysql.host.
PHLIX_DATABASE_PORT3306MySQL port; maps to config/database.php connections.mysql.port.
PHLIX_DATABASE_NAMEphlixDatabase name; maps to config/database.php connections.mysql.database.
PHLIX_DATABASE_USERphlixDatabase username; maps to config/database.php connections.mysql.username.
PHLIX_DATABASE_PASSWORDemptyDatabase password. Alias for the DB_PASSWORD env var consumed by config/database.php. Prefer setting DB_PASSWORD to avoid confusion.

Transcoding / Hardware acceleration

VariableDefaultDescription
PHLIX_HWACCELnonePreferred hardware acceleration. Valid values: nvidia, vaapi, videotoolbox, qsv, amf, v4l2, none. Overridden by config/ffmpeg.php hwaccel.vendor_priority. See config/ffmpeg.php.

Timezone

VariableDefaultDescription
TZsystem TZPHP date_default_timezone_set() value. Controls timestamps in logs and EPG data. Set to your local timezone (e.g., America/New_York, Europe/London).

The production database credentials live in config/database.php (which reads DB_PASSWORD from the environment via getenv('DB_PASSWORD')).

BSD-3-Clause