Automate Your Plex Library with Sonarr and Radarr
Sonarr and Radarr are media management tools that automate the process of finding, downloading, and organizing TV shows and movies for your Plex library. Instead of manually searching for content, downloading it, renaming it, and moving it to the right folder, Sonarr and Radarr handle all of that automatically. You add a show or movie, set your quality preferences, and the tools do the rest — including upgrading to better quality when it becomes available.
What each tool does
The automation stack has several components, each handling a specific task:
- Sonarr (TV shows): Monitors your TV show watchlist, searches for new episodes as they air, downloads them through your preferred download client, renames files to match Plex naming conventions, and moves them to your media directory. Sonarr tracks which episodes you have, which you are missing, and automatically fills gaps when content becomes available
- Radarr (movies): Does the same thing as Sonarr but for movies. Add a movie to your wanted list, set quality preferences, and Radarr finds it, downloads it, renames it, and organizes it. Radarr can also monitor for quality upgrades — if you have a 1080p copy and a 4K version becomes available, Radarr downloads the upgrade and replaces the old file
- Prowlarr (indexer manager): Manages your indexer connections (Usenet and torrent search providers) in one place. Instead of configuring the same indexers separately in both Sonarr and Radarr, Prowlarr syncs your indexer list to all connected apps. Add an indexer once in Prowlarr and it appears in both Sonarr and Radarr automatically
- Download client: The actual download happens through a separate application — qBittorrent, Transmission, or Deluge for torrents, or SABnzbd or NZBGet for Usenet. Sonarr and Radarr send download requests to the client and monitor progress. When the download completes, they handle the post-processing (rename, move, notify Plex)
Setting up the stack with Docker Compose
Docker Compose is the recommended way to run the automation stack because it keeps all services isolated and easy to manage:
- Directory structure: Create a base directory for your stack configuration. Each service gets its own subdirectory for persistent data:
/opt/media-stack/sonarr,/opt/media-stack/radarr,/opt/media-stack/prowlarr, and/opt/media-stack/downloads. Keep all config directories on the same filesystem as your media to enable hardlinks instead of copies - Compose file basics: Define each service in a single docker-compose.yml file. Use the official linuxserver.io images (linuxserver/sonarr, linuxserver/radarr, linuxserver/prowlarr) — they are well-maintained and include automatic update support. Set the PUID and PGID environment variables to match your media directory permissions so the containers can read and write files correctly
- Volume mounts: This is the most important configuration to get right. All services that need to access media files must share the same volume mount path. If Sonarr sees the download at
/data/downloads/completed/show.mkv, it must be able to move it to/data/media/tv/Show Name/Season 01/using a hardlink (instant, no disk space used for the copy). Mount a single parent directory like/datathat contains bothdownloadsandmediasubdirectories - Networking: Put all services on the same Docker network so they can communicate by container name. Sonarr connects to the download client at
http://qbittorrent:8080, Prowlarr connects to Sonarr athttp://sonarr:8989. Expose only the web UI ports you need on the host (Sonarr 8989, Radarr 7878, Prowlarr 9696)
Configuring Prowlarr
Set up Prowlarr first because it feeds indexers to Sonarr and Radarr:
- Access the UI: Open Prowlarr at
http://your-server:9696. Set up authentication on first launch — Prowlarr requires a username and password because it has access to your indexer credentials - Add indexers: Go to Indexers, Add Indexer. Prowlarr supports hundreds of indexers out of the box. Add the indexers you have accounts with. For each indexer, enter your API key or credentials. Test each one to verify the connection works
- Connect to Sonarr and Radarr: Go to Settings, Apps. Add Sonarr and Radarr as applications. Enter the Prowlarr server URL, the application's URL, and the API key (found in each application's Settings, General page). After syncing, all your Prowlarr indexers appear automatically in Sonarr and Radarr
- Sync profiles: Prowlarr can assign indexers to specific sync profiles. If certain indexers are better for TV content and others for movies, create separate profiles and assign them to the appropriate application
Configuring Sonarr
With indexers synced from Prowlarr, configure Sonarr for your TV library:
- Download client: Go to Settings, Download Clients. Add your download client (qBittorrent, SABnzbd, etc.). Enter the hostname (use the Docker container name if on the same network), port, and credentials. Test the connection. Enable "Remove completed downloads" to clean up after import
- Root folder: Go to Settings, Media Management. Add your TV root folder — this is where Sonarr places organized TV files. It should be the same path your Plex TV library points to, like
/data/media/tv - Quality profiles: Go to Settings, Profiles. Quality profiles define what resolutions and formats Sonarr accepts. The default profiles work for most users. Create a custom profile if you want specific behavior — for example, a profile that only downloads 1080p Bluray quality and upgrades to 4K when available
- Naming: Go to Settings, Media Management, Episode Naming. Enable "Rename Episodes" and configure the naming format to match Plex conventions:
{Series Title} - S{season:00}E{episode:00} - {Episode Title}. Consistent naming ensures Plex matches metadata correctly - Connect to Plex: Go to Settings, Connect. Add a Plex Media Server connection. Enter your server URL and Plex token. When Sonarr imports a new episode, it notifies Plex to scan the specific library, so new content appears immediately without waiting for a scheduled scan
Configuring Radarr
Radarr configuration mirrors Sonarr with movie-specific settings:
- Download client and root folder: Same process as Sonarr. Add your download client and set the movie root folder (like
/data/media/movies). If you use the same download client for both, the configuration is identical - Quality profiles: Radarr quality profiles determine which releases to grab. For movies, you typically want higher quality than for TV — a Bluray 1080p or 4K profile makes sense for movies where visual quality matters more. Set the upgrade threshold so Radarr replaces lower quality files when better ones become available
- Custom formats: Radarr supports custom format scoring — a powerful system that prioritizes releases based on specific attributes. For example, you can score remux releases higher than encodes, prefer releases with Dolby Atmos audio, or avoid releases with hardcoded subtitles. Custom formats give you fine-grained control over which specific release Radarr chooses from multiple options
- Movie naming: Set the naming format to
{Movie Title} ({Release Year})for the folder and{Movie Title} ({Release Year}) [{Quality Title}]for the file. This creates the folder structure Plex expects - Plex notification: Same as Sonarr — add a Plex connection so new movies appear immediately after import
Hardlinks and storage efficiency
Proper volume configuration enables hardlinks, which are critical for storage efficiency:
- What hardlinks do: A hardlink creates a second directory entry pointing to the same data on disk. When Sonarr imports a downloaded file, it creates a hardlink in the media directory instead of copying the file. The download client can seed the original file while Plex accesses the same data through the media directory — no duplicate storage used
- Requirements: Hardlinks only work when the source and destination are on the same filesystem. If your downloads directory is on one drive and your media directory is on another, hardlinks fail and Sonarr falls back to copying (which doubles storage usage). This is why the Docker volume mount strategy matters — mount a single parent directory that contains both
- Verify hardlinks are working: After importing a few items, check that the file in the media directory and the file in the downloads directory have the same inode number (
ls -ion Linux). Same inode means hardlink. Different inodes mean a copy was made — fix your volume mounts
Troubleshooting
- Permission denied errors: The most common issue. Ensure the PUID and PGID in your Docker containers match the owner of your media directories. Run
idon the host to find your user and group IDs. All containers in the stack should use the same PUID/PGID - Downloads stuck in queue: Check the download client connection in Sonarr/Radarr Settings. Verify the download client is accessible from inside the Docker network. If using container names as hostnames, ensure all containers are on the same Docker network
- Plex not seeing new content: Verify the Plex connection in Settings, Connect. Check that the path Sonarr/Radarr places files matches the path Plex has configured for the library. If Sonarr writes to
/data/media/tvinside its container but Plex sees the same directory as/mnt/media/tv, the notification works but Plex looks in the wrong place - Quality upgrades not happening: Check that upgrading is enabled in your quality profile and the upgrade threshold allows the upgrade you expect. Also check that Prowlarr indexers are returning results — some indexers have API limits that throttle searches