Install
Disk space
Section titled “Disk space”plyrix reads lyrics from a local LRCLIB server loaded with LRCLIB’s database dump, and the dump is large. Check the space before any step:
| What | Size |
|---|---|
| The dump download | 49.3 GB, compressed |
| A first load, at its peak | 319.8 GB apparent, as the download is kept until LRCLIB is ready and LRCLIB builds its search index on first start. On ZFS with lz4 compression and recordsize=128K that peak took 129.6 GB on disk. |
| Loaded, without the kept download | About 80 GB on disk, on the same ZFS pool |
| Docker build space, for building both images | Measured 2026-11-11: the plyrix image is 246 MB and the LRCLIB image 44 MB as docker images reports them, or 89.1 MB and 12.5 MB as Docker 29’s content sizes. Building LRCLIB’s Rust image also fills Docker’s build cache. All of it is in Docker’s own storage. |
Measured 2026-11-11 on one clean install from this README, with the LRCLIB dump of 2026-10-30, tested on ZFS on Linux only. LRCLIB’s /api/search answers only once its search index is ready, while /api/get answers at once.
LRCLIB
Section titled “LRCLIB”plyrix needs a local LRCLIB loaded with the official dump, and never bundles or mirrors the dump. The lyrics come from LRCLIB and its contributors.
The steps below run from a checkout of this repo: git clone https://github.com/patrickclery/plyrix.git, then cd plyrix.
- Pick a folder for LRCLIB’s data on a disk with room, and make it as the user that will own it, for example
mkdir /srv/lrclib. - Build LRCLIB at the pinned upstream commit
e1d863afc430392c8b2f97bea72139292d498432. This builds from source and pulls no LRCLIB image. - Open https://lrclib.net/db-dumps in a browser and copy the newest file name. The page needs JavaScript, so the script can’t look it up. Without a browser, the JSON listing that page reads holds the same names;
scripts/lrclib-update.shnames it as its defaultLRCLIB_DUMP_LISTING. Its host may change, so the page stays the reference. - Run
scripts/lrclib-setup.shwith that name. It checks the folder and its free space withplyrix doctor --lrclib-datafirst, then downloads, checks and loads the dump, starts LRCLIB and waits until its search index is ready, which can take hours. - When plyrix is configured, setup records the loaded dump in plyrix’s state, and runs use it with no setting. Otherwise run
plyrix lrclib-record NAME --status liveonce plyrix is configured, and until then setdump_idto that name, withPLYRIX_DUMP_IDor in the config file. A dump recorded live wins over adump_idset withPLYRIX_DUMP_IDor in the config file, so an update’s new dump is used even withdump_idstill set, and the run warns once that it ignored it. Only--dump-idon the command line overrides the live record, for one run. To keep the dump current from then on, see Keeping LRCLIB current.
export LRCLIB_DATA=/srv/lrclibMUSIC_ROOT=/nonexistent STATE_DIR=/nonexistent docker compose build lrclibPLYRIX="uv run plyrix" scripts/lrclib-setup.sh lrclib-db-dump-20260101T000000Z.sqlite3.gzRun these from the checkout. Compose checks every service’s variables for any command, and only plyrix’s own container uses MUSIC_ROOT and STATE_DIR, so placeholders do for building LRCLIB. The script supplies the same placeholders when it builds, stops and starts LRCLIB, and checks that compose can read the file before it downloads anything. It runs docker compose build lrclib before the download, which is quick once the image exists, and starts LRCLIB after the swap with --no-build, so that start can’t fail on reaching GitHub with the new database in place. If LRCLIB doesn’t start, the script says so and prints the command to start it. LRCLIB then answers at http://localhost:3300/api on this host only. Only the first start builds the search index; after a stop and restart LRCLIB reuses it, and search answered again within a minute on the clean install. A download that breaks part way, on a dropped connection, a stream error, a timeout or a server error, is retried with a growing wait and resumes from the bytes already on disk; by default the script gives up after 10 attempts in a row that add nothing (LRCLIB_DOWNLOAD_RETRIES, with LRCLIB_RETRY_SECONDS for the first wait). A partial download is never deleted: one that can’t be finished is kept, and running the script again resumes it. If the server answers a fresh range request with the whole file, it can’t resume, so the script stops, keeps the partial and prints the command to delete it and start from zero. A finished download must match the server’s size and pass gzip -t; one that is full size but corrupt is deleted, and nothing that fails a check ever replaces a working database. The script keeps the download and prints how to delete it.
| Variable | Meaning | Default |
|---|---|---|
LRCLIB_DATA |
LRCLIB’s data folder, mounted at /data |
required |
LRCLIB_USER |
uid:gid LRCLIB runs as, which should own LRCLIB_DATA |
1000:1000 |
LRCLIB_PORT |
The loopback port LRCLIB is published on | 3300 |
PLYRIX |
The command the script runs doctor with | plyrix |
LRCLIB_READY_TIMEOUT |
Seconds the script waits for the search index | 43200 |
LRCLIB_POLL_SECONDS |
Seconds between its checks | 30 |
LRCLIB_DUMP_BASE |
Where the dump is fetched from, for tests | https://db-dumps.lrclib.net |
Package
Section titled “Package”Install the released package from PyPI:
uv tool install plyrixpipx install plyrix works as well. Neither installs uv or pipx; see uv’s install docs at https://docs.astral.sh/uv/getting-started/installation/. The clean-machine test covered the container path only, not this one. To build the package from a checkout instead, and install the file:
uv builduv tool install dist/plyrix-0.1.0-py3-none-any.whlpipx install dist/plyrix-0.1.0-py3-none-any.whl works as well. LRCLIB still runs separately, as above.
To run it on a schedule, copy the two example units from examples/systemd/ to ~/.config/systemd/user/, and enable the timer:
cp examples/systemd/plyrix.service examples/systemd/plyrix.timer ~/.config/systemd/user/systemctl --user daemon-reloadsystemctl --user enable --now plyrix.timerThe service runs plyrix run at idle IO priority, then plyrix plex-refresh after every run, successful or not. The timer runs it weekly, Mondays at 03:00, and catches up at the next boot after a missed run. Settings come from plyrix’s config file or PLYRIX_ variables. For the Plex token, a system unit can pass a file with LoadCredential=plyrix_plex_token:PATH, which plyrix reads from systemd’s credentials directory. Otherwise the token comes from PLYRIX_PLEX_TOKEN or the config file, kept private with chmod 600.
Container
Section titled “Container”Install Docker with Docker’s own steps, https://docs.docker.com/engine/install/, and run these commands as a user in the docker group, or with rootless Docker.
The released plyrix image is ghcr.io/patrickclery/plyrix:0.1.0, for linux/amd64 and linux/arm64. To run it instead of building one, add the release override to each compose command below: docker compose -f compose.yaml -f examples/compose.release.yaml. Without it, compose builds the plyrix image locally from this checkout. LRCLIB’s image is always built locally from the pinned commit and published nowhere. Building needs room in Docker’s own storage, see Disk space. compose.yaml runs plyrix beside the pinned LRCLIB, and reads these variables:
| Variable | Meaning | Default |
|---|---|---|
MUSIC_ROOT |
The library’s real absolute path, with no symlink in it. plyrix records real paths, so the container sees the library at the same path as the host. | required |
STATE_DIR |
plyrix’s state folder. Make it first, owned by the container’s user. | required |
LRCLIB_DATA |
LRCLIB’s data folder, as above. plyrix sees it read-only, so doctor can check its disk. |
required |
CONTAINER_USER |
uid:gid plyrix runs as. Use a STATE_DIR that uid owns. |
1000:1000 |
CRON_SCHEDULE |
When cron mode runs, as a cron expression | @weekly |
PLEX_TOKEN_FILE |
The file holding the Plex token | ./secrets/plyrix_plex_token |
The library must already exist at MUSIC_ROOT, writable by uid 1000, or by the uid in CONTAINER_USER, as plyrix writes sidecars beside the tracks; the commands below make the state, config and secrets folders, not the library. Put plyrix’s settings, such as the Plex URL and section, in config/plyrix/config.toml in the checkout. Put the Plex token in secrets/plyrix_plex_token, or point PLEX_TOKEN_FILE at another file. Leave the file empty when not using Plex, as an empty token counts as unset. Compose mounts that file as it is on the host, so it must be readable by uid 1000, or by the uid in CONTAINER_USER, for example owned by that uid with mode 0400. The library is mounted writable, because sidecars sit beside the tracks. The code that reads audio cannot write, and the only writer creates .lrc and .txt files; the write tripwire guards the mount.
export MUSIC_ROOT=/srv/music STATE_DIR=/srv/plyrix-state LRCLIB_DATA=/srv/lrclibmkdir -p "$STATE_DIR" config/plyrix secretstouch secrets/plyrix_plex_token && chmod 0400 secrets/plyrix_plex_tokendocker compose buildPLYRIX="docker compose -f $PWD/compose.yaml run --rm --no-deps plyrix" \ scripts/lrclib-setup.sh lrclib-db-dump-20260101T000000Z.sqlite3.gzdocker compose run --rm plyrix doctordocker compose run --rm plyrix rundocker compose up -dThe setup script runs doctor through compose with --no-deps, so doctor neither starts LRCLIB nor waits for it to be healthy, which can take hours while LRCLIB builds its search index. Started on an empty folder, LRCLIB makes an empty database and reports healthy, and doctor then reports that database as empty and exits 1. $PWD/compose.yaml stands for this checkout’s absolute path, so the command works from any folder. docker compose run --rm plyrix run runs once. Because both services set pull_policy: build, every up and run rebuilds the images, and LRCLIB’s build fetches its pinned source from GitHub; docker compose up -d --no-build starts the images already built without that. The rebuild’s progress prints before plyrix’s own lines on docker compose run. docker compose up -d starts cron mode, which runs plyrix run and then plyrix plex-refresh on CRON_SCHEDULE, at idle IO priority where the filesystem honours it. In cron mode, the scheduler’s “job succeeded” or “job failed” line reflects only plex-refresh, the last command, so read the run’s counts lines in the container’s log, or its report_file, for the run’s own result. Cron mode logs “process reaping disabled, not pid 1” at start, which is harmless: tini is pid 1 and reaps. Through compose, doctor’s --lrclib-data check says the folder can’t be written from here, because plyrix sees LRCLIB’s data read-only; that line is expected. The LRCLIB update script runs on the host, not in this cron, as it stops and starts LRCLIB; see Keeping LRCLIB current.
The lyrics come from LRCLIB and its contributors. LRCLIBis MIT licensed; plyrix never bundles or mirrors the dump.
plyrix is an independent project, not affiliated with or endorsed by Plex, Inc.