A self-contained, single-binary web UI for MPD written around rust
229
A single-binary, self-contained web UI for Music Player Daemon (MPD). One Rust process serves the embedded frontend, a JSON API, and a live WebSocket status stream on a single port — and bridges to an existing MPD server over TCP. No build step, no external services, no runtime CDN or font lookups: all media, metadata, and album art come straight from your MPD server.
scratch: the image is the single ~5 MB binary and nothing else, running as a non-root userPoint it at an MPD server on the Docker host:
docker run -d \
--name mpd-wui \
-p 8080:8080 \
-e MPD_HOST=host.docker.internal \
-e MPD_PORT=6600 \
-e MPD_PASSWORD=secret \
--add-host host.docker.internal:host-gateway \
cthelight/mpd-wui
Then open http://localhost:8080.
Or with Docker Compose:
services:
mpd-wui:
image: <yourname>/mpd-wui
ports:
- "8080:8080"
environment:
MPD_HOST: host.docker.internal
MPD_PORT: 6600
MPD_PASSWORD: secret
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
| Variable | Default | Description |
|---|---|---|
MPD_HOST | 127.0.0.1 | Hostname or IP of the MPD server |
MPD_PORT | 6600 | MPD port |
MPD_PASSWORD | (empty) | Optional MPD password |
BIND_ADDR | 0.0.0.0 | Address for the web server to bind |
PORT | 8080 | Port for the web server |
CACHE_TTL | 300 | Library snapshot TTL (seconds) |
APP_TITLE | MPD: <host> | Display name (wordmark and tab title) |
RUST_LOG | info | Logging filter |
CACHE_TTL controls how often the in-process library snapshot used for search is rebuilt; a stale snapshot is served immediately and refreshed in the background. Album art is cached separately for one hour.
The web server performs no authentication of its own and binds 0.0.0.0 by default. Anyone who can reach the port can control playback and the queue, so restrict access with a firewall (or set BIND_ADDR=127.0.0.1 for local-only use) and rely on MPD_PASSWORD for the MPD bridge itself.
The container runs one statically linked release binary (musl — no base libraries or filesystem required) that embeds the entire frontend (vanilla HTML/CSS/JS). It connects out to your MPD server over TCP, so MPD and your music library never need to be exposed — only this container's single web port does.
Content type
Image
Digest
sha256:1012c888d…
Size
1.5 MB
Last updated
3 days ago
docker pull cthelight/mpd-wui