Skip to content

Installation

joakimkingstrom edited this page Nov 23, 2026 · 7 revisions

Installation

Plekstender runs with Docker Compose. You need:

  • a machine that can run Docker (it can be the same one as Plex)
  • a Plex Media Server with a music library

Quick start

git clone https://github.com/joakimkingstrom/plekstender.git
cd plekstender
cp .env.example .env

Edit .env and fill in at least these three values:

Setting What to put
APP_URL The address people will open Plekstender at, e.g. https://plekstender.example.com or http://192.168.1.10:8080. Plex sends people back here after they sign in, so it must be exactly the address they use.
APP_SECRET_KEY A long random secret. Generate one with openssl rand -hex 32.
POSTGRES_PASSWORD A database password. Generate one with openssl rand -hex 24.

Then start it:

docker compose up -d --build

Open APP_URL in a browser and sign in with Plex. See Getting started for what comes next.

First sign-in: the setup code

Whoever signs in first becomes the admin. To make sure that's you, the sign-in page asks for a setup code until someone has signed in.

  1. Find the code in the web app's log. Run docker compose logs frontend, or open the frontend container's log in Komodo, Portainer or similar. It looks like this:

    Plekstender hasn't been set up yet. To become its admin, open https://…,
    sign in with Plex and enter this setup code when asked:
    
        K7QF-2MXA-9WRT
    
  2. Enter it on the sign-in page. Capitals and dashes don't matter.

A new code is made each time the app starts until the instance is claimed, and only the newest one works. Once someone has signed in, the code is gone and never asked for again.

To also limit the first sign-in to your own Plex account, set INITIAL_ADMIN to your Plex username or email.

What runs

Service What it does
db The PostgreSQL database.
db-init Updates the database when Plekstender is upgraded, then stops.
frontend The web app and its API, on port 8080.
worker Background work: syncing your library, recording plays, gig lookups, artwork jobs, scrobbling.
searxng Optional image search for artist logos and album covers. Start it with docker compose --profile search up -d.
traefik Optional HTTPS with Let's Encrypt. Start it with docker compose --profile traefik up -d.

Using the published image

Instead of building locally, you can run the image that's published for every change on main (amd64 and arm64). Add this to .env:

PLEKSTENDER_IMAGE=ghcr.io/joakimkingstrom/plekstender:latest
PLEKSTENDER_PULL_POLICY=always

PLEKSTENDER_PULL_POLICY=always matters. Without it, Compose builds the image from the checkout instead of pulling it.

Tags:

  • latest: the newest build, made after every change to main.
  • stable: the newest release, for updating less often. A release is a build picked out, with notes on what changed.
  • A version number, such as 0.1.212: one exact build, for pinning. The last part counts the commits, so a higher number is always newer (numbers can be skipped when several changes go out at once).
  • sha-<commit>: the same build, named by its commit.

Which version am I running?

Home → Status shows the version at the bottom, with a link to the commit it was built from. An image you built yourself shows its version ending in -dev.

When Plekstender is updated while a page is open (a browser tab or the installed app left running), a bar at the top says so and offers to Reload, so the page matches the server again.

Private images, Komodo and other tools

If the image is private, the machine needs to log in to ghcr.io before it can pull:

  1. Make a token. On GitHub: Settings → Developer settings → Personal access tokens → Tokens (classic). Give it only the read:packages scope. Fine-grained tokens don't work with ghcr.io.
  2. Use it. Either run docker login ghcr.io -u <your GitHub username> on the host and paste the token as the password, or add it as a registry account in your deployment tool. In Komodo, that's a Docker registry account for ghcr.io (Settings → Providers), chosen as the stack's registry account.

HTTPS

No reverse proxy yet? Use the bundled Traefik. In .env:

PLEKSTENDER_HOST=plekstender.example.com
TRAEFIK_ACME_EMAIL=you@example.com
APP_URL=https://plekstender.example.com

Also add these, so only Traefik can reach the app and Plekstender sees people's real addresses:

PLEKSTENDER_LISTEN=127.0.0.1:8080
FORWARDED_ALLOW_IPS=172.16.0.0/12

Then run docker compose --profile traefik up -d. Traefik listens on ports 80 and 443 and gets a certificate from Let's Encrypt. It only serves Plekstender, so it doesn't get access to the Docker socket: its one route is written into compose.yaml (traefik-routes). This needs Docker Compose 2.23 or newer.

Already running Traefik? Copy compose.override.example.yaml to compose.override.yaml and set your network, entrypoint and certificate resolver names in it. That file stops publishing port 8080 altogether, so there FORWARDED_ALLOW_IPS=* is safe.

Behind any other proxy:

  • Publish the app on localhost only, with PLEKSTENDER_LISTEN=127.0.0.1:8080, if the proxy runs on the same host. Otherwise make sure port 8080 can't be reached except through the proxy.
  • Set FORWARDED_ALLOW_IPS to the proxy's address or network (for a proxy in Docker, 172.16.0.0/12 covers Docker's usual networks), so Plekstender sees people's real addresses for its rate limits and logs.
  • Use * only when port 8080 can't be reached except through the proxy. With *, anyone who can reach 8080 directly could pretend to be any address.

Mounting your music folder (optional)

A few features work on your music files directly:

  • saving artist.jpg into each artist's folder
  • reading and editing tags
  • identifying files by sound
  • renaming files

For these, mount your music folder read-write into the worker only. The web app never touches music files. compose.override.example.yaml shows how. Then set it up under Settings → Music files (see Music files).

Updating

git pull
docker compose up -d --build      # or: docker compose pull && docker compose up -d

Database changes are applied automatically by db-init before the app starts.

Backups

Everything that matters is in two Docker volumes:

Volume What's in it
db The database: users, history, ratings, gigs, settings, and the encrypted Plex tokens and API keys.
data Downloaded fonts, uploads, previews, artwork exports and cached images. It can be rebuilt, but it's handy to keep.

A simple database backup:

docker compose exec db pg_dump -U plekstender plekstender | gzip > plekstender-$(date +%F).sql.gz

Keep .env safe too. Without the same APP_SECRET_KEY, the stored Plex tokens and API keys can't be read, and everyone has to sign in and set up their services again.

Clone this wiki locally