DiyMediaServer
Featured image of post Sonarr Docker Compose Setup Guide (2026)

Sonarr Docker Compose Setup Guide (2026)

Sonarr Docker Compose setup — port 8989, working compose file, volume mapping, and connecting to Prowlarr and SABnzbd for automated TV downloads.

💡
Tip: Default port: Sonarr runs on port 8989. Access the web UI at http://your-server-ip:8989 once the container is running.

If you’re anything like me and love watching a few good TV shows, keeping up with new episodes is a headache. The streaming landscape is chaotic. One week your favorite show is on Netflix, the next it’s pulled for an exclusive run on yet another platform. Tracking what’s available where, remembering release dates, and manually grabbing episodes turns into more work than the shows are worth.

That’s where Sonarr comes in. Instead of hopping between streaming platforms or hunting for downloads, Sonarr automates the whole pipeline. It watches your shows, spots new episodes the moment they’re available, and pulls them via your preferred method (torrent or Usenet). Once a file lands, Sonarr renames it, files it into your library, and makes it ready to watch on Jellyfin, Plex, or Kodi. Your shows come to you.

Why Sonarr Earns Its Spot in the Stack

Here’s what Sonarr actually does for you:

  • Automation. No more manually searching for torrents or NZB files. Sonarr does it for you.
  • Download client integration. Works with qBittorrent, Deluge, SABnzbd, and NZBGet out of the box.
  • Library organization. Renames and sorts downloaded episodes into clean folder structures your media server can read.
  • Quality control. Want 4K for some shows and 1080p for others? Set the rules per show. Sonarr will even upgrade a file later if a better version shows up.
  • Missing episode search. If an episode isn’t out yet, Sonarr keeps looking until it finds a valid source.

You stop juggling websites and tools. Sonarr turns your TV collection into a hands-off pipeline.

Why Run Sonarr in Docker?

You could install Sonarr directly on the host. But running it in Docker pays off:

  • Isolation. Sonarr and its dependencies live in their own container, separate from the host OS.
  • Easy updates. docker compose pull and you’re on the latest build.
  • Portability. Move the whole setup to a new machine by copying the compose file and the config volume.
  • No dependency hell. No conflicting mono versions or library mismatches to chase.

If you want to take control of your TV library, Sonarr in Docker is the way to go.

Step 1: Install Docker

You need Docker first. If you don’t already have it, follow this guide: Master the Basics - How to Install Docker

Step 2: Create the Sonarr Docker Compose File

Now set up a docker-compose.yml file to define the Sonarr container.

Pick a Folder

Decide where you want to keep Sonarr’s compose file. I use a root folder named docker:

sudo mkdir -p /docker && cd /docker

Create the docker-compose.yml File

Open it in your favorite editor:

nano /docker/docker-compose.yml

Paste this in:

services:

  #################################
  ##  SONARR                     ##
  #################################
  sonarr:
    # Official LinuxServer.io Sonarr image
    image: lscr.io/linuxserver/sonarr:latest
    # Sets a custom name for the container
    container_name: sonarr
    # Name and location of the .env file
    env_file: .env
    # Ensures the container restarts if it crashes
    restart: unless-stopped
    ports:
      - ${SONARR_PORT}:8989
    volumes:
      # Stores Sonarr's configuration data 
      - ${CONFIG_PATH}/sonarr:/config
      # Directory where downloaded TV shows are stored  
      - ${MEDIA_PATH}/Shows:/tv
      # Directory where incomplete downloads are stored  
      - ${DOWNLOADS_PATH}:/downloads
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - UMASK=0007
      - TZ=${TZ}
    networks:
      # Connects the container to the custom media network  
      - media_network

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

Step 3: Customize the .env File

Open the .env File

nano /docker/.env

The content should look like this:

# User and Group ID (Prevents permission issues)
# Main user ID
PUID=1000
# Our media group:
PGID=1001

# Timezone (Ensures correct scheduling and logs)
TZ=America/Denver

# Define Ports (Ports for each container are defined here)
# Maps Sonarr’s web UI to port 8989 on the host
SONARR_PORT=8989

# Data Directories (Keeps storage paths centralized)
CONFIG_PATH=/docker
DOWNLOADS_PATH=/media/downloads
MEDIA_PATH=/media

Update the paths to match your setup. Here’s what each one does:

  • CONFIG_PATH=/docker is the root folder where Docker stores persistent files.
  • MEDIA_PATH=/media is the root folder for your media files.
  • DOWNLOADS_PATH=/media/downloads is the root folder where your download client drops temp and incomplete files.

Make sure the download client container shares access to the /downloads path. If it doesn’t, Sonarr can’t see the finished files and the whole pipeline breaks at the import step.

Also set the timezone (TZ) to match yours. Pull the right string from this list of valid timezones.

💡 Pro Tip: Your download client (qBittorrent, SABnzbd, whatever) needs the same /downloads mount Sonarr uses. Same path, same UID/GID. Skip this and Sonarr will see a “download not found” error every time.

Step 4: Start Sonarr

With everything in place, fire up the container:

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

Verify it:

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 the single most common reason the Arr suite blows up inside Docker. Save yourself the pain. Fix the permissions on your docker and media folders before you touch the UI:

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

For more on Linux permissions, read this: Master the Basics - Linux Permissions

Step 6: Access and Configure Sonarr

Open a browser and go to:

http://your-server-ip:8989

From here you’ll wire Sonarr up to your download client and your indexers, and point it at your TV library folder. For the full configuration walkthrough, the official Sonarr Wiki is the source of truth.

Step 7: Keeping Sonarr Updated

One of Docker’s biggest wins is painless 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

Run that every month or so. You’ll stay on top of features and security patches without ever opening Sonarr’s UI.

Conclusion

Sonarr handles the boring parts of running a TV library. It watches, downloads, renames, and files episodes so you don’t have to. In Docker, you get all that without polluting the host OS, and updating it is three commands.

Next, point Sonarr at an indexer (NZBGeek, Drunkenslug, or your tracker of choice) and a download client. Once shows start flowing in, add Radarr for movies and Lidarr for music. Same compose file, same .env, same network. That’s how the Arr stack snowballs into a full media automation rig.