Automate Your Media Library with Jellyfin and Sonarr
Running your own media server means you control what plays, when it plays, and where it’s stored. Jellyfin handles the playback side beautifully – it’s free, open-source, and runs on nearly anything with enough storage. But manually hunting down new TV episodes and dropping them into the right folders gets old fast. That’s where Sonarr changes the equation entirely.
Sonarr is an automated TV show manager that monitors RSS feeds from indexers, grabs new episodes as they release, and sends them to a download client of your choice. Hook it up to Jellyfin, and your media library updates itself while you watch the previous episode.
This guide assumes you already have Docker installed on your server or NAS. Everything here runs in containers, which keeps your system clean and the setup reproducible.

Setting Up Sonarr with Docker
Before writing any configuration, decide on your folder structure. Sonarr needs to read from a downloads directory and write to a TV shows directory that Jellyfin also reads from. Using separate volumes for each is a common mistake that causes Sonarr to copy files instead of hard-linking them – a process that doubles your disk usage temporarily and slows everything down. Put both directories under the same parent path from the start. A clean structure looks like this: /media/downloads for your download client output and /media/tv for your organized library.
Create a docker-compose.yml file and add the Sonarr service block. Use the official linuxserver/sonarr image, which is actively maintained and includes sensible defaults. Set PUID and PGID to match your current user (run id in your terminal to find these values). Map port 8989 to access the Sonarr web UI. Mount your config directory, your downloads path, and your TV path as volumes – and critically, mount all three paths using the exact same internal container paths you’ll later reference in Sonarr’s settings. Mismatched paths between your download client container and your Sonarr container is the single most common reason file moves fail silently.
Once the container is running, open Sonarr at http://your-server-ip:8989. Go to Settings – Media Management and enable Rename Episodes. Set a naming format that Jellyfin can parse well – the standard is {Series Title} – S{season:00}E{episode:00} – {Episode Title}. This keeps filenames consistent and allows Jellyfin to match metadata reliably without manual corrections later.

Connecting a Download Client and Indexers
Sonarr does not download anything on its own. It needs a download client – typically qBittorrent, Transmission, or NZBGet depending on whether you’re using torrents or Usenet. Run your preferred client as another Docker container in the same Compose file. In Sonarr, go to Settings – Download Clients, click the plus icon, and select your client. Enter the host (use the container name if both are on the same Docker network, not localhost), the port, and any credentials. Test the connection before saving. If Sonarr reports a connection error here, check that both containers are on the same Docker network in your Compose file – add a networks block and reference it in each service.
Next, add indexers under Settings – Indexers. Sonarr supports Torznab and Newznab protocols, which most modern indexers use. If you’re running Prowlarr – a separate indexer manager that syncs sources across all your *arr apps at once – you can connect it to Sonarr directly and manage everything from one place. That integration is worth setting up if you’re also running Radarr for movies, since you’ll configure indexers once instead of once per application. Add at least one working indexer, test it, and save before continuing.
With a download client and an indexer in place, add a TV show by clicking Add Series in the main menu. Search by title, select the correct entry, choose your root folder (/media/tv), set a quality profile, and decide whether Sonarr should monitor all existing seasons or only future episodes. Hit Add. Sonarr will immediately begin searching for missing episodes based on your monitoring settings. Watch the Activity tab to confirm downloads are queuing and completing correctly.
Pointing Jellyfin at Your TV Library
If Jellyfin isn’t already running, add it to your Docker Compose file using the jellyfin/jellyfin image. Map port 8096 for the web interface and mount your /media/tv directory as a volume using the same internal path. Hardware transcoding requires additional flags – for Intel QuickSync, add /dev/dri as a device; for NVIDIA, include the runtime: nvidia option and pass the right environment variables. If you’re not sure whether you need hardware transcoding yet, skip it for now. You can add it later without rebuilding anything.
Open Jellyfin at http://your-server-ip:8096 and run through the initial setup wizard. When prompted to add a media library, select Shows as the content type and point it to /media/tv. Jellyfin will scan the directory, match folder and file names against its metadata providers (primarily TheMovieDB and TheTVDB), and pull in artwork, episode descriptions, and ratings automatically. A well-named file from Sonarr requires no manual input here – Jellyfin reads the naming convention and does the rest.
To keep Jellyfin current without manual refreshes, go to Dashboard – Scheduled Tasks and make sure Scan Media Library runs on a schedule that fits your setup. Alternatively, Sonarr can trigger a Jellyfin library scan directly after each download using a connection. Under Settings – Connect in Sonarr, add a Jellyfin connection, enter your server address, and paste your Jellyfin API key (found in Jellyfin under Dashboard – API Keys). From that point forward, the moment Sonarr finishes organizing a new episode, Jellyfin updates without you touching anything. If you’re building out a broader self-hosted setup, pairing this with a unified home server dashboard like Homarr gives you a single panel to monitor all your running services at once.

The whole stack – Sonarr, your download client, and Jellyfin – lives in a single Compose file you can back up, version control, and redeploy on a new machine in under ten minutes. The one thing worth double-checking before walking away: open a completed episode in Jellyfin and verify it plays without buffering. If it does, your paths are correct, your permissions are set right, and the pipeline is solid. If Jellyfin shows a spinning loader and then fails, the file permissions on /media/tv almost certainly don’t match the PUID and PGID you set in your containers.





