Skip to content

Repository files navigation

Plekstender

A Plex client and self-hosted companion app for your Plex & Plexamp music library: a player of its own, with radios, DJs and Plex's mixes; mix tapes and CDs to give someone as a link; fast rating; your listening history with stats; playlists with rules; new releases, requests and gigs; and tools for artwork, tags and lyrics. Several people can use one instance, each with their own Plex account.

Documentation, every feature, the services it uses, and the API reference: plekstender.com.

Plekstender isn't affiliated with or endorsed by Plex.

Warning

Plekstender is in active development, and things can change quickly, sometimes several versions in one day. Before you update, read the release notes, and take regular backups.

Play mode's home: recently played albums, Plex's mixes for you, your radios, the sidebar and the player bar

What it does

  • Play: Plekstender's own player. A home page of widgets, your library as tiles and a Tracks table, now playing with lyrics and karaoke, gapless fades, your own radio stations with DJs (Plekstender's and Plex's), Plex's mixes, casting, and keyboard shortcuts.
  • Mix tapes and CDs: record one for someone, with a note and a picture, and send it as a link they open in the browser.
  • Rate: swipe cards on a phone, fifteen at a time on a computer, or play Guess the intro. Ratings go to Plex.
  • History: every Plex play, plus Last.fm and ListenBrainz, with stats, a map, streaks, Rediscover and Rewind; scrobbling onwards.
  • Playlists with rules, saved to Plex, refreshing themselves; imports from files, Spotify and Tidal.
  • New music and gigs: releases from the artists you follow, what's missing, requests (with Lidarr), and gigs near you.
  • Artwork and music files: artist logos, album covers, tags, lyrics, renames and duplicates, all previewed and undoable.

All of it is described on the website.

Now playing, with synced lyrics Recording a mix tape
The Tracks page The station editor, with its DJs

All screenshots are from made-up music (npm run screenshots in frontend/).

Running with Docker

cp .env.example .env
# Fill in APP_URL, APP_SECRET_KEY and POSTGRES_PASSWORD (see comments in the file)
docker compose up -d

Open APP_URL and sign in with Plex. The first account to sign in becomes the instance admin. To make sure that's you, it has to enter the setup code the web app writes to its log while nobody has signed in (docker compose logs frontend; a new code at each start until the instance is claimed). INITIAL_ADMIN can also limit it to your Plex username or email. Then connect a Plex server and choose its music library.

Services:

Service What it does
db Postgres 18
db-init Applies database migrations, then exits
frontend The web app and its API (port 8080)
worker Background jobs
searxng Optional (--profile search): image search for artist logos, internal only
traefik Optional (--profile traefik): HTTPS reverse proxy with Let's Encrypt
tailscale Optional (--profile tailscale): Plekstender on your tailnet over HTTPS, and on the internet with Funnel

The optional ones start with --profile <name> (search, traefik, tailscale). To have a plain docker compose up -d start them too, list them in .env:

COMPOSE_PROFILES=tailscale,traefik

Already running Traefik? Copy compose.override.example.yaml to compose.override.yaml and adjust.

The image

Compose runs the published image, ghcr.io/joakimkingstrom/plekstender:latest (amd64 and arm64). It's published after each successful CI run on main (latest, sha-<commit>, and version tags), and stable follows releases. Pushes to staging that pass CI are published as staging (and staging-<commit>), for trying changes before they reach main. To run another tag, or your own build (docker build -t plekstender:local .), set PLEKSTENDER_IMAGE in .env:

PLEKSTENDER_IMAGE=ghcr.io/joakimkingstrom/plekstender:staging

docker compose pull && docker compose up -d updates it.

On a phone

Open your Plekstender address in Safari and choose Share → Add to Home Screen (Chrome: ⋮ → Add to Home screen). Opened from its icon, it runs full screen like an app and starts on the Rate page (Settings → Appearance changes that).

Optional services

Plekstender needs only Plex. Last.fm, ListenBrainz, fanart.tv, Tidal, Spotify, AcoustID, JamBase, Ticketmaster, setlist.fm, Data Thistle, Unsplash, Lidarr, SearXNG and Tailscale are each optional: their keys go in Settings → Services or .env (see the comments in .env.example). What each is for, what it needs and what's sent to it is on the website: Services it uses.

To read and edit your music files' tags, find lyrics, or save artist.jpg next to your music, set MUSIC_MOUNT in .env to your music folder: it's mounted read-write in the worker container only.

Backups

Back up regularly, and before every update:

  • The database (ratings, history, playlists, settings): with the stack running,

    docker compose exec -T db sh -c 'pg_dump -U "$POSTGRES_USER" -Fc "$POSTGRES_DB"' > plekstender.dump

    To restore it, stop the app (docker compose stop frontend worker), then run docker compose exec -T db sh -c 'pg_restore -U "$POSTGRES_USER" -d "$POSTGRES_DB" --clean --if-exists' < plekstender.dump and start it again.

  • The data volume (fonts, uploads, logo packs, previews, video covers), for example:

    docker run --rm -v plekstender_data:/data:ro -v "$PWD":/backup alpine tar czf /backup/plekstender-data.tgz -C /data .
  • Your music files, if you've allowed Plekstender to change them (Settings → Music files → Folder scan). Every change can be undone from Tag history, but that isn't a backup.

Who can sign in

On Settings → Admin, choose one of:

  • Approved servers (default): people with access to a Plex server you've approved, such as friends you share your server with.
  • Allowlist: only the Plex usernames or emails you list.
  • Open: any Plex account.

Plex tokens are stored encrypted with a key derived from APP_SECRET_KEY and are never sent to the browser.

Development

Requirements: Python 3.14+ with uv, Node 24+, and a Postgres database.

# Backend (http://localhost:8080)
cd backend
uv sync
export APP_SECRET_KEY=$(openssl rand -hex 32) APP_URL=http://localhost:5173 \
       DATABASE_URL=postgresql://plekstender:plekstender@localhost:5432/plekstender
uv run plekstender migrate
uv run plekstender web          # API
uv run plekstender worker       # background jobs (separate terminal)

# Frontend (http://localhost:5173, proxies /api to the backend)
cd frontend
npm install
npm run dev

Checks:

cd backend && uv run ruff check . && uv run mypy && \
  TEST_DATABASE_URL=postgresql://…/plekstender_test uv run pytest   # wipes that database
  # (quicker: add -n auto; each worker then makes and wipes a database of its own, …_test_gw0 and so on)
cd frontend && npm run lint && npm run typecheck && npm test

After changing API routes or schemas, regenerate the frontend types with npm run gen:api. New database migrations: cd backend && uv run alembic revision --autogenerate -m "…".

More for developers in docs/: architecture, how the features work and ideas.

Screenshots (for the website and this README) come from the app with its API mocked: made-up music and drawn covers, never a real library. cd frontend && npm run screenshots takes them into frontend/screenshots-out/ (it needs Chrome; set CHROME to its path elsewhere than macOS). The mocks are in frontend/scripts/screenshots/mocks.tsx.

A pull request that changes a feature comes with one to plekstender-website for its docs.

Versions and releases

Every image built from main gets the next version number (0.2.<commits>), shown on Settings → About. Each release has the API's openapi.json attached; the website's API reference is drawn from it.

Credits

  • Plex for making the most awesome music server on earth. Extra credit to Elan Feingold for the best music player ever - Plexamp.
  • IP geolocation by DB-IP (IP to City Lite, CC BY 4.0), downloaded monthly to the server; lookups never leave it.
  • Country shapes from Natural Earth (public domain); rebuild with frontend/scripts/world-map.mjs.
  • Artist logos from fanart.tv, artist IDs and releases from MusicBrainz (CC0), release covers from the Cover Art Archive, fingerprints by Chromaprint and matched by AcoustID, fonts from Google Fonts. Images keep their own terms; logo packs record where each one came from.

Licence

MIT

Releases

Packages

Used by

Contributors

Languages