A web application to sync your Spotify playlists with Plex. Automatically match songs, download missing tracks, and keep your music library in perfect sync.
- Sync any Spotify playlist with Plex (including Spotify-owned playlists)
- Advanced track matching with multiple search strategies
- Download missing tracks via Lidarr or SLSKD, or export them as Tidal links for the companion Tidal downloader
- Multiple Spotify user support
- Scheduled automatic synchronization
- Smart caching for faster syncs
Important
The Spotify account you create your Spotify app with needs an active Premium subscription. This is a limitation Spotify added in 2026, together with a limit of one app per account and a maximum of 5 connected users. See the Spotify setup docs.
Tip
The recommended matching configuration is what actually improves match quality. Every build ships upstream's defaults, this one included, so nothing changes until you apply it.
docker run -d \
-e SPOTIFY_API_CLIENT_ID=YOUR_CLIENT_ID \
-e SPOTIFY_API_CLIENT_SECRET=YOUR_CLIENT_SECRET \
-e SPOTIFY_API_REDIRECT_URI=https://chodeus.github.io/spotify-to-plex/callback.html \
-e ENCRYPTION_KEY=YOUR_ENCRYPTION_KEY \
-v /your/config/path:/app/config:rw \
--network=host \
ghcr.io/chodeus/spotify-to-plex:testingAccess the web interface at http://[your-ip]:9030. This runs this fork's image; see Running it for the tag and PLEX_APP_ID.
The redirect URI is this fork's sign-in page. It shows what Spotify sends back as plain text, and it asks before passing the code to an address outside your network. If you set up with https://jjdenhertog.github.io/spotify-to-plex/callback.html, change the redirect URI in your Spotify app and in SPOTIFY_API_REDIRECT_URI to the one above: Spotify only accepts an exact match.
This fork is jjdenhertog/spotify-to-plex main (v1.0.111) plus fixes that are not upstream. Its image is built from the testing branch. Switching to the upstream image drops the fixes below, but your configuration carries over.
Matching
- A track the title search cannot place is matched by its ISRC. MusicBrainz lists the track id of every release the recording is on, and Plex shows that id on files carrying MusicBrainz tags, as Lidarr writes them. This finds "JCB" when your library calls it "JCB Song". A track is taken only when exactly one candidate carries a listed id.
- Version checks compare the original title, ignore credits and track numbers, treat a bare "version" as noise, apply in every search backend, and judge a candidate on the wanted track's credits. Cached links are re-checked against the version filter as well as duration.
- A missing track can be matched to a Plex track by hand from the missing-tracks list. Playlist and album syncs then use that track, and it leaves this app's own missing-track lists at once. Its Lidarr album entry goes only when no other listed track still needs it; Lidarr and slskd themselves are never touched.
Plex Home users
- A Spotify user can be given a Plex Home user (user settings, Plex user). Playlists for items added from that user's library or recently played are then made in that Home user's Plex account, by the sync and by the page's Create and Update. Users with a PIN can't be picked.
- Home Assistant (MQTT) leaves those playlists out, since it plays as the Plex owner who can't see them, and the page hides their Plex Web link for the same reason.
Lidarr and MusicBrainz
- An album Lidarr already holds in full is not searched again because one of its tracks is missing from Plex. That search only re-downloaded the same album as an "upgrade", every night.
- MusicBrainz requests are paced from one place and identify the app, and the name search for albums without a Spotify link works.
- Albums missing from MusicBrainz are listed with Harmony links to import them, and a new artist stays monitored along with every album a run sends for it.
slskd and Tidal
- slskd: each file's length reaches the match filter, so its duration rows apply; among copies of one recording the peer likely to deliver soonest is tried first, and the search timeout is honoured.
- Tidal: the access token is kept only for the seconds Tidal grants it.
Spotify
- Playlists are read from Spotify's tracks endpoint before the scraper, and every page is mapped the same way. A playlist that comes back short is not synced, so a bad read cannot empty a Plex playlist.
- Albums with more than 50 tracks load every track, and a Spotify token is refreshed five minutes before it expires.
Sync, web and container
- Saved items are appended instead of rewritten from a stale copy, the recently-played switch is honoured, and having nothing enrolled is a quiet no-op that clears the missing-track files.
- MQTT is skipped when no broker is configured,
TZreaches the scheduler, and the web app no longer sendsAccess-Control-Allow-Origin: *on every path. - One of each sync runs at a time, a job that ends early or fails still settles its status, and MQTT keeps Home Assistant's entities when Plex fails to answer.
- Node 22, Next.js 15, React 19 and MUI 9, and current pins for the scraper's Python packages.
Earlier fork work that is upstream now, merged or reimplemented by the maintainer:
| #128, #135 → #138 | duration and version as match filter fields — an 8:42 album cut can't be accepted for a 3:03 single, and duration alone can't separate two remixes of equal length |
| #130, #134, @bfayers' #113 | cached links are re-checked against duration so a wrong match stops being permanent, and you can match a track by hand |
| #129 | expands album search hits into their tracks; Plex's track index can miss tracks whose album it has indexed |
| #131 | falls back to single-track lookups when Spotify's batch endpoint returns 403 for development-mode apps |
| #132 | raises the API body limit so multi-thousand-track playlists stop returning HTTP 413 |
| #133 | matches cache writes by Spotify id instead of title/artist equality |
| #136 | search a playlist, and review tracks that matched more than one candidate |
| #139 | lets the new fields through match filter validation, so the configuration below can be saved |
| #140 | wires slskd-music-search into the build graph |
The Quick Start command runs ghcr.io/chodeus/spotify-to-plex:testing. :latest is the same image: it follows testing, and builds of other branches never move it. testing is upstream main with the fixes above. Every push to it publishes a new image, and a daily check rebuilds it when its OS packages fall behind.
The container starts as root and runs the app as PUID:PGID (default 99:100, Unraid's nobody:users). On start it hands any config files owned by someone else to that user, and it refuses to start, with a message, if the config directory is not writable by it. Set PUID/PGID to change the owner. PORT moves the web UI (default 9030).
PLEX_APP_ID is not required — the image already sets it, which is why it is absent from the Quick Start. It is the X-Plex-Client-Identifier this app presents to Plex, not a credential, and it is the same value for everyone running the image. Pass it explicitly only if you want your install to appear in Plex's authorised devices as its own client:
-e PLEX_APP_ID=$(head -c 32 /dev/urandom | base64) \Set it before your first login and keep it — changing it later invalidates the stored Plex token and you will have to sign in again.
Everything else — setup, Spotify app creation, Lidarr and slskd integration — is in the documentation.
This is the part that does the work. The app makes two new matching signals available; this configuration is what switches them on. Without it you are running the same matching as before, with the new capabilities sitting unused.
The shipped defaults are untouched, so nothing about your matching changes until you choose it.
Warning
The filters below use the duration and version fields. They exist on upstream main and in this image, but not in v1.0.107 or earlier. On an older build an unknown field makes the whole rule fail to parse and match nothing — every row silently stops matching and your playlists come out empty. Switch the filters back before downgrading.
Go to Settings → Music Search → Match Filters and replace the eight rows with these. This is the exact set running on my own library — ~1,000 tracks across 9 playlists:
[
"artist:match AND title:match AND duration:similarity>=0.65 AND version:match",
"artist:contains AND title:match AND duration:similarity>=0.65 AND version:match",
"artist:similarity>=0.85 AND title:similarity>=0.85 AND duration:similarity>=0.65 AND version:match",
"artist:match AND title:similarity>=0.8 AND duration:similarity>=0.65 AND version:match",
"artist:match AND title:contains AND duration:similarity>=0.65 AND version:match",
"artistWithTitle:similarity>=0.9 AND duration:similarity>=0.65 AND version:match",
"artist:contains AND title:contains AND album:contains AND duration:similarity>=0.65 AND version:match",
"artist:similarity>=0.7 AND album:match AND title:similarity>=0.85 AND duration:similarity>=0.65 AND version:match"
]Three things are going on:
duration:similarity>=0.65 on every row. An exact copy scores 0.99+, radio-vs-album variance lands around 0.8–0.9, and radio-vs-extended or an outright wrong recording falls below 0.65. It catches gross mismatches, not subtle ones.
version:match on every row. Duration cannot tell two remixes apart when they are the same length. This compares what the titles claim, ignoring featured-artist credits, years and the words in your Text Processing noise list — so (Original Mix) and (feat. X) are not treated as differences, but (Jauz remix) and - UK Edit are.
Row order matters. Filters are evaluated top-down and the first row returning anything sets the match, so the order decides which imperfect match is preferred. The one exception: a later row that finds the exact edit you asked for (same artist, title and version, length within 3%) replaces an earlier imperfect match, so a radio edit that only a title:contains row can see still beats the album cut an exact-title row found first. artist:match AND title:contains is demoted below the exact-title rows here, because otherwise a search for "Perfect (Exceeder)" happily settles for a track called "Exceeder".
The trade is deliberate: a wrong match is silent and permanent, a missing track flows to Lidarr or slskd and fixes itself once the file arrives. This configuration prefers the miss. Expect playlists to be a little smaller and to fill back in as downloads land. A track that is already in your library under a different title is usually found by the ISRC match instead of waiting on a download.
Text Processing and Search Approaches are left at their defaults.
For detailed setup instructions, configuration options, and integration guides:
If you appreciate my work, consider starring this repository or making a donation to support ongoing development. Your support means the world to me—thank you!
Are you a developer with some free time on your hands? It would be great if you can help me maintain and improve this project.
This project is open source and available under the MIT License.


