Introduction

Welcome to the simplified but detailed guide for newbies on optimizing your Plex streaming experience with Real-Debrid, Zurg, and Rclone. In this tutorial, we'll explore the seamless integration of Plex with Real-Debrid, using Plex Discover Watchlists, Trakt lists and Overseerr to enhance your media server capabilities.

This guide is for those who would like to run the setup on an Ubuntu machine. I am using a remote Ubuntu server on Linode. The steps should be similar if you are running it on a local Ubuntu server as well or for other Linux distributions. Not sure though.

I have tried to be as detailed as I can with each step, for my future self. It took me a lot of time to get this working but next time, it will be easy (unless something else breaks).
This may or may not work for your machine. I tested on two fresh Ubuntu instances and it worked. If this doesn’t work for some reason, feel free to check out my previous guide which is a lot more manual. Click here.

Introduction

Brief Outline

Ubuntu Server Setup (Optional)

Create Instance.

Connect & Set Up the Instance (only for remote servers)

Set Up port forwarding (only for remote servers)

Check if VPN is needed

Install Packages & Containers

Configure Plex & Containers

Configure Plex

Configuring Overseerr

Configuring Jackett & Flaresolverr

Configure PD_ZURG

Plex_Debrid

First time Setup

Verify the setup

Final Note

Credits

Brief Outline

  • Ubuntu Server Setup (Optional): This optional step is designed for users choosing a VPS or seedbox, guiding them through setting up an Ubuntu server on Linode.
  • Docker: Install Docker and configure it to start automatically with your system.
  • Plex Server: Installing Plex and establishing your server to get a Plex Token.
  • Overseerr & Jackett (Optional): Set up Overseerr & Jackett to add other users and torrent indexers..
  • Zurg and Rclone: Installation and configuration of Zurg and Rclone using PD_Zurg.
  • Plex_Debrid: Configuration process for Plex_Debrid, enhancing your Plex server's capabilities with integrated Real-Debrid services.

Ubuntu Server Setup (Optional)


If you are planning to run this setup on a local ubuntu server, you can skip this step. This is for those who would like to run this on a remote Ubuntu Server, maybe a VPS or Seedbox or VM.

Create Instance.

For this set up, I will be using an Ubuntu 23.10 instance on Linode. You can set this up on a Shared Linode 2GB Instance. It costs 12 USD a month.

  • Go to https://www.linode.com/ and sign up.
  • Log in to the Cloud Manager, click the Create dropdown menu on the top bar, and select Linode. This opens the Create Linode form.
  • Choose Distribution Ubuntu 23.10
  • Next, you must select the region where the Compute Instance will reside. You should likely select the region closest to you and/or your customers. This helps reduce latency and can make a significant impact in connection speeds and quality.
  • Next Choose your preferred Instance Type and Plan. I chose Shared Linode 2GB plan
  • Set a Label (No Spaces) and add Tag (Optional)
  • Set a password. If you want to be able to connect to the instance without having to enter a password every time, you will need to set up SSH keys. You can set this up later (Check this link for more information.)
  • Remaining options are optional.
  • Click on Create Linode.

Wait for sometime for the Linode instance to be provisioned & created. Once it is created, go to cloud Manager again and click on your Instance. You should see something like this.


Connect & Set Up the Instance (only for remote servers)

  • Copy the SSH Access command from the above image.
  • Open CMD in your Windows Local Machine and run the command we just copied. Enter the password (unless you have setup SSH keys)
  • When running for the 1st time, It will give a prompt asking for confirmation. Type Yes and press Enter.
  • Run this command to refresh the package information, and install newer versions of the packages. Press Y when prompted
  • sudo apt update && apt upgrade
  • Reboot

Set Up port forwarding (only for remote servers)

Disconnect terminal and reconnect using the below command. Going forward we will connect with the following command (replace the IP with your Instance IP.

  • ssh -L 32400:localhost:32400 -L 9999:localhost:9999 -L 5055:localhost:5055 -L 9117:localhost:9117 -8191:localhost:8191 root@192.205.6.14
  • You can create a batch file to run directly instead of typing it everytime.


We can access servers for all of the below from our local machine.
 ssh -L enables local port forwarding, allowing us to access services on the remote server through our local machine.

  • 32400 is port for Plex
  • 9999 is port for Zurg
  • 5055 is port for Overseerr (optional)
  • 9117 is port for Jackett (optional)
  • 8191 is port for flaresolverr (optional but necessary if you use Jackett)

Check if VPN is needed

Debrid services like real-debrid block common VPS or Seedbox IP addresses. They do however have a list of whitelisted VPNs, behind which you can run your server. For real-debrid you can find this list on https://real-debrid.com/vpn. You can also use this address to check whether or not your server’s IP is blocked by running below commands

  • curl -4 https://real-debrid.com/vpn | grep blocked
  • curl -6 https://real-debrid.com/vpn | grep blocked

If it is not blocked, then congratulations. If it is blocked, you will need to set up a VPN on the server machine to connect to Real-Debrid. I have my own personal VPN which I managed to set up a year or so ago. I don’t know how I did it (after a lot of trial and error), so I cannot provide any guidance on that. I am sure you can find some on the Internet.

If you are running this on a remote server and connecting via SSH, then when setting up a VPN, you need to make sure it doesn’t block SSH connections. I used split tunneling with inclusive mode only for the real-debrid.com domain. This way, the VPN only works for accessing real-debrid domains.

Whatever VPN you setup, make sure it runs automatically on boot and is a VPN that is whitelisted by real-debrid.

Install Packages & Containers

Overseerr: Overseerr is a request management and media discovery tool built to work with your existing Plex ecosystem. If you intend to share your plex server with other users, those users can use overseerr to request movies (which you can manually approve or have them auto-approve). This is optional but if you want it, you must set up overseerr first so we can enter the token in pd_zurg.

Jackett: Jackett's a tool for searching torrent indexers. Plex_Debrid by default uses Torrentio but if you want to have more options, you can add Jackett. This improves the efficiency of plex_debrid as this has more indexers than Torrentio.

  • Ensure Docker is not currently installed. Output indicating that any of the packages aren’t found can be safely ignored.
  •  sudo apt remove docker docker-engine docker.io
  • Install Docker. Run below commands in sequence. They will install both Docker, Plex, PD_ZURG and optionally install Overseerr, Jackett, & Flaresolverr if you choose when prompted.
  • cd
  • curl -fsSL https://pastebin.com/raw/b1ymG6ay -o setup.sh
  • Optional: run below commands to convert the setup.sh to install and convert the script to Unix Line Endings:
  • sudo apt install dos2unix
  • dos2unix setup.sh
  • sh setup.sh
  • Verify Docker is correctly installed by checking the version using below command:
  • docker compose version
  • This will show the version number installed.
  • Verify Plex & Docker are set to run on Boot:
  • systemctl status plexmediaserver.service
  • systemctl status docker.service
  • Output should be enabled, enabled, (active running) for both services.


  • If you see any error message about Critical: libusb_init failed, you can ignore it as advised by plex team

Configure Plex & Containers

Configure Plex


Open Plex server using below URL. Remember this URL for all your future references.

  • Reboot your instance
  • If you already have a plex server running on your machine, you can get the token and skip the plex setup for now and finish it once we have real-debrid mounted on the server.
  • If you don’t have a plex server already running, we will have to set up a temporary work around to get the token as well as setup some settings that will improve scanning speed for when we later mount real debrid and add  folders to plex.
  • Create a temporary folder in your system somewhere. Create a movie subfolder and add a movie to it. An Actual movie file. How you do it upto you
  • I use this command to download a dolby atmos trailer and save it as Avengers movie in /plex_temp/movies/ folder:
  • mkdir -p /plex_temp/movies/ && curl -o "/plex_temp/movies/Avengers (2012).mp4" https://download.dolby.com/us/en/test-tones/dolby-atmos-trailer_leaf_1080.mp4
  • Login using your account and set up the server.
  • Open plex server at the above URL.
  • There will be a setup Wizard. Follow it. Only Add the Movie library for now and choose the temporary movies folder we created.
  • Enable the option for Allow me to access my media outside my home
  • This might require additional steps. For my Linode instance, it worked without any further steps.
  • Make sure to turn off Enable video preview thumbnails in the advanced section when adding Movie Library
  • Once the Wizard finishes, the Server will begin scanning your media and creating the Plex Library. Since we are using a temporary folder with only 1 movie, this should be quick. It will identify the Avengers movie and show it in your library.
  • Set up these things to improve scanning speed when you add the actual folders. You have to click on “Save changes” in each section before moving on to the next section.
  • In Settings > Library, click on Show Advanced first and then make these changes:
  • Enable Scan my Library Automatically" and Run a partial scan when changes are detected
  • Set Generate video preview thumbnails, Generate chapter thumbnails and Analyze audio tracks for loudness to NEVER. 
  • Change Cache Size per your preference. 512MB should be enough for a large library.
  • Disable the scheduled task perform extensive media analysis in (Settings > Scheduled tasks)
  • Set Video Quality to Maximum if you want to avoid Transcoding (Settings > Quality)
  • Get the Plex token. Visit this link from a signed in browser. If it fails, use the instructions in "Where to get the Plex token?" section here. Make note of this token as it will be needed later.

Configuring Overseerr

Skip this part, if you choose NO to installing Overseerr

  • Overseerr should already be running. You can verify that with a curl command. If Overseerr is not running, you will see an error message. If it’s running, It will give an output.
  • Open http://localhost:5055 on your machine (If you are using remotely, make sure you are connected via SSH command shared earlier)
  • Sign in with Plex.
  • Choose your server.
  • Uncheck & Check SSL once for the SAVE CHANGES button to be active.
  • Sync the library & Finish the Setup. It’s fairly intuitive. Skip the Radarr & Sonarr Options.
  • Once setup, go to settings and make note of the API Key for Overseerr. This will be used before we start the PD_ZURG container.

Configuring Jackett & Flaresolverr

Skip this part, if you choose NO to installing Jackett & Flaresolverr. Flaresolverr is needed for Jackett..

Flaresolverr & Jackett should already be running. You can verify that with curl commands. If they are not running, you will see an error message. If they are running, It will give an output.

  • Open http://localhost:9117 on your machine (If you are using remotely, make sure you are connected via SSH command shared earlier)
  • For now, let’s add a few (4-5 for starters) popular indexers and test them.If you get a Challenge detected but FlareSolverr is not configured error, that means Jackett isn’t able to connect to Flaresolverr.
  • Add flaresolver URL to Jackett in the field FlareSolverr API URL.
  • http://localhost:8191
  • Run the test again and you shouldn’t see the same error. Do a manual search of any movie to see if you are getting results.
  • Note down the API key at the top right corner.This will be used in the plex_debrid later.

Configure PD_ZURG

  • Run these command to update docker-compose.yml for pd_zurg
  • cd ..
  • cd /docker/pd_zurg/
  • ./update_docker_compose.sh
  • This will ask you a series of questions to configure pd_zurg. Configure it exactly as shown below (choose NO here for overseerr if you have not installed overseerr earlier).
  • Enter your own Real-Debrid API, Plex name and Plex Token in the red highlighted fields.These are obviously fake ones.
  • Pay special attention to the values highlighted in green boxes. These values should appear as is.
  • Make sure no extra slashes or spaces are there.


  • We need to make few more changes to the docker-compose.yml manually before launching pd_zurg
  • Open the editor using:
  • cd /docker/pd_zurg/
  • sudo nano docker-compose.yml
  • Add network_mode: host as shown, right below image and change VOLUMES section.. It should be exactly like this. Be careful about extra spaces.


  • Turn on Zurg Port to 9999 and set a Zurg username and password if you wish (by removing the # in front of them). This is optional but I like it so I can access the Zurg URL (http://localhost:9999) later. Easier to see logs and movie/show folders.


  • Save it (CTRL+X > Y > ENTER)
  • Now, we can run the pd_zurg container
  • docker compose up -d
  • Check if all your chosen dockers are running:
  • docker ps

Plex_Debrid

First time Setup

  • We now have all containers running. Verify Real-debrid is mounted. 1st command should show folders like movies, shows etc. Verify if the movies & shows in those folders are showing up using 2nd and 3rd command.
  • ls /docker/pd_zurg/mnt/rd/
  • ls /docker/pd_zurg/mnt/rd/movies
  • ls /docker/pd_zurg/mnt/rd/shows
  • Let’s add your actual movie & show folders to plex.
  • Open plex URL. Go to Settings > Manage > Library
  • Remove the temporary movie library we created and add two new libraries for movies & TV shows. Add their respective folders in each library. The folders for movies and TV shows are:
  • /docker/pd_zurg/mnt/rd/movies
  • /docker/pd_zurg/mnt/rd/shows
  • Remember to uncheck Enable video preview thumbnails while adding both the libraries.
  • This will trigger a new Plex Scan. If you have followed the settings earlier, the scan should be complete soon. May take a long time if there are too many movies & shows. Don’t proceed to the next step until the scan is completed.

Now, time to set up plex_debrid. You can attach pd_zurg to the screen using the below command and pressing ENTER twice. Remember this command for future reference.

  • docker attach pd_zurg

You will be greeted with the script. Don’t run it immediately.



  • We first need to add our libraries to Plex_Debrid. Select options using numbers
  • Settings > Library Services > Library update Services > Edit > Add library update service > Plex Libraries.
  • Add all your libraries.
  • Change the setting so plex_debrid starts on boot and not a menu:
  • Settings > UI Settings > Show Menu On Startup > false
  • You can now add overseerr users & Jackett indexer to plex_debrid using the settings.
  • Check the "Setup plex_debrid" section here if you want to familiarize yourself with the options.
  • Note: When the setup asks for a plex server address, enter http://localhost:32400/ irrespective of if your server is local or remote.
  • At the Library Ignore services step, you can choose “local ignore list”. If you choose others (Plex or Trakt and have a movie/show which is marked as “Watched” in those services, it will not download it even if you add it to watchlist).
  • You will need to enter Real Debrid Token as well, which you can get here
  • After the setup is done, run it.
  • Once it shows "checking new content ... Done", add a movie to your plex watchlist and wait for it to be added to your real_debrid account. If you add Jackett, it might take upto 2 minutes.

You can verify that the film has been added and shows up so we know our setup is working:

  • Verify it by logging into your real-debrid account.
  • An additional verification can also be done.
  • ls /docker/pd_zurg/mnt/rd/movies/abcde*
  • Here abcde represents the first 5 letters of the folder name (not movie name).
  • For example, if you added the movie The Truman show, the folder name is The.Truman.Show.1998.1080p.BluRay.REMUX.AVC.DTS-HD.MA.TrueHD.5.1-FGT, then you type ls /mnt/remote/realdebrid/movies/The.T
  • This will show if the movie is showing up or not in the movie folder. See below:

Verify the setup

Let’s verify if everything launched correctly since this is the 1st time we have set it up.

Reboot the system. Wait a minute for all services to launch. Verify each using below commands:

  • docker ps
  • This will show if all the containers are running.
  •  systemctl status plexmediaserver.service | head -n 3
  • This will show if plex is running.
  • ls /docker/pd_zurg/mnt/rd/
  • This should show multiple subfolder
  • Add any movie to your Plex Watchlist and following will happen:
  • Plex_debrid should add it to the real debrid account. You should be able to see it if you attach the container to your screen.
  • rclone mount will add it /docker/pd_zurg/mnt/rd/movies folder
  • PD_ZURG notices the change in the folder and refreshes the library on Plex.
  • Familiarize yourself with below commands for future reference.
  • You can enter plex_debrid anytime by entering this and pressing ENTER twice.
  • docker attach pd_zurg
  • Check files in a folder
  • ls /docker/pd_zurg/mnt/rd/movies
  • Edit files
  • sudo nano docker-compose.yml
  • Check out more docker commands below:
  • https://www.linode.com/docs/guides/docker-commands-quick-reference-cheat-sheet/

Hopefully, everything worked and you now can enjoy smooth streaming.

You can fine tune plex_debrid settings for version, quality, titles, size etc, set up different sources for torrents (torrentio, Jackett), and add users via overseerr, trakt watchlists etc in the settings.


For details and instructions, check:

Final Note

I am a newbie myself who has never used docker or Ubuntu except for setting this up. I was able to set up with the help of other guides. Follow my instructions at your own risk. I am not responsible for any issues this may cause.

Credits

  1. yowmamasita’s for Zurg
  2. @itsToggle’s for plex_debrid
  3. @Pukabyte’s guide on Notion for Zurg & rclone (Link)
  4. I-am-PUID-0 for combining the repos into a single container & for this guide.
  5. ChatGPT to make necessary adjustments to script & commands.