Install phlix-server via Docker โ
TL;DR โ
phlix-server is a PHP 8.3+ media server with HLS streaming, WebSocket real-time sync, DLNA, and a Vue /app web portal. This guide deploys it via Docker in roughly 10 minutes using the published ghcr.io/detain/phlix-server image and Docker Compose v2.
Minimum requirements: Docker 20.10+, Docker Compose v2, 2 CPU / 4 GB RAM.
Quick one-liner: the example compose intentionally refuses to start without an explicit image pin and real database passwords (${VAR:?โฆ} gates โ loud beats silently booting public placeholder secrets). Resolve a current immutable pin, then feed the three required variables inline:
TOKEN=$(curl -s "https://ghcr.io/token?scope=repository:detain/phlix-server:pull" | grep -o '"token":"[^"]*"' | cut -d'"' -f4)
PHLIX_PIN=$(curl -s -H "Authorization: Bearer $TOKEN" \
https://ghcr.io/v2/detain/phlix-server/tags/list | grep -o '[0-9a-f]\{40\}-latest' | sort | tail -1)
curl -sSL https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/server-only/docker-compose.yml | \
PHLIX_SERVER_IMAGE="ghcr.io/detain/phlix-server:$PHLIX_PIN" \
MYSQL_ROOT_PASSWORD=$(openssl rand -hex 16) \
PHLIX_DB_PASSWORD=$(openssl rand -hex 16) \
docker compose -f - up -dTwo harmless warnings may scroll by: the obsolete top-level version: attribute, and PHLIX_SECRET_KEY โฆ defaulting to a blank string โ the entrypoint generates and persists a JWT key on first boot (see ยง3). grep -o โฆ | sort | tail -1 picks the lexicographically highest <full-sha>-latest tag, not strictly the newest build; any tag it returns is a valid immutable pin (recipe and rationale in ยง1). Note that the generated passwords exist only in this shell โ for anything you will down and re-up later, use the file-based flow in ยง3 so the passwords live in .env.
Image variants:
| Image tag | Use case | Hardware |
|---|---|---|
ghcr.io/detain/phlix-server:latest | Generic x86_64, no HWaccel | Any 64-bit |
ghcr.io/detain/phlix-server:nvidia | NVIDIA GPU transcoding | NVIDIA GPU with driver 525+ |
ghcr.io/detain/phlix-server:intel | Intel Quick Sync Video | Intel CPUs with Quicksync (Gen 8+) |
1. Supported Docker variants โ
| Image tag | Use case | Hardware |
|---|---|---|
ghcr.io/detain/phlix-server:latest | Generic x86_64, no HWaccel | Any 64-bit |
ghcr.io/detain/phlix-server:nvidia | NVIDIA GPU transcoding | NVIDIA GPU with driver 525+ |
ghcr.io/detain/phlix-server:intel | Intel Quick Sync Video | Intel CPUs with Quicksync (Gen 8+) |
Registry path & mutable tags
These images live on ghcr.io/detain/phlix-server (pull with the full ghcr.io/ prefix โ e.g. ghcr.io/detain/phlix-server:nvidia). The bare :latest / :nvidia / :intel tags above are mutable convenience tags that move with every build to master, so a docker pull of one may give you a different image than the last time, or a stale one. For a reproducible pull, pin the immutable <full-sha>-<variant> tag the Docker Build & Push workflow publishes on every push (<variant> โ latest|intel|nvidia). The registry has no v1.2.3-style semver tags and no nightly-* tags. Find the current immutable shas with an anonymous read (no login required):
TOKEN=$(curl -s "https://ghcr.io/token?scope=repository:detain/phlix-server:pull" | jq -r .token)
curl -s -H "Authorization: Bearer $TOKEN" \
"https://ghcr.io/v2/detain/phlix-server/tags/list" \
| jq -r '.tags[]' | grep -E '^[0-9a-f]{40}-(latest|intel|nvidia)$' | sort | tailThe companion relay image ghcr.io/detain/phlix-hub uses <sha12> immutable short-sha tags (same recipe, swapping repository:detain/phlix-hub:pull); its own Helm chart documents the published :latest as frozen/stale, so pin a <sha12>. This doc-truth marker S483DOCTRUTHX9P2 records that the tag guidance on this page was re-derived from the live ghcr.io tags on 2026-09-11.
2. Prerequisites โ
Install Docker Engine (Ubuntu/Debian) โ
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker $USER
newgrp dockerInstall Docker Compose v2 (standalone binary โ optional) โ
The docker compose (space, plugin) form installed above is what this page uses. If you prefer the legacy docker-compose (hyphen) command name, the same v2 engine ships as a standalone binary:
sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.0/docker-compose-$(uname -s)-$(uname -m)" \
-o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version3. Quick-start (server-only) โ
The compose example and the .env template it references are two different files: the stack lives in docker/examples/server-only/, while the env template is shared one level up at docker/examples/.env.example (there is no .env.example inside server-only/). Download both:
mkdir -p ~/phlix && cd ~/phlix
curl -O https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/server-only/docker-compose.yml
curl -o .env https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/.env.example
chmod 600 .envThen edit .env โ four touches, and the fourth one is a trap worth naming. It will hold real credentials, so keep it at mode 600 and never commit it โ if you version this deploy directory with git, add .env to .gitignore first:
- Replace the
MYSQL_ROOT_PASSWORD=โฆline with a real value (openssl rand -hex 16). - Replace the
PHLIX_DB_PASSWORD=โฆline with a real value (openssl rand -hex 16). - Uncomment
#PHLIX_SERVER_IMAGE=and set the immutable pin (form and discovery recipe in ยง1):PHLIX_SERVER_IMAGE=ghcr.io/detain/phlix-server:<full-sha>-latest. - Delete (or fill) the
HUB_DB_PASSWORD=โฆline. It is another${VAR:?โฆ}self-gate meant for the server-hub / full-stack examples, but Compose interpolates every line of the env file it loads โ even variables your compose never references โ so leaving it gated failsdocker compose up(and evendocker compose config) before your stack ever starts.
docker compose up -dPHLIX_SECRET_KEY stays optional: unset, the container's entrypoint generates a strong JWT signing key on first boot and persists it to /var/phlix/config/jwt_secret, which lives on the phlix_config volume and so survives restarts and recreations. Set it yourself only if you want to manage the key externally (it also signs media URLs).
.env configuration reference โ
# Required by docker/examples/server-only/docker-compose.yml
PHLIX_SERVER_IMAGE=ghcr.io/detain/phlix-server:<full-sha>-latest # ยง1 pin recipe
MYSQL_ROOT_PASSWORD=<openssl rand -hex 16> # MySQL root password
PHLIX_DB_PASSWORD=<openssl rand -hex 16> # shared by the app AND MySQL
# Optional
#PHLIX_SECRET_KEY=<openssl rand -hex 32> # unset โ auto-generated, persisted on phlix_configWhat is deliberately not in this file:
PLEX_UID/PLEX_GIDdo not exist. Earlier revisions of this page listed them; they are a foreign product's namespace and nothing in phlix-server'sdocker/directory or image reads them. The container runs its daemons asnobodyand the named volumes are created by Docker, so there is no UID knob to set (see Volume permission errors for the real story on bind mounts).TZandPHLIX_LOG_LEVELare not interpolated by the server-only example. The compose hardcodesPHLIX_LOG_LEVEL=infoas a literal env line; to change the log level, edit that line indocker-compose.yml(PHLIX_LOG_LEVELis a real application variable โ see the env reference โ but only the value the container actually receives takes effect). Only the full-stack example passes aTZline, also hardcoded.- There is no
PHLIX_PORTvariable.PHLIX_HTTP_PORT/PHLIX_WS_PORT(plusPHLIX_HTTP_HOST,PHLIX_WS_HOST,PHLIX_HTTP_WORKER_COUNT) are real listen-port seams on current master (src/Server/Runtime/ListenEndpoints.php; unreleased as of v1.2.3 โ the<full-sha>pins built from master, ยง1, include them) โ an earlier revision of this page denied their existence, andreference/env-vars.mdcarries the corrected truth. The example compose does not pass them, so the container binds the defaults (8096/8097). If you do pass them into the container, the right-hand side of theports:mapping must match the port the container actually listens on.
4. Volume mounts โ
| Volume (as shipped) | Container path | Purpose |
|---|---|---|
phlix_config (named volume) | /var/phlix/config | Application config, persisted JWT key |
phlix_data (named volume) | /var/phlix/data | Media database, caches |
phlix_backups (named volume) | /var/phlix/backups | Automatic backups |
phlix_logs (named volume) | /var/phlix/logs | Log files |
media_library (named volume) | /media:ro | Media โ as shipped this is an EMPTY named volume, not a host folder |
mysql_data (named volume) | /var/lib/mysql | Database |
The shipped example mounts media from a named volume called media_library, so out of the box the server sees an empty library. To point it at a real host directory, replace the media_library:/media:ro entry under the phlix service's volumes: (the now-unused top-level media_library: declaration can stay or be removed):
volumes:
- /mnt/mediavault/movies:/media:roMake the host directory readable by the container's application user: the image's supervisord runs as root but the phlix daemons run as nobody, so world-readable (chmod -R a+rX /mnt/mediavault/movies) is what the scanner needs.
5. Hardware transcoding โ
NVIDIA GPU (nvidia image tag) โ
Install the NVIDIA Container Toolkit first (current official recipe โ keyring-based, since apt-key is removed on modern Ubuntu; the old nvidia.github.io/nvidia-docker/<dist>/โฆ repository path 404s):
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart dockerUse the nvidia image and add runtime to compose (pin the immutable <full-sha>-nvidia tag โ recipe in ยง1 โ so the pull is reproducible; the bare :nvidia is a mutable convenience tag that may be stale):
# <full-sha> = the 40-char commit sha, e.g. from the ยง1 tags/list recipe
image: ghcr.io/detain/phlix-server:<full-sha>-nvidia
# mutable alternative (moves with every build, may be stale):
# image: ghcr.io/detain/phlix-server:nvidia
# docker-compose.yml must include:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu, video]Intel Quick Sync (intel image tag) โ
Pin the immutable <full-sha>-intel tag (recipe in ยง1) for a reproducible pull:
# <full-sha> = the 40-char commit sha, e.g. from the ยง1 tags/list recipe
image: ghcr.io/detain/phlix-server:<full-sha>-intel
# mutable alternative (moves with every build, may be stale):
# image: ghcr.io/detain/phlix-server:intelNo special runtime needed, but the /dev/dri render node must reach the container โ with Compose v2 add a device mapping under the service:
devices:
- /dev/dri:/dev/dri6. Port reference โ
| Host (example default) | Container port | Protocol | Service |
|---|---|---|---|
127.0.0.1:32400 | 8096 | TCP | HTTP web interface (REST API, /app SPA, static assets, /health) |
127.0.0.1:8097 | 8097 | TCP | SyncPlay WebSocket |
| not published | โ | UDP 1900 | DLNA/SSDP discovery โ see note below |
8096 inside, 32400 outside โ and loopback-only by default
phlix-server's HTTP worker binds 8096 inside the container by default (server.port in config/server.php; overridable via PHLIX_HTTP_PORT, see ยง3). The server-only example publishes it as 127.0.0.1:32400:8096 โ deliberately bound to loopback, because Docker's published ports bypass host firewalls like ufw. That is why the URLs on this page use :32400 while the Linux/macOS/Windows install pages use :8096. To serve your LAN, change the left side โ drop the 127.0.0.1: prefix (everything on the 8097 mapping is plaintext WebSocket, appropriate only on a trusted LAN) or put a TLS-terminating reverse proxy in front (ยง7c's full-stack example). The right side stays 8096 unless you pass PHLIX_HTTP_PORT into the container yourself.
DLNA does not work in the bridge-network examples
The example stacks attach services to a Docker bridge network and publish no 1900/UDP mapping, so SSDP multicast discovery never reaches your LAN and the TV never sees the server. DLNA browsing in Docker needs host networking (network_mode: "host" on the server service โ at which point the 32400:8096 mapping is moot because the container binds the host's 8096 directly), or just don't run DLNA in Docker. There is no PHLIX_DLNA_PORT variable; the real switches are the dlna.enabled (SSDP advertiser) and dlna.cds_enabled (browse service, off by default because it serves the library unauthenticated) settings โ see DLNA.
# Verify ports are free before starting
sudo ss -tlnp | grep -E '32400|8097'7. Example stacks โ
Tip: All example stacks live under
docker/examples/in the repository. Each directory ships adocker-compose.ymlonly โ the env template is the shareddocker/examples/.env.exampleone level up (ยง3).
7a. Server-only (minimal) โ
Single phlix-server + MySQL container, loopback access only. See docker/examples/server-only/docker-compose.yml:
curl -O https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/server-only/docker-compose.yml7b. Server + Hub (remote access) โ
Adds phlix-hub relay service for remote access behind NAT. See docker/examples/server-hub/docker-compose.yml.
7c. Full-stack with Traefik (production) โ
Traefik reverse proxy handling HTTPS, WebSocket relay, and Let's Encrypt certificates:
mkdir -p ~/phlix/full-stack/traefik && cd ~/phlix/full-stack
curl -O https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/full-stack/docker-compose.yml
curl -O https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/full-stack/traefik/traefik.yml
curl -O https://raw.githubusercontent.com/detain/phlix-server/master/docker/examples/full-stack/traefik/dynamic.yml8. Verify the install โ
# Check containers are running (service names: phlix, mysql)
docker compose ps
# Check logs
docker compose logs -f phlix
# Test the health endpoint
curl -s http://127.0.0.1:32400/health
# Expected: {"status":"ok",...} with HTTP 200
# Access web portal โ the browser opens the login page; the first account becomes the admin (no wizard)
xdg-open http://127.0.0.1:32400 # macOS: openThe compose file's own header documents each listener (also visible with docker compose config): a plain HTTP GET to :8097 answers 400 โ that is the SyncPlay WebSocket worker being alive, not broken.
What Can Go Wrong โ
Docker not installed or wrong version โ
- Symptom:
docker: command not found, ordocker compose: 'compose' is not a docker command - Fix: Follow ยง2 above to install Docker Engine + the
docker-compose-plugin - Verify:
docker --version(min 20.10) anddocker compose version(min v2.0)
required variable โฆ is missing a value before anything starts โ
- Symptom:
docker compose up(or evenconfig) fails withrequired variable MYSQL_ROOT_PASSWORD is missing a value/PHLIX_SERVER_IMAGE must be set โฆ/required variable HUB_DB_PASSWORD is missing a value - Cause: the examples refuse to parse without real secrets and an explicit image pin โ loud over silently booting public placeholder passwords (see ยง3). The
HUB_DB_PASSWORDgate also fires when you use the shared.env.examplewith the server-only stack, because Compose interpolates every env-file line regardless of use. - Fix: fill the variables your stack needs; delete (or fill) the unused hub gate; set
PHLIX_SERVER_IMAGEto a ยง1 pinned tag.
Volume permission errors โ
- Symptom:
Permission deniedreading bind-mounted media files, or "cannot create file" errors in logs - Cause: your host directory isn't readable by the container's user โ the image runs its daemons as
nobody(there is noPUID/PLEX_UIDknob; earlier revisions of this page listed one, and it was never real) - Fix: make the media bind world-readable:
chmod -R a+rX /mnt/mediavault/movies. For writable paths (config/data/backups/logs), prefer the shipped named volumes โ they initialize from the image'snobody-owned/var/phlixtree. - Verify as the app user (
docker compose execitself lands as the container default, root โ not the user your media is read by):bashdocker compose exec phlix su -s /bin/sh nobody -c 'ls /media | head'
Port already in use โ
- Symptom:
bind(): Address already in useon127.0.0.1:32400or:8097 - Fix: Find and stop the conflicting process:
sudo ss -tlnp | grep 32400, then stop it. Or change the mapped port indocker-compose.yml:yamlOnly the host side of the mapping needs to change โ the container bindsports: - "127.0.0.1:32401:8096" # publish on host port 32401 instead of 324008096unless you passPHLIX_HTTP_PORT. - DLNA: the examples publish no host
1900mapping, so they cannot collide with your router/Plex there; DLNA simply does not discover over the bridge network (see ยง6's warning). To stop the SSDP advertiser itself, disable thedlna.enabledsetting (admin settings UI, orenabled => falseinconfig/dlna.php).
NVIDIA runtime not configured โ
- Symptom: Transcoding falls back to software encoding despite NVIDIA GPU present; logs show
GPU not available - Cause:
nvidia-container-toolkitnot installed, or thenvidiaruntime not registered with Docker - Fix: run the ยง5 install block, which ends with
sudo nvidia-ctk runtime configure --runtime=dockerand a Docker restart. (Manual equivalent:"default-runtime": "nvidia"plus theruntimesentry in/etc/docker/daemon.json.) - Verify:
docker run --rm --gpus all nvidia/cuda:12.4.1-base-ubuntu22.04 nvidia-smiโ should print GPU info
Next Steps โ
- First run โ create the first account (it becomes the administrator) at
http://your-server:32400 - Hardware transcoding โ configure NVENC/VAAPI/Quicksync for better transcoding performance
- Linux install โ alternative install method without containers