How to Install Sonarr in Docker

If you’re anything like me and love watching a few good TV shows, keeping up with new episodes can be a real headache, especially with the chaotic streaming landscape today. One week, your favorite show is on Netflix, and the next, it’s pulled for an exclusive run on yet another platform. Trying to keep track of what’s available where, remembering release dates, and manually downloading episodes can quickly feel like more work than it’s worth.

That’s where Sonarr comes in. Instead of hopping between streaming platforms or endlessly searching the web for downloads, Sonarr automates the entire process. It keeps track of your favorite TV shows, detects new episodes as soon as they’re available, and downloads them using your preferred method (torrent or Usenet). Once downloaded, it renames, organizes, and moves the files into your media library, ready to watch on Jellyfin, Plex, or Kodi. With Sonarr, your shows come to you—no more hunting them down.

Why Sonarr is a Game-Changer

Here’s why Sonarr is a must-have for any TV show enthusiast:

  • Automation – Say goodbye to manually searching for torrents or NZB files. Sonarr does it all for you.

  • Seamless Integration – Works perfectly with popular download clients like qBittorrent, Deluge, SABnzbd, and NZBGet.

  • Library Organization – Automatically renames and organizes downloaded episodes into neatly structured folders.

  • Custom Quality Control – Prefer 4K for some shows but okay with 1080p for others? Sonarr lets you set your preferred resolution and will even upgrade files if better versions become available.

  • Missing Episode Search – If an episode isn’t immediately available, Sonarr keeps searching until it finds a valid source.

Instead of juggling multiple websites and tools, Sonarr turns your TV show collection into a hands-off, fully automated system.


Why Run Sonarr in Docker?

Once you see how powerful Sonarr is, the next step is figuring out the best way to install it. While you could install it directly on your system, running Sonarr in Docker has some serious advantages:

  • Isolation – Keeps Sonarr and its dependencies separate from your main system, reducing conflicts.

  • Easy Updates – Updating Sonarr is as simple as pulling the latest Docker image.

  • Portability – Easily move your setup to a new machine without the hassle of reconfiguring everything.

  • Simplified Dependency Management – No more worrying about conflicting libraries or compatibility issues.

Running Sonarr in Docker keeps things clean, organized, and easy to manage, update, and troubleshoot. If you’re ready to take control of your TV show collection, setting up Sonarr in Docker is the way to go.


Step 1: Install Docker

To get started, you’ll need Docker. Check out this guide for step-by-step instructions: Master the Basics - How to Install Docker on Ubuntu 24.04.


Step 2: Create the Sonarr Docker Compose File

Let’s set up a docker-compose.yml file to define the Sonarr container.

Choose where you want to store Sonarr’s configuration files (I use a root folder named docker):

sudo mkdir -p /docker && cd /docker

Create the docker-compose.yml File

Use your favorite text editor:

nano docker-compose.yml

Then, paste the following content:

services:
  sonarr:
    # Official LinuxServer.io Sonarr image
    image: lscr.io/linuxserver/sonarr:latest
    # Sets a custom name for the container
    container_name: sonarr
    # Ensures the container restarts if it crashes
    restart: unless-stopped
    ports:
      # Maps Sonarr’s web UI to port 8989 on the host
      - "8989:8989"
    volumes:
      # Stores Sonarr's configuration data (change this path!)  
      - /path/to/config:/config
      # Directory where downloaded TV shows are stored  
      - /path/to/tvshows:/tv
      # Directory where incomplete downloads are stored  
      - /path/to/downloads:/downloads
    environment:
      # Ensures the container runs with the correct user ID (the main user)  
      - PUID=1000
      # Ensures the container runs with the correct group ID (the Media group)  
      - PGID=1001
      # Sets the timezone (change to match yours)  
      - TZ=America/Denver
    networks:
      # Connects the container to the custom media network  
      - media_network

networks:
  media_network:
    # Creates an isolated Docker network for media containers
    driver: bridge

Step 3: Customize the File

Update the following paths in the volumes section to match your system:

NOTE: Only change the path before the :. The path after the colon is internal to the container and should not be changed.

/path/to/config → Where Sonarr stores its settings.
Example:
/docker/sonarr:/config

/path/to/tvshows → Directory for completed TV show files.
Example:
/media/shows:/tv

/path/to/downloads → Folder where Sonarr monitors downloaded files.
Example:
/media/downloads:/downloads

TZ → Set your correct time zone. Check the list of: Valid Time Zones (Wikipedia).

💡 Pro Tip: Make sure your download client (like qBittorrent or SABnzbd) also has access to the /downloads folder for smooth integration.


Step 4: Start Sonarr

With everything set up, start the container:

docker compose up -d
  • The -d flag runs the container in the background (detached mode).
  • Sonarr should now be running.

Verify Sonarr is running:

docker ps

You should see sonarr in the list of running containers.

CONTAINER ID   IMAGE                               COMMAND   CREATED          STATUS          PORTS                                       NAMES
e49175ef37c5   lscr.io/linuxserver/sonarr:latest   "/init"   23 seconds ago   Up 22 seconds   0.0.0.0:8989->8989/tcp, :::8989->8989/tcp   sonarr

Step 5: Ensure Permissions Are Set Correctly

Folder permissions are one of the most common issues people run into when setting up the Arr suite in Docker. To avoid headaches, make sure your docker and media folders have the correct permissions set. Here’s what you need to do:

sudo chown -R `yourusername`:media /docker/ && sudo chmod -R 770 /docker/
sudo chown -R `yourusername`:media /media/ && sudo chmod -R 770 /media/

For more information on Linux permissions see this post: Master the Basics - Linux Permissions


Step 6: Access and Configure Sonarr

Open a web browser and visit:

http://your-server-ip:8989

From here, you can configure Sonarr to connect with your download client and set up your TV show library. For detailed guidance, check out the official Sonarr Wiki.


Step 7: Keeping Sonarr Updated

One of Docker’s biggest advantages is easy updates:

docker-compose pull  # Fetches the latest image
docker-compose down  # Stops and removes the running container
docker-compose up -d  # Starts a fresh container with the new image

This keeps you up to date with the latest features and security patches.


Conclusion

Sonarr is an essential tool for automating TV show downloads. It monitors, downloads, and organizes episodes effortlessly, turning your media library into a fully automated system.

By running Sonarr in Docker, you get all these benefits without cluttering your system. It’s straightforward to install, update, and manage—freeing up more time to enjoy your favorite shows instead of dealing with download hassles.

With Sonarr up and running, consider pairing it with other Arr suite members like Radarr for movies and Lidarr for music. You’ll be well on your way to the ultimate automated media setup.