My Media Build logoMy Media Build

How to Install Library Doctor with Docker Compose (Plex, Jellyfin and Emby)

Install Library Doctor with Docker Compose in five steps: the compose file, a password, Plex or Jellyfin plus Radarr and Sonarr, and your first scan.

Time
About 10 minutes
Reading
9 min
Updated
4 December 2026
By
spikey1965
Tested with
Library Doctor 0.4.0
How to Install Library Doctor with Docker Compose

Follow this guide at your own risk, and back up your data first. Full disclaimer

Library Doctor is a free app that checks your Plex, Jellyfin or Emby library every night: missing files, duplicates, broken or wrong-language copies, stuck downloads and space hogs, with a button to fix most of them. Nothing is deleted without asking.

This guide installs Library Doctor with Docker Compose in five short steps. It works on any Linux server, TrueNAS, a Raspberry Pi or a NAS that runs Docker. It takes about 10 minutes.

On Unraid? You don’t need Compose: install it from Apps with the Unraid guide. On Synology? It works in Container Manager, but two Synology settings need changing first: follow the Synology guide. On a Windows PC? Follow the Windows guide for Docker Desktop.

Library Doctor in Docker: quick answer

To run Library Doctor with Docker Compose, save its compose file, start it with docker compose up -d, open http://YOUR-SERVER-IP:8790 and connect your Plex, Jellyfin or Emby server. It takes about 10 minutes.

Before you start A computer or NAS running Docker, your media folder, and your Plex, Jellyfin or Emby address and key (for Plex, its token). Radarr and Sonarr are recommended: without them it runs in report-only mode.
Docker image ghcr.io/spikey1965/library-doctor:latest
Web address http://YOUR-SERVER-IP:8790
Time About 10 minutes

Watch: install Library Doctor with Docker Compose

Watch it on YouTube

The video has subtitles and quiet background music. It was recorded with an earlier version (0.2.1); the steps are the same today.

What you need to install Library Doctor with Docker Compose

  • A computer or NAS running Docker. New to Docker? My Docker install guide covers it.
  • Plex, Jellyfin or Emby, and its address and key (for Plex, its token).
  • Radarr and Sonarr (recommended, not required): with them, Library Doctor can replace bad files and check much more. Without them it runs in report-only mode.
  • Your media folder, the one that holds your films and shows.

1Make your compose file

Make a folder, for example ~/library-doctor, and save this as compose.yaml inside it:

services:
  library-doctor:
    image: ghcr.io/spikey1965/library-doctor:latest
    container_name: library-doctor
    restart: unless-stopped
    ports:
      - "8790:8790"
    environment:
      - PUID=1000            # CHANGE: the user and group that own your media
      - PGID=1000
      - TZ=Europe/London     # CHANGE: your time zone
    volumes:
      - ./config:/config
      - /path/to/media:/media   # CHANGE: your media folder (read-write)
    read_only: true
    tmpfs:
      - /tmp
    security_opt:
      - no-new-privileges:true

Change the three lines marked CHANGE:

  • PUID and PGID: the user and group that own your media. To find them, run ls -ln /path/to/media and use the two numbers after the permissions (on Unraid it’s usually 99 and 100, on TrueNAS apps 568 and 568).
  • TZ: your time zone, so the nightly scan runs at 3am your time.
  • /path/to/media: the folder with your films and shows. Keep :/media on the right.

The media folder has to be read-write. Library Doctor never deletes anything by itself, but when you press a clean-up button it moves the file into its own trash folder on the same disk, so it’s instant and you can put it back.

The last four lines lock the container down: it can’t change its own files, and it can’t gain extra rights. Leave them in.

2Start it

In the same folder, run:

cd ~/library-doctor
docker compose up -d

After a few seconds it should say healthy:

docker compose ps

If it doesn’t, docker compose logs shows why. The first line should read Library Doctor listening on 0.0.0.0:8790.

3Open it and make a password

Open http://YOUR-SERVER-IP:8790 in a browser. The first page asks you to create a password. Do this straight away: until a password is set, anyone who can reach the page could set one, so don’t open the port to the internet before this step.

Library Doctor first page: Create a password, with two password boxes and a Create password button

Use at least 10 characters and keep it in your password manager.

4Connect your media server, Radarr and Sonarr

Library Doctor opens on Settings, with a “Start here” note at the top.

Library Doctor Settings on a fresh install: Start here note, Folder check, and the media server picker with Plex, Jellyfin and Emby
  1. Under Media server, pick Plex, Jellyfin or Emby. Type its address, for example http://192.168.1.10:32400 for Plex (use the IP address, not localhost), and its token or API key. For Plex, the How to find your Plex token link shows where it is. Got more than one media server? Add the others under More media servers.
  2. Under Radarr, Sonarr, Lidarr & Sportarr, add Radarr and Sonarr with their address and API key (in each app: Settings → General → API Key).
  3. Press Test all apps. Each app gets a green dot when it answers.
  4. Look at Folder check at the top. Each app may see your media under a different folder (Plex /data/movies, Radarr /movies, Library Doctor /media). Folder check asks each app for a few real files and finds them. If it can’t, it suggests the mapping to use, with a button.
  5. Press Save settings.
Library Doctor Settings with a made-up setup: Plex, Radarr and Sonarr on one line each with a green status dot, and the Folder check suggesting a mapping

Everything else under Optional apps (Bazarr, Tautulli, Tdarr, ClamAV, Prowlarr, download clients) can be added later.

5Run your first scan

Go to Scan Library and press Scan now. On my server a scan of about 7,500 films and episodes takes around 25 seconds. You then get one page with a library score, a tile for each check, and a card for each problem with the best fix, the risk and the space it saves.

The Library Doctor main screen with a made-up library: a health score, space saved, jobs left, one tile per check and the duplicates list

Nothing happens until you press a button. If something is actually fine, press Ignore and it stays quiet. From now on it scans by itself every night at 3am; you can change the time and days under Settings → General → Automatic scan.

Optional: get the nightly summary on your phone

Under Settings → Notifications, add Gotify, Discord, Telegram, ntfy, a webhook, Pushover or email. You get one message after each scan when something changed, with the library score, and nothing when nothing did.

Optional: behind a reverse proxy

If you open Library Doctor through Traefik, Nginx Proxy Manager or similar, add these to environment so it trusts your proxy and only answers to your own address:

      - LD_TRUSTED_PROXIES=172.16.0.0/12   # your proxy's address or range
      - LD_ALLOWED_HOSTS=ld.example.com    # the name you open it by

If Authentik, Authelia or your proxy already has a login in front of it, you can switch Library Doctor’s own login off with LD_AUTH=off. Only do that when something else really is in front: Library Doctor can move files.

New in v0.4.5 ✓ (4 December)

  • Clean-ups no longer leave an empty folder behind (Put Back makes it again)
  • With Jellyfin or Emby, the log names your media server instead of “Plex”

New in v0.4.4 ✓ (4 December)

  • Get the app: a new button at the top puts Library Doctor on your phone or computer, full screen with its own icon. How to put it on your phone
  • Fixed: cards you fixed while a scan was running no longer come back as “problems keep coming back”
  • Phones with several media servers show the Library Doctor icon in the top bar instead of a cut-off name

New in v0.4.1 ✓ (2 December)

  • Much faster scans: the virus and fake file check only opens videos that are new or changed since they were last found clean, so a nightly scan takes a minute or two instead of several. The first scan after updating still checks them all
  • That check counts up while it runs (“3,000 of 14,720”) instead of sitting still on the progress bar
  • “To look at” counts on the scan list and Analysis no longer include cards you’ve ignored
  • The page opens on a tile with work to do (missing files first, then damaged files and viruses)

New in v0.4.0 ✓ (28 November)

  • Several media servers at once: add a second (or third) Plex, Jellyfin or Emby under Settings → More media servers. Each gets its own cards, scan history, trash and health score, and All servers shows them side by side (asked for on GitHub)
  • An Ignore now counts on every server
  • Learns what you ignore: after 3 Ignores of the same kind in one library, it offers to hide cards like those. Nothing is hidden unless you say yes
  • Phone layout: the tabs sit along the bottom on a phone, and you can add Library Doctor to your home screen
  • Quality fallback: when Replace finds nothing in your preferred quality, it can try a lower one as a last resort (set for each Radarr/Sonarr)
  • Turn it off now works for indexers that come from Prowlarr
  • Jellyfin and Emby: widescreen films are measured properly, and blank posters get Use the show’s poster and Copy poster from Plex

Fixes in v0.4.0

  • Replace keeps the film or episode monitored, so Radarr/Sonarr keep looking, and the button says “Replacing…” so it isn’t pressed twice
  • Refresh Plex on “Plex lists a file that isn’t on the disk” cards
  • Safer Plex backups, and no more “keeps failing” card once an indexer works again

Updating is one command (below), and your settings are kept.

If something’s wrong

  • “Can’t save settings” or a permission error. PUID and PGID don’t match the owner of your folders, or the config folder belongs to someone else. Check with ls -ln. On Synology and TrueNAS, a folder’s permission list can also block it; Library Doctor shows a message saying exactly what to change.
  • Every file shows as missing. Library Doctor sees your media under a different folder from Plex or Radarr. Open Settings → Folder check and use the suggested mapping. A scan stops instead of reporting everything missing when it can’t find the files.
  • A Test button fails. Use the app’s IP address, not localhost: inside its container, “localhost” means Library Doctor itself. Check the port and the API key.
  • Clean-up buttons don’t work. The media folder is mounted read-only. Remove any :ro from the media line and run docker compose up -d again.
  • The page won’t open. Something else uses port 8790. Change the first number, for example "8791:8790".

Updating Library Doctor

cd ~/library-doctor
docker compose pull && docker compose up -d

Your password, settings and history live in the config folder, so they’re kept. What’s new in each version is in the changelog on GitHub.

📱 Put it on your phone: since 0.4.3, Library Doctor can be added to your phone or computer as an app, full screen with its own icon. Press Get the app at the top of the page, or follow How to put Library Doctor on your phone or computer.

Frequently asked questions

Is Library Doctor free?

Yes. Library Doctor is free and open source (MIT), and it runs on your own server. It's a beta that gets new checks most weeks.

Do I need Radarr and Sonarr?

No, but they're recommended. Without them Library Doctor runs in report-only mode with just Plex, Jellyfin or Emby. With them it can replace bad files, search for missing episodes and check much more.

Why does the media folder need to be read-write?

Clean-ups move files into Library Doctor's own trash folder on the same disk, so they're instant and can be put back. Nothing is moved until you press a button, and the trash only empties after a closer look.

Does it work on Windows?

Library Doctor runs in Docker. It supports Plex on Windows folder mappings since 0.3.1; a step-by-step Windows guide is on the way.

How do I update Library Doctor?

Run docker compose pull and then docker compose up -d in its folder. Your password, settings and history are in the config folder and are kept.

Thank you

Library Doctor is free and open source (MIT) at github.com/spikey1965/library-doctor. If you find a problem or have an idea, open an issue, and if it’s useful, a star helps other people find it. More about it, and a live demo, on librarydoctor.uk.

Questions or stuck? Ask in the Library Doctor Discord: setup help, ideas for new checks, and every new version posted the moment it’s out.

Related guides: Library Doctor (what it checks) · Install Docker · Gotify · Tracearr

Using it? Leave a review, it really helps.

Buy me a coffeeEverything here is freeEvery card, guide and download. This site keeps going thanks to people buying me a coffee. Without those donations, My Media Build wouldn’t be here. If something here saved you time or a headache, a coffee helps keep it running.☕ Buy me a coffee

Comments

No comments yet. Questions and tips are welcome.

Leave a comment

Comments appear once I've read them. See the privacy policy.

Get new guides by email

About one email a month: new guides and card releases. No spam, unsubscribe any time.

I'll send a confirmation email first. See the privacy policy.