{"id":13593446,"url":"https://github.com/sebgl/htpc-download-box","last_synced_at":"2025-05-14T06:11:34.234Z","repository":{"id":39261789,"uuid":"117258721","full_name":"sebgl/htpc-download-box","owner":"sebgl","description":"Sonarr / Radarr / Jackett / NZBGet / Deluge / OpenVPN / Plex","archived":false,"fork":false,"pushed_at":"2024-12-17T14:57:00.000Z","size":13742,"stargazers_count":2047,"open_issues_count":45,"forks_count":328,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-04-13T08:58:14.908Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sebgl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-12T15:43:20.000Z","updated_at":"2025-04-12T20:17:54.000Z","dependencies_parsed_at":"2024-01-14T04:37:52.216Z","dependency_job_id":"80f66544-78cd-411e-84b7-a7f813b8b87e","html_url":"https://github.com/sebgl/htpc-download-box","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebgl%2Fhtpc-download-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebgl%2Fhtpc-download-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebgl%2Fhtpc-download-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sebgl%2Fhtpc-download-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sebgl","download_url":"https://codeload.github.com/sebgl/htpc-download-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254079993,"owners_count":22011305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:01:20.420Z","updated_at":"2025-05-14T06:11:34.207Z","avatar_url":"https://github.com/sebgl.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# HTPC Download Box\n\nSonarr / Radarr / Jackett / NZBGet / Deluge / OpenVPN / Plex\n\nTV shows and movies download, sort, with the desired quality and subtitles, behind a VPN (optional), ready to watch, in a beautiful media player.\nAll automated.\n\n## Table of Contents\n\n- [HTPC Download Box](#htpc-download-box)\n  - [Table of Contents](#table-of-contents)\n  - [Overview](#overview)\n    - [Monitor TV shows/movies with Sonarr and Radarr](#monitor-tv-showsmovies-with-sonarr-and-radarr)\n    - [Search for releases automatically with Usenet and torrent indexers](#search-for-releases-automatically-with-usenet-and-torrent-indexers)\n    - [Handle bittorrent and usenet downloads with Deluge and NZBGet](#handle-bittorrent-and-usenet-downloads-with-deluge-and-nzbget)\n    - [Organize libraries and play videos with Plex](#organize-libraries-and-play-videos-with-plex)\n  - [Hardware configuration](#hardware-configuration)\n  - [Software stack](#software-stack)\n  - [Installation guide](#installation-guide)\n    - [Introduction](#introduction)\n    - [Install docker and docker-compose](#install-docker-and-docker-compose)\n    - [Setup Deluge](#setup-deluge)\n      - [Docker container](#docker-container)\n      - [Configuration](#configuration)\n    - [Setup a VPN Container](#setup-a-vpn-container)\n      - [Introduction](#introduction)\n      - [privateinternetaccess.com custom setup](#privateinternetaccesscom-custom-setup)\n      - [Docker container](#docker-container-1)\n    - [Setup Jackett](#setup-jackett)\n      - [Docker container](#docker-container-2)\n      - [Configuration and usage](#configuration-and-usage)\n    - [Setup NZBGet](#setup-nzbget)\n      - [Docker container](#docker-container-3)\n      - [Configuration and usage](#configuration-and-usage)\n    - [Setup Plex](#setup-plex)\n      - [Media Server Docker Container](#media-server-docker-container)\n      - [Configuration](#configuration-1)\n      - [Setup Plex clients](#setup-plex-clients)\n    - [Setup Sonarr](#setup-sonarr)\n      - [Docker container](#docker-container-4)\n      - [Configuration](#configuration-2)\n      - [Give it a try](#give-it-a-try)\n    - [Setup Radarr](#setup-radarr)\n      - [Docker container](#docker-container-5)\n      - [Configuration](#configuration-3)\n      - [Give it a try](#give-it-a-try-1)\n      - [Movie discovering](#movie-discovering)\n    - [Setup Bazarr](#setup-bazarr)\n      - [Bazarr Docker container](#bazarr-docker-container)\n      - [Bazarr Configuration](#bazarr-configuration)\n  - [Manage it all from your mobile](#manage-it-all-from-your-mobile)\n  - [Going Further](#going-further)\n\n## Overview\n\nThis is what I have set up at home to handle TV shows and movies automated download, sort and play.\n\n_Disclaimer: I'm not encouraging/supporting piracy, this is for information purpose only._\n\nHow does it work? I rely on several tools integrated together. They're all open-source, and deployed as Docker containers on my Linux server.\n\nThe common workflow is detailed in this first section to give you an idea of how things work.\n\n### Monitor TV shows/movies with Sonarr and Radarr\n\nUsing [Sonarr](https://sonarr.tv/) Web UI, search for a TV show by name and mark it as monitored. You can specify a language and the required quality (1080p for instance). Sonarr will automatically take care of analyzing existing episodes and seasons of this TV show. It compares what you have on disk with the TV show release schedule, and triggers download for missing episodes. It also takes care of upgrading your existing episodes if a better quality matching your criterias is available out there.\n\n![Monitor Mr Robot season 1](img/mr_robot_season1.png)\nSonarr triggers download batches for entire seasons. But it also handle upcoming episodes and seasons on-the-fly. No human intervention is required for all the episodes to be released from now on.\n\nWhen the download is over, Sonarr moves the file to the appropriate location (`my-tv-shows/show-name/season-1/01-title.mp4`), and renames the file if needed.\n\n![Sonarr calendar](img/sonarr_calendar.png)\n\n[Radarr](https://radarr.video) is the exact same thing, but for movies.\n\n### Search for releases automatically with Usenet and torrent indexers\n\nSonarr and Radarr can both rely on two different ways to download files:\n\n- Usenet (newsgroups) bin files. That's the historical and principal option, for several reasons: consistency and quality of the releases, download speed, indexers organization, etc. Often requires a paid subscription to newsgroup servers.\n- Torrents. That's the new player in town, for which support has improved a lot lately.\n\nI'm using both systems simultaneously, torrents being used only when a release is not found on newsgroups, or when the server is down. At some point I might switch to torrents only, which work really fine as well.\n\nFiles are searched automatically by Sonarr/Radarr through a list of _indexers_ that you have to configure. Indexers are APIs that allow searching for particular releases organized by categories. Think browsing the Pirate Bay programmatically. This is a pretty common feature for newsgroups indexers that respect a common API (called `Newznab`).\nHowever this common protocol does not really exist for torrent indexers. That's why we'll be using another tool called [Jackett](https://github.com/Jackett/Jackett). You can consider it as a local proxy API for the most popular torrent indexers. It searches and parse information from heterogeneous websites.\n\n![Jackett indexers](img/jackett_indexers.png)\n\nThe best release matching your criteria is selected by Sonarr/Radarr (eg. non-blacklisted 1080p release with enough seeds). Then the download is passed on to another set of tools.\n\n### Handle bittorrent and usenet downloads with Deluge and NZBGet\n\nSonarr and Radarr are plugged to downloaders for our 2 different systems:\n\n- [NZBGet](https://nzbget.net/) handles Usenet (newsgroups) binary downloads.\n- [Deluge](http://deluge-torrent.org/) handles torrent download.\n\nBoth are daemons coming with a nice Web UI, making them perfect candidates for being installed on a server. Sonarr \u0026 Radarr already have integration with them, meaning they rely on each service API to pass on downloads, request download status and handle finished downloads.\n\nBoth are very standard and popular tools. I'm using them for their integration with Sonarr/Radarr but also as standalone downloaders for everything else.\n\nFor security and anonymity reasons, I'm running Deluge behind a VPN connection. All incoming/outgoing traffic from deluge is encrypted and goes out to an external VPN server. Other service stay on my local network. This is done through Docker networking stack (more to come on the next paragraphs).\n\n### Organize libraries and play videos with Plex\n\n[Plex](https://www.plex.tv/) Media Server organize all your medias as libraries. You can set up one for TV shows and another one for movies.\nIt automatically grabs metadata for each new release (description, actors, images, release date).\n\n![Plex Web UI](img/plex_macbook.jpg)\n\nPlex keeps track of your position in the entire library: what episode of a given TV show season you've watched, what movie you've not watched yet, what episode was added to the library since last time. It also remembers where you stopped within a video file. Basically you can pause a movie in your bedroom, then resume playback from another device in your bathroom.\n\nPlex comes with [clients](https://www.plex.tv/apps/) in a lot of different systems (Web UI, Linux, Windows, OSX, iOS, Android, Android TV, Chromecast, PS4, Smart TV, etc.) that allow you to display and watch all your shows/movies in a nice Netflix-like UI.\n\nThe server has transcoding abilities: it automatically transcodes video quality if needed (eg. stream your 1080p movie in 480p if watched from a mobile with low bandwidth).\n\n## Hardware configuration\n\nI'm using an old [Proliant MicroServer N54L](http://www.minimachines.net/promos-et-sorties/bon-plan-un-micro-serveur-hp-proliant-4-emplacements-a-169e-371) (2 cores, 2.20GHz) that I tweaked a bit to have 6GB RAM, an additional graphic card for better Full HD decoding, and an additional 2TB disk for data.\n\nIt has Ubuntu 17.10.1 with Docker installed.\n\nYou can also use a Raspberry Pi, a Synology NAS, a Windows or Mac computer. The stack should work fine on all these systems, but you'll have to adapt the Docker stack below to your OS. I'll only focus on a standard Linux installation here.\n\n## Software stack\n\n![Architecture Diagram](img/architecture_diagram.png)\n\n**Downloaders**:\n\n- [Deluge](http://deluge-torrent.org): torrent downloader with a web UI\n- [NZBGet](https://nzbget.net): usenet downloader with a web UI\n- [Jackett](https://github.com/Jackett/Jackett): API to search torrents from multiple indexers\n- [Bazarr](https://www.bazarr.media/): A companion tool for Radarr and Sonarr which will automatically pull subtitles for all of your TV and movie downloads.\n\n**Download orchestration**:\n\n- [Sonarr](https://sonarr.tv): manage TV show, automatic downloads, sort \u0026 rename\n- [Radarr](https://radarr.video): basically the same as Sonarr, but for movies\n\n**VPN**:\n\n- [OpenVPN](https://openvpn.net/) client configured with a [privateinternetaccess.com](https://www.privateinternetaccess.com/) access\n\n**Media Center**:\n\n- [Plex](https://plex.tv): media center server with streaming transcoding features, useful plugins and a beautiful UI. Clients available for a lot of systems (Linux/OSX/Windows, Web, Android, Chromecast, Android TV, etc.)\n\n## Installation guide\n\n### Introduction\n\nThe idea is to set up all these components as Docker containers in a `docker-compose.yml` file.\nWe'll reuse community-maintained images (special thanks to [linuxserver.io](https://www.linuxserver.io/) for many of them).\nI'm assuming you have some basic knowledge of Linux and Docker.\nA general-purpose `docker-compose` file is maintained in this repo [here](https://github.com/sebgl/htpc-download-box/blob/master/docker-compose.yml).\n\nThe stack is not really plug-and-play. You'll see that manual human configuration is required for most of these tools. Configuration is not fully automated (yet?), but is persisted on reboot. Some steps also depend on external accounts that you need to set up yourself (usenet indexers, torrent indexers, vpn server, plex account, etc.). We'll walk through it.\n\nOptional steps described below that you may wish to skip:\n\n- Using a VPN server for Deluge incoming/outgoing traffic.\n- Using newsgroups (Usenet): you can skip NZBGet installation and all related Sonarr/Radarr indexers configuration if you wish to use bittorrent only.\n\n### Install docker and docker-compose\n\nSee the [official instructions](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce-1) to install Docker.\n\nThen add yourself to the `docker` group:\n`sudo usermod -aG docker myuser`\n\nMake sure it works fine:\n`docker run hello-world`\n\nAlso install docker-compose (see the [official instructions](https://docs.docker.com/compose/install/#install-compose)).\n\n### (optional) Use premade docker-compose\n\nThis tutorial will guide you along the full process of making your own docker-compose file and configuring every app within it, however, to prevent errors or to reduce your typing, you can also use the general-purpose docker-compose file provided in this repository.\n\n1. First, `git clone https://github.com/sebgl/htpc-download-box` into a directory. This is where you will run the full setup from (note: this isn't the same as your media directory)\n2. Rename the `.env.example` file included in the repo to `.env`.\n3. Continue this guide, and the docker-compose file snippets you see are already ready for you to use. You'll still need to manually configure your `.env` file and other manual configurations.\n\n### (optional) Use premade Vagrant box\n\nYou can also use a premade Vagrant box, that will spin up an Ubuntu virtual machine and bootstrap the environment from the `docker-compose` file described above.\n\nAfter ensuring Vagrant is installed on your machine:\n\n1. Run `vagrant up` to bootstrap the vagrant box\n2. Run `vagrant ssh` to ssh into the box\n3. Use the default `192.168.7.7` IP to access the box services from a local machine\n\n### Setup environment variables\n\nFor each of these images, there is some unique configuration that needs to be done. Instead of editing the docker-compose file to hardcode these values in, we'll instead put these values in a .env file. A .env file is a file for storing environment variables that can later be accessed in a general-purpose docker-compose.yml file, like the example one in this repository.\n\nHere is an example of what your `.env` file should look like, use values that fit for your own setup.\n\n```sh\n# Your timezone, https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\nTZ=America/New_York\nPUID=1000\nPGID=1000\n# The directory where data and configuration will be stored.\nROOT=/media/my_user/storage/homemedia\n```\n\nThings to notice:\n\n- TZ is based on your [tz time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).\n- The PUID and PGID are your user's ids. Find them with `id $USER`.\n- This file should be in the same directory as your `docker-compose.yml` file so the values can be read in.\n\n### Setup Deluge\n\n#### Docker container\n\nWe'll use deluge Docker image from linuxserver, which runs both the deluge daemon and web UI in a single container.\n\n```yaml\nversion: \"3\"\nservices:\n  deluge:\n    container_name: deluge\n    image: linuxserver/deluge:latest\n    restart: always\n    network_mode: service:vpn # run on the vpn network\n    environment:\n      - PUID=${PUID} # default user id, defined in .env\n      - PGID=${PGID} # default group id, defined in .env\n      - TZ=${TZ} # timezone, defined in .env\n    volumes:\n      - ${ROOT}/downloads:/downloads # downloads folder\n      - ${ROOT}/config/deluge:/config # config files\n```\n\nThings to notice:\n\n- I use the host network to simplify configuration. Important ports are `8112` (web UI) and `58846` (bittorrent daemon).\n\nThen run the container with `docker-compose up -d`.\nTo follow container logs, run `docker-compose logs -f deluge`.\n\n#### Configuration\n\nYou should be able to login on the web UI (`localhost:8112`, replace `localhost` by your machine ip if needed).\n\n![Deluge Login](img/deluge_login.png)\n\nThe default password is `deluge`. You are asked to modify it, I chose to set an empty one since deluge won't be accessible from outside my local network.\n\nThe running deluge daemon should be automatically detected and appear as online, you can connect to it.\n\n![Deluge daemon](img/deluge_daemon.png)\n\nYou may want to change the download directory. I like to have to distinct directories for incomplete (ongoing) downloads, and complete (finished) ones.\nAlso, I set up a blackhole directory: every torrent file in there will be downloaded automatically. This is useful for Jackett manual searches.\n\nYou should activate `autoadd` in the plugins section: it adds supports for `.magnet` files.\n\n![Deluge paths](img/deluge_path.png)\n\nYou can also tweak queue settings, defaults are fairly small. Also you can decide to stop seeding after a certain ratio is reached. That will be useful for Sonarr, since Sonarr can only remove finished downloads from deluge when the torrent has stopped seeding. Setting a very low ratio is not very fair though !\n\nConfiguration gets stored automatically in your mounted volume (`${ROOT}/config/deluge`) to be re-used at container restart. Important files in there:\n\n- `auth` contains your login/password\n- `core.conf` contains your deluge configuration\n\nYou can use the Web UI manually to download any torrent from a .torrent file or magnet hash.\n\n### Setup a VPN Container\n\n#### Introduction\n\nThe goal here is to have an OpenVPN Client container running and always connected. We'll make Deluge incoming and outgoing traffic go through this OpenVPN container.\n\nThis must come up with some safety features:\n\n1. VPN connection should be restarted if not responsive\n1. Traffic should be allowed through the VPN tunnel _only_, no leaky outgoing connection if the VPN is down\n1. Deluge Web UI should still be reachable from the local network\n\nLucky me, someone already [set that up quite nicely](https://github.com/dperson/openvpn-client).\n\nPoint 1 is resolved through the OpenVPN configuration (`ping-restart` set to 120 sec by default).\nPoint 2 is resolved through [iptables rules](https://github.com/dperson/openvpn-client/blob/master/openvpn.sh#L52-L87)\nPoint 3 is also resolved through [iptables rules](https://github.com/dperson/openvpn-client/blob/master/openvpn.sh#L104)\n\nConfiguration is explained on the [project page](https://github.com/dperson/openvpn-client), you can follow it.\nHowever it is not that easy depending on your VPN server settings.\nI'm using a privateinternetaccess.com VPN, so here is how I set it up.\n\n#### privateinternetaccess.com custom setup\n\n_Note_: this section only applies for [PIA](https://privateinternetaccess.com) accounts.\n\nDownload PIA OpenVPN [configuration files](https://privateinternetaccess.com/openvpn/openvpn.zip).\nIn the archive, you'll find a bunch of `\u003ccountry\u003e.ovpn` files, along with 2 other important files: `crl.rsa.2048.pem` and `ca.rsa.2048.crt`. Pick the file associated to the country you'd like to connect to, for example `netherlands.ovpn`.\n\nCopy the 3 files to `${ROOT}/config/vpn`.\nCreate a 4th file `vpn.auth` with the following content:\n\n```Text\n\u003cpia username\u003e\n\u003cpia password\u003e\n```\n\nYou should now have 3 files in `${ROOT}/config/vpn`:\n\n- netherlands.ovpn\n- vpn.auth\n- crl.rsa.2048.pem\n- ca.rsa.2048.crt\n\nEdit `netherlands.ovpn` (or any other country of your choice) to tweak a few things (see my comments on lines added or modified):\n\n```INI\nclient\ndev tun\nproto udp\nremote nl.privateinternetaccess.com 1198\nresolv-retry infinite\nnobind\npersist-key\n# persist-tun # disable to completely reset vpn connection on failure\ncipher aes-128-cbc\nauth sha1\ntls-client\nremote-cert-tls server\nauth-user-pass /vpn/vpn.auth # to be reachable inside the container\ncomp-lzo\nverb 1\nreneg-sec 0\ncrl-verify /vpn/crl.rsa.2048.pem # to be reachable inside the container\nca /vpn/ca.rsa.2048.crt # to be reachable inside the container\ndisable-occ\nkeepalive 10 30 # send a ping every 10 sec and reconnect after 30 sec of unsuccessfull pings\npull-filter ignore \"auth-token\" # fix PIA reconnection auth error that may occur every 8 hours\n```\n\nThen, rename `\u003ccountry\u003e.ovpn` to `vpn.conf`\n\n#### Docker container\n\nPut it in the docker-compose file, and make deluge use the vpn container network:\n\n```yaml\nvpn:\n  container_name: vpn\n  image: dperson/openvpn-client:latest\n  cap_add:\n    - net_admin # required to modify network interfaces\n  restart: unless-stopped\n  volumes:\n    - /dev/net:/dev/net:z # tun device\n    - ${ROOT}/config/vpn:/vpn # OpenVPN configuration\n  security_opt:\n    - label:disable\n  ports:\n    - 8112:8112 # port for deluge web UI to be reachable from local network\n  command: \"-r 192.168.1.0/24\" # route local network traffic\n\ndeluge:\n  container_name: deluge\n  image: linuxserver/deluge:latest\n  restart: always\n  network_mode: service:vpn # run on the vpn network\n  environment:\n    - PUID=${PUID} # default user id, defined in .env\n    - PGID=${PGID} # default group id, defined in .env\n    - TZ=${TZ} # timezone, defined in .env\n  volumes:\n    - ${ROOT}/downloads:/downloads # downloads folder\n    - ${ROOT}/config/deluge:/config # config files\n```\n\nNotice how deluge is now using the vpn container network, with deluge web UI port exposed on the vpn container for local network access.\n\nYou can check that deluge is properly going out through the VPN IP by using [torguard check](https://torguard.net/checkmytorrentipaddress.php).\nGet the torrent magnet link there, put it in Deluge, wait a bit, then you should see your outgoing torrent IP on the website.\n\n![Torrent guard](img/torrent_guard.png)\n\n### Setup Jackett\n\n[Jackett](https://github.com/Jackett/Jackett) translates request from Sonarr and Radarr to searches for torrents on popular torrent websites, even though those website do not have a sandard common APIs (to be clear: it parses html for many of them :)).\n\n#### Docker container\n\nNo surprise: let's use linuxserver.io container !\n\n```yaml\njackett:\n  container_name: jackett\n  image: linuxserver/jackett:latest\n  restart: unless-stopped\n  network_mode: host\n  environment:\n    - PUID=${PUID} # default user id, defined in .env\n    - PGID=${PGID} # default group id, defined in .env\n    - TZ=${TZ} # timezone, defined in .env\n  volumes:\n    - /etc/localtime:/etc/localtime:ro\n    - ${ROOT}/downloads/torrent-blackhole:/downloads # place where to put .torrent files for manual download\n    - ${ROOT}/config/jackett:/config # config files\n```\n\nNothing particular in this configuration, it's pretty similar to other linuxserver.io images.\nAn interesting setting is the torrent blackhole directory. When you do manual searches, Jackett will put `.torrent` files there, to be grabbed by your torrent client directly (Deluge for instance).\n\nAs usual, run with `docker-compose up -d`.\n\n#### Configuration and usage\n\nJackett web UI is available on port 9117.\n\n![Jacket empty providers list](img/jackett_empty.png)\n\nConfiguration is available at the bottom of the page. I chose to disable auto-update (I'll rely on the docker images tags myself), and to set `/downloads` as my blackhole directory.\n\nClick on `Add Indexer` and add any torrent indexer that you like. I added 1337x, cpasbien, RARBG, The Pirate Bay and YGGTorrent (need a user/password).\n\nYou can now perform a manual search across multiple torrent indexers in a clean interface with no trillion ads pop-up everywhere. Then choose to save the .torrent file to the configured blackhole directory, ready to be picked up by Deluge automatically !\n\n![Jacket manual search](img/jackett_manual.png)\n\n### Setup NZBGet\n\n#### Docker container\n\nOnce again we'll use the Docker image from linuxserver and set it in a docker-compose file.\n\n```yaml\n  nzbget:\n    container_name: nzbget\n    image: linuxserver/nzbget:latest\n    restart: unless-stopped\n    network_mode: host\n    environment:\n      - PUID=${PUID} # default user id, defined in .env\n      - PGID=${PGID} # default group id, defined in .env\n      - TZ=${TZ} # timezone, defined in .env\n     volumes:\n      - ${ROOT}/downloads:/downloads # download folder\n      - ${ROOT}/config/nzbget:/config # config files\n```\n\n#### Configuration and usage\n\nAfter running the container, web UI should be available on `localhost:6789`.\nUsername: nzbget\nPassword: tegbzn6789\n\n![NZBGet](img/nzbget_empty.png)\n\nSince NZBGet stays on my local network, I choose to disable passwords (`Settings/Security/ControlPassword` set to empty).\n\nThe important thing to configure is the url and credentials of your newsgroups server (`Settings/News-servers`). I have a Frugal Usenet account at the moment, I set it up with TLS encryption enabled.\n\nDefault configuration suits me well, but don't hesitate to have a look at the `Paths` configuration.\n\nYou can manually add .nzb files to download, but the goal is of course to have Sonarr and Radarr take care of it automatically.\n\n### Setup Plex\n\n#### Media Server Docker Container\n\nLuckily for us, Plex team already provides a maintained [Docker image for pms](https://github.com/plexinc/pms-docker).\n\nWe'll use the host network directly, and run our container with the following configuration:\n\n```yaml\nplex-server:\n  container_name: plex-server\n  image: plexinc/pms-docker:latest\n  restart: unless-stopped\n  environment:\n    - TZ=${TZ} # timezone, defined in .env\n  network_mode: host\n  volumes:\n    - ${ROOT}/config/plex/db:/config # plex database\n    - ${ROOT}/config/plex/transcode:/transcode # temp transcoded files\n    - ${ROOT}/complete:/data # media library\n```\n\nLet's run it !\n`docker-compose up -d`\n\n#### Configuration\n\nPlex Web UI should be available at `localhost:32400/web` (replace `localhost` by your server ip if needed).\n\nNote: If you are running on a headless server (e.g. Synology NAS) with container using host networking, you will need to use ssh tunneling to gain access and setup the server for first run. (see https://forums.plex.tv/t/i-did-something-stupid-please-plex-forums-your-my-only-hope/328481/11)\n\nYou'll have to login first (registration is free), then Plex will ask you to add your libraries.\nI have two libraries:\n\n- Movies\n- TV shows\n\nMake these the library paths:\n\n- Movies: `/data/movies`\n- TV: `/data/tv`\n\nAs you'll see later, these library directories will each have files automatically placed into them with Radarr (movies) and Sonarr (tv), respectively.\n\nNow, Plex will then scan your files and gather extra content; it may take some time according to how large your directory is.\n\nA few things I like to configure in the settings:\n\n- Set time format to 24 hours (never understood why some people like 12 hours)\n- Tick \"Update my library automatically\"\n\nYou can already watch your stuff through the Web UI. Note that it's also available from an authentified public URL proxified by Plex servers (see `Settings/Server/Remote Access`), you may note the URL or choose to disable public forwarding.\n\n#### Setup Plex clients\n\nPlex clients are available for most devices. I use it on my Android phone, my wife uses it on her iPhone, we use it on a Chromecast in the bedroom, and we also use Plex Media Center directly on the same computer where the server is running, close to the living room TV. It also works fine on the PS4 and on my Raspberry Pi. Nothing particular to configure, just download the app, log into it, enter the validation code and there you go.\n\nOn a Linux Desktop, there are several alternatives.\nHistorically, Plex Home Theater, based on XBMC/Kodi was the principal media player, and by far the client with the most features. It's quite comparable to XBMC/Kodi, but fully integrates with Plex ecosystem. Meaning it remembers what you're currently watching so that you can pause your movie in the bedroom while you continue watching it in the toilets \\o/.\nRecently, Plex team decided to move towards a completely rewritten player called Plex Media Player. It's not officially available for Linux yet, but can be [built from sources](https://github.com/plexinc/plex-media-player). A user on the forums made [an AppImage for it](https://forums.plex.tv/discussion/278570/plex-media-player-packages-for-linux). Just download and run, it's plug and play. It has a very shiny UI, but lacks some features of PHT. For example: editing subtitles offset.\n\n![Plex Media Player](img/plex_media_player.jpg)\n\nIf it does not suit you, there is also now an official [Kodi add-on for Plex](https://www.plex.tv/apps/computer/kodi/). [Download Kodi](http://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux), then browse add-ons to find Plex.\n\nAlso the old good Plex Home Theater is still available, in an open source version called [OpenPHT](https://github.com/RasPlex/OpenPHT).\n\nPersonal choice: after using OpenPHT for a while I'll give Plex Media Player a try. I might miss the ability to live-edit subtitle offset, but Bazarr is supposed to do its job. We'll see.\n\n### Setup Sonarr\n\n#### Docker container\n\nGuess who made a nice Sonarr Docker image? Linuxserver.io !\n\nLet's go:\n\n```yaml\n  sonarr:\n    container_name: sonarr\n    image: linuxserver/sonarr:latest\n    restart: unless-stopped\n    network_mode: host\n    environment:\n      - PUID=${PUID} # default user id, defined in .env\n      - PGID=${PGID} # default group id, defined in .env\n      - TZ=${TZ} # timezone, defined in .env\n     volumes:\n      - /etc/localtime:/etc/localtime:ro\n      - ${ROOT}/config/sonarr:/config # config files\n      - ${ROOT}/complete/tv:/tv # tv shows folder\n      - ${ROOT}/downloads:/downloads # download folder\n```\n\n`docker-compose up -d`\n\nSonarr web UI listens on port 8989 by default. You need to mount your tv shows directory (the one where everything will be nicely sorted and named). And your download folder, because sonarr will look over there for completed downloads, then move them to the appropriate directory.\n\n#### Configuration\n\nSonarr should be available on `localhost:8989`. Go straight to the `Settings` tab.\n\n![Sonarr settings](img/sonarr_settings.png)\n\nEnable `Ignore Deleted Episodes`: if like me you delete files once you have watched them, this makes sure the episodes won't be re-downloaded again.\nIn `Media Management`, you can choose to rename episodes automatically. This is a very nice feature I've been using for a long time.\nIn `profiles` you can set new quality profiles, default ones are fairly good. There is an important option at the bottom of the page: do you want to give priority to Usenet or Torrents for downloading episodes? I'm keeping the default Usenet first.\n\n`Indexers` is the important tab: that's where Sonarr will grab information about released episodes. Nowadays a lot of Usenet indexers are relying on Newznab protocol: fill-in the URL and API key you are using. You can find some indexers on this [subreddit wiki](https://www.reddit.com/r/usenet/wiki/indexers). It's nice to use several ones since there are quite volatile. You can find suggestions on Sonarr Newznab presets. Some of these indexers provide free accounts with a limited number of API calls, you'll have to pay to get more. Usenet-crawler is one of the best free indexers out there.\n\nFor torrents indexers, I activate Torznab custom indexers that point to my local Jackett service. This allows searches across all torrent indexers configured in Jackett. You have to configure them one by one though.\n\nGet torrent indexers Jackett proxy URLs by clicking `Copy Torznab Feed` in Jackett Web UI. Use the global Jackett API key as authentication.\n\n![Jackett indexers](img/jackett_indexers.png)\n\n![Sonarr torznab add](img/sonarr_torznab.png)\n\n`Download Clients` tab is where we'll configure links with our two download clients: NZBGet and Deluge.\nThere are existing presets for these 2 that we'll fill with the proper configuration.\n\nNZBGet configuration:\n![Sonarr NZBGet configuration](img/sonarr_nzbget.png)\n\nDeluge configuration:\n![Sonarr Deluge configuration](img/sonarr_deluge.png)\n\nEnable `Advanced Settings`, and tick `Remove` in the Completed Download Handling section. This tells Sonarr to remove torrents from deluge once processed.\n\nIn `Connect` tab, we'll configure Sonarr to send notifications to Plex when a new episode is ready:\n![Sonarr Plex configuration](img/sonarr_plex.png)\n\n#### Give it a try\n\nLet's add a series !\n\n![Adding a serie](img/sonarr_add.png)\n\n_Note: You may need to `chown -R $USER:$USER /path/to/root/directory` so Sonarr and the rest of the apps have the proper permissions to modify and move around files. This Docker image of Sonarr uses an internal user account inside the container called `abc` some you may have to set this user as owner of the directory where it will place the media files after download. This note also applies for Radarr._\n\nEnter the series name, then you can choose a few things:\n\n- Monitor: what episodes do you want to mark as monitored? All future episodes, all episodes from all seasons, only latest seasons, nothing? Monitored episodes are the episodes Sonarr will download automatically.\n- Profile: quality profile of the episodes you want (HD-1080p is the most popular I guess).\n\nYou can then either add the serie to the library (monitored episode research will start asynchronously), or add and force the search.\n\n![Season 1 in Sonarr](img/sonarr_season1.png)\n\nWait a few seconds, then you should see that Sonarr started doing its job. Here it grabed files from my Usenet indexers and sent the download to NZBGet automatically.\n\n![Download in Progress in NZBGet](img/nzbget_download.png)\n\nYou can also do a manual search for each episode, or trigger an automatic search.\n\nWhen download is over, you can head over to Plex and see that the episode appeared correctly, with all metadata and subtitles grabbed automatically. Applause !\n\n![Episode landed in Plex](img/mindhunter_plex.png)\n\n### Setup Radarr\n\nRadarr is a fork of Sonarr, made for movies instead of TV shows. For a good while I've used CouchPotato for that exact purpose, but have not been really happy with the results. Radarr intends to be as good as Sonarr !\n\n#### Docker container\n\nRadarr is _very_ similar to Sonarr. You won't be surprised by this configuration.\n\n```yaml\n  radarr:\n    container_name: radarr\n    image: linuxserver/radarr:latest\n    restart: unless-stopped\n    network_mode: host\n    environment:\n      - PUID=${PUID} # default user id, defined in .env\n      - PGID=${PGID} # default group id, defined in .env\n      - TZ=${TZ} # timezone, defined in .env\n     volumes:\n      - /etc/localtime:/etc/localtime:ro\n      - ${ROOT}/config/radarr:/config # config files\n      - ${ROOT}/complete/movies:/movies # movies folder\n      - ${ROOT}/downloads:/downloads # download folder\n```\n\n#### Configuration\n\nRadarr Web UI is available on port 7878.\nLet's go straight to the `Settings` section.\n\nIn `Media Management`, you can choose whether or not to enable automatic renaming. Previously I used the sub-zero plugin to find subtitles which functioned better with the original filenames. But now with Bazarr, it's hooked directly into Radarr and Sonarr which means it will look at the original filenames anyway. I enable `Ignore Deleted Movies` to make sure movies that I delete won't be downloaded again by Radarr. I disable `Use Hardlinks instead of Copy` because I prefer to avoid messing around what's in my download area and what's in my movies area.\n\nIn `Profiles` you can set new quality profiles, default ones are fairly good. There is an important option at the bottom of the page: do you want to give priority to Usenet or Torrents for downloading episodes? I'm keeping the default Usenet first.\n\nAs for Sonarr, the `Indexers` section is where you'll configure your torrent and nzb sources.\n\nNowadays a lot of Usenet indexers are relying on Newznab protocol: fill-in the URL and API key you are using. You can find some indexers on this [subreddit wiki](https://www.reddit.com/r/usenet/wiki/indexers). It's nice to use several ones since there are quite volatile. You can find suggestions on Radarr Newznab presets. Some of these indexers provide free accounts with a limited number of API calls, you'll have to pay to get more. Usenet-crawler is one of the best free indexers out there.\nFor torrents indexers, I activate Torznab custom indexers that point to my local Jackett service. This allows searches across all torrent indexers configured in Jackett. You have to configure them one by one though.\n\nGet torrent indexers Jackett proxy URLs by clicking `Copy Torznab Feed`. Use the global Jackett API key as authentication.\n\n![Jackett indexers](img/jackett_indexers.png)\n\n![Sonarr torznab add](img/sonarr_torznab.png)\n\n`Download Clients` tab is where we'll configure links with our two download clients: NZBGet and Deluge.\nThere are existing presets for these 2 that we'll fill with the proper configuration.\n\nNZBGet configuration:\n![Sonarr NZBGet configuration](img/sonarr_nzbget.png)\n\nDeluge configuration:\n![Sonarr Deluge configuration](img/sonarr_deluge.png)\n\nEnable `Advanced Settings`, and tick `Remove` in the Completed Download Handling section. This tells Radarr to remove torrents from deluge once processed.\n\nIn `Connect` tab, we'll configure Radarr to send notifications to Plex when a new episode is ready:\n![Sonarr Plex configuration](img/sonarr_plex.png)\n\n#### Give it a try\n\nLet's add a movie !\n\n![Adding a movie in Radarr](img/radarr_add.png)\n\nEnter the movie name, choose the quality you want, and there you go.\n\nYou can then either add the movie to the library (monitored movie research will start asynchronously), or add and force the search.\n\nWait a few seconds, then you should see that Radarr started doing its job. Here it grabed files from my Usenet indexers and sent the download to NZBGet automatically.\n\nYou can also do a manual search for each movie, or trigger an automatic search.\n\nWhen download is over, you can head over to Plex and see that the movie appeared correctly, with all metadata and subtitles grabbed automatically. Applause !\n\n![Movie landed in Plex](img/busan_plex.png)\n\n#### Movie discovering\n\nI like the discovering feature. When clicking on `Add Movies` you can select `Discover New Movies`, then browse through a list of TheMovieDB recommended or popular movies.\n\n![Movie landed in Plex](img/radarr_recommendations.png)\n\nOn the rightmost tab, you'll also see that you can setup Lists of movies. What if you could have in there a list of the 250 greatest movies of all time and just one-click download the ones you want?\n\nThis can be set up in `Settings/Lists`. I activated the following lists:\n\n- StevenLu: that's an [interesting project](https://github.com/sjlu/popular-movies) that tries to determine by certain heuristics the current popular movies.\n- IMDB TOP 250 movies of all times from Radarr Lists presets\n- Trakt Lists Trending and Popular movies\n\nI disabled automatic sync for these lists: I want them to show when I add a new movie, but I don't want every item of these lists to be automatically synced with my movie library.\n\n### Setup Bazarr\n\nIn previous versions of this guide, I used the sub-zero plugin for plex. Based on someone's suggestion on this project I tried out [Bazarr](https://www.bazarr.media/) which hooks directly into Radarr and Sonarr and makes the process more effective and painless. If you don't care about subtitles go ahead and skip this step.\n\n#### Bazarr Docker container\n\nBelieve it or not, we will be using yet another docker container from linuxserver! Since this is made to be a companion app for Sonarr and Radarr, you will notice that the configuration is very similar to them, just point it at the directories where you store your organized movies and tv shows.\n\n```yaml\nbazarr:\n  container_name: bazarr\n  image: linuxserver/bazarr\n  restart: unless-stopped\n  network_mode: host\n  environment:\n    - PUID=${PUID} # default user id, defined in .env\n    - PGID=${PGID} # default group id, defined in .env\n    - TZ=${TV} # timezone, defined in .env\n    - UMASK_SET=022 #optional\n  volumes:\n    - ${ROOT}/config/bazarr:/config # config files\n    - ${ROOT}/complete/movies:/movies # movies folder\n    - ${ROOT}/complete/tv:/tv # tv shows folder\n  ports:\n    - 6767:6767\n```\n\n#### Bazarr Configuration\n\nThe Web UI for Bazarr will be available on port 6767. Load it up and you will be greeted with this setup page:\n\n![Bazarr configuration](img/bazarr_start.png)\n\nYou can leave this page blank and go straight to the next page, \"Subtitles\". There are many options for different subtitle providers to use, but in this guide I'll be using [Open Subtitles](https://www.opensubtitles.org/). If you don't have an account with them, head on over to the [Registration page](https://www.opensubtitles.org/en/newuser) and make a new account. Then all you need to do is tick the box for OpenSubtitles and fill in your new account details.\n\n![Bazarr Open Subtitles](img/bazarr_opensubtitles.png)\n\nYou can always add more subtitle providers if you want, figure out which ones are good for you!\n\nNext scroll to the bottom of the screen where you will find your language settings. I am interested in French as well as English subtitles so I will add both of them for enabled languages. However I am primarily interested in French so I will turn on \"Default Enabled\" for both TV and movies and finally set French to be that default.\n\n![Bazarr Languages](img/bazarr_language.png)\n\nClick next and we will be on the Sonarr setup page. For this part we will need our Sonarr API key. To get this, open up sonarr in a separate tab and navigate to `Settings \u003e General \u003e Security` and copy the api key listed there.\n\n![Sonarr API Key](img/bazarr_sonarr_api.png)\n\nHead back over Bazarr and check the \"Use Sonarr\" box and some settings will pop up. Paste your API key in the proper field, and you can leave the other options default. If you would like, you can tick the box for \"Download Only Monitored\" which will prevent Bazarr from downloading subtitles for tv shows you have in your Sonarr library but have possibly deleted from your drive. Then click \"Test\" and Sonarr should be all set!\n\n![Bazarr Sonarr Setup](img/bazarr_sonarr.png)\n\nThe next step is connecting to Radarr and the process should be identical. The only difference is that you'll have to grab your Radarr API key instead of Sonarr. Once that's done click Finish and you will be brought to your main screen where you will be greeted with a message saying that you need to restart. Click this and Bazarr should reload. Once that's all set, you should be good to go! Bazarr should now automatically downlaod subtitles for the content you add through Radarr and Sonarr that is not already found within the media files themselves.\n\nIf you have any problems, check out the [wiki page](https://github.com/morpheus65535/bazarr/wiki/First-time-installation-configuration) for Bazarr and you should probably find your answer.\n\n## Manage it all from your mobile\n\nOn Android, I'm using [nzb360](http://nzb360.com) to manage NZBGet, Deluge, Sonarr and Radarr.\nIt's a beautiful and well-thinked app. Easy to get a look at upcoming tv shows releases (eg. \"when will the next f\\*\\*cking Game of Thrones episode be released?\").\n\n![NZB360](img/nzb360.png)\n\nThe free version does not allow you to add new shows. Consider switching to the paid version (6\\$) and support the developer.\n\n## Going Further\n\nSome stuff worth looking at that I do not use at the moment:\n\n- [NZBHydra](https://github.com/theotherp/nzbhydra): meta search for NZB indexers (like [Jackett](https://github.com/Jackett/Jackett) does for torrents). Could simplify and centralise nzb indexers configuration at a single place.\n- [Organizr](https://github.com/causefx/Organizr): Embed all these services in a single webpage with tab-based navigation\n- [Plex sharing features](https://www.plex.tv/features/#feat-modal)\n- [Headphones](https://github.com/rembo10/headphones): Automated music download. Like Sonarr but for music albums. I've been using it for a while, but it did not give me satisfying results. I also tend to rely entirely on a Spotify premium account to manage my music collection now.\n- [Mylar](https://github.com/evilhero/mylar): like Sonarr, but for comic books.\n- [Ombi](http://www.ombi.io/): Web UI to give your shared Plex instance users the ability to request new content\n- [PlexPy](https://github.com/JonnyWong16/plexpy): Monitoring interface for Plex. Useful is you share your Plex server to multiple users.\n- Radarr lists automated downloads, to fetch best movies automatically. [Rotten Tomatoes certified movies](https://www.rottentomatoes.com/browse/cf-in-theaters/) would be a nice list to parse and get automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebgl%2Fhtpc-download-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsebgl%2Fhtpc-download-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsebgl%2Fhtpc-download-box/lists"}