Automagically Download Movies and TV Shows with Docker

Tired of waiting for someone to rip your favourite TV show so you can download it (illegally!) and binge? Do you even know when it will be available in some decent, “watchable” quality?

What if I told you that you can automate the entire process and even get notified once it’s available, downloaded and ready to watch?

Using Docker, we will be setting up a few containers to do just that!

But before we go any further….

…Note that we do not endorse pirating content. All artists need to make a living.
The content that follows is for educational purposes only.

With that out of the way, let’s get cooking. We will be building a bunch of containers to get the job done:

ServiceContainer NameDescription
ProwlarrprowlarrProwlarr is an indexer manager/proxy built on the popular *arr .net/reactjs base stack to integrate with your various PVR apps
RadarrradarrRadarr is a free and open-source movie collection manager. It is actually a fork of Sonarr but for movies
SonarrsonarrSonarr automates your TV downloads from public and private trackers
Transmissiontransmission2Transmission is a BitTorrent client which features a variety of user interfaces on top of a cross-platform back-end
EmbyembyEmby (formerly Media Browser) is a media server designed to organize, play, and stream audio and video to a variety of devices

In essence, Prowlarr is our master indexer, providing sources for TV shows and Movies.
TV shows are downloaded thanks to Sonarr, and Movies thanks to Radarr.
Our download client will be Transmission and we will be using Emby to watch our content.

Initial Setup

Under your home directory or a network share, create the following directories:

media
├── movies
├── shows
└── torrents

The path to this media folder will be used as an environment variable in our .env file, along with our user’s PUID, PGID and Timezone.

Create a new directory or add the following files to the location of your Docker files:

  • .env
  • docker-compose.yaml

Edit them as follows:

PUID=1001 #change to your user's PUID
PGID=1001 #change to your user's PGID
TZ=Europe/Athens #change to your timezone location
MEDIADIR=/home/dodz/media #change to your media location
version: "3.7"

networks:
  default:
    name: arr
    external: true

services:

#! PROWLARR
  prowlarr:
    image: linuxserver/prowlarr:develop
    container_name: prowlarr
    restart: always
    ports:
      - "9696:9696"
    cap_add:
      - NET_ADMIN
    environment:
      - PGID=$PGID
      - PUID=$PUID
      - TZ=$TZ
    volumes:
      - ./prowlarr:/config

#! RADARR
  radarr:
    image: linuxserver/radarr:latest
    container_name: radarr
    restart: always
    ports:
      - "7878:7878"
    environment:
      - PGID=$PGID
      - PUID=$PUID
      - UMASK=002
      - TZ=$TZ
    volumes:
      - ./radarr:/config
      - $MEDIADIR:/media

#! SONARR
  sonarr:
    image: linuxserver/sonarr:latest
    container_name: sonarr
    restart: always
    ports:
      - "8989:8989"
    environment:
      - PGID=$PGID
      - PUID=$PUID
      - UMASK=002
      - TZ=$TZ
    volumes:
      - ./sonarr:/config
      - $MEDIADIR:/media

#! TRANSMISSION
  transmission:
    image: lscr.io/linuxserver/transmission
    container_name: transmission2
    environment:
      - PUID=$PUID # User id
      - PGID=$PGID # Group id
      - TZ=$TZ # Your current timezone
      - UMASK=002
    volumes:
      - ./transmission:/config
      - $MEDIADIR/torrents:/downloads/complete
    ports:
      - 9091:9091 # Web UI port
      # - 51413:51413 # Torrent port (TCP)
      # - 51413:51413/udp # Torrent port (UDP)
    restart: unless-stopped # This makes sure that the application restarts when it crashes

#! EMBY
  emby:
    image: ghcr.io/linuxserver/emby
    container_name: emby
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - TZ=$TZ
    volumes:
      - ./emby:/config
      - $MEDIADIR:/Media
    ports:
      - 8096:8096
      - 8920:8920
    restart: unless-stopped

#! SAMBA
  samba:
    image: dperson/samba:latest
    container_name: samba
    restart: always
    # NOTE: see <https://github.com/dperson/samba#troubleshooting>
    deploy:
      resources:
        limits:
          memory: 512M
    ports:
      - "139:139"
      - "445:445"
    environment:
      - USERID=1001
      - GROUPID=1001
      - SHARE=Media;/home/dodz/media
      - TZ=$TZ
    volumes:
      - $MEDIADIR:$MEDIADIR

Once done, create a new network named arr (see beginning of the docker-compose.yaml file)

docker create network arr

Run the docker-compose file to create the containers:

docker compose up -d

Once the containers have spun up, we can reach our new services:

prowlarr – http://<yourServerIP>:9696
radarr – http://<yourServerIP>:7878
sonarr – http://<yourServerIP>:8989
transmission – http://<yourServerIP>:9091
emby – http://<yourServerIP>:8096

Note that we have an additional container, samba. This container simply enables sharing our media. More on that towards the end.

App configuration

Before configuring Prowlarr, browse to Radarr and get the API key under Settings > General

💡 Note, if you need password authentication, makes sure to select Forms (Login Page)and fill in your details.

Copy the API key somewhere, we will use it later.

Next, repeat these steps for Sonarr, saving your API key once more.

Prowlarr

Browse to Prowlarr and repeat the above steps for authentication. No need to copy the API key this time.

Under Indexers, add the indexers of your choice. For example, I have added the following to test:

Go back to Settings and select Apps. Under Applications, we need to add our new apps, Radarr and Sonarr:

Example for Radarr:

Since our apps are on the same Docker network (arr), we can use their names. This means you can replicate the exact setup as above, adding your API key which will be different.

Repeat the above steps to add Sonarr as well, using for http://sonarr:8989 for your Sonarr Server and your Sonarr API key.

Under Settings > Download Clients, we will add our Transmission client:

And that’s it, Prowlarr is ready.

Next, we need to configure Radarr.

Radarr

Under Settings > Download Clients, repeat the steps as above to configure Transmission.

By default, Transmission downloads files to /downloads/complete, so we need to create a Remote Path Mapping pointing to our /media/downloads path.

Cick on the + sign and add the following:

Next, we need to tell Radarr where to move our downloaded content.

Browse to Settings > Media Management and scroll all the way down to Root Folders.

Click on Add Root Folder and add /media/movies.

Sonarr

Repeat the above steps for Sonarr. The only difference will be our Root Folder, which should be /media/shows.

Now each time we find a movie or TV show to download, these will be processed by Transmission and downloaded under /media/torrents, then moved accordingly to either /media/movies or /media/shows.

Emby

Browse to Emby and you will be asked to create a user and password, select useful stuff about artwork and subtitles and most importantly, set up your libraries.

First, create a library for your Movies. I have mine setup as follows:

^ Make sure to use /Media/movies for your Movies and /Media/Shows for your TV shows.

Create a new library for your TV shows aaaaaand…….

……Voila! We’re done!

Transmission should not require any additional configuration and, thanks to our Samba container, the share is reachable remotely, on either Windows \\\\10.10.5.85\\Media or Mac smb://10.10.5.85/Media.

As stated already, the above content is for educational purposes only. However, if you’re into downloading illegally, you might want to subscribe to a VPN service in order to cover your tracks. 😬

Finally, if you want to expose those services externally so you can watch your content remotely, make sure to check out my Ultimate Home Lab guide!

Peace!

If you found this content helpful,