Skip to content
PhysK edited this page Jan 22, 2020 · 2 revisions

Table of Contents

  1. Intro
  2. Access Information
  3. Installing Plex
    1. Plex Local Edition
    2. Plex Remote Edition
  4. Configuring Plex
    1. Remote Access
    2. Accessing Content
    3. Optimization
  5. Configuring Hardware encoding
    1. Background and quick check
    2. CPU support for HW encoding info
    3. Host driver setup and install
  6. Summary

1. Intro

Plex... the main reason we are. Easy to set up? Ya. Complications at times? Ya. So "what does Plex do for me" you ask? Think of Plex as having your own version of Netflix, but rather through the files that you already own. Plex can be addictive, which is why we are both here. Starting off with a simple collection is rather satisfying, but then you start realizing that you're running out of drive space, running RAIDs, and now trying to push things to the cloud (or not). You're not contempt with the basic streaming services and the cable company has you boxed in! That's where Plex come into play! Before executing Plex, you have conducted some basic planning. Is the server powerful enough, how much disk space is available, and how can the server be cost effective for one's needs?

Demo Example of Running a Plex Server

2. Access Information

Protocol Address Notes
traefik** plex:32400 Only for Internal App-to-App Communication
https plex.domain.com Traefik must be Deployed; Remote Servers
http domain.com:32400 Poor Security Practice - Stop with PTS Port Guard
http ipv4:32400 Ideal Only for Local Servers

** Ideal for Apps to communicate between with one another. Click Here for more info!

3. Installing Plex

Welcome to the crossroads! When executing Plex to install, you will be presented with a question in order to install either the remote or local edition. This part is important because it will affect in how you will be able to claim your Plex Server. If you select the local edition, you will easily be able to claim your Plex Server, whereas the remote setup will allow you to claim your Plex Server through an IP address. So please, select the correct one!

I. Plex Local Edition

Installing the Plex Local Edition is simple. Once installed, you will see the following message.

Plex Local Edition

Here, you will simply visit your local IP address and you should see Plex asking for you to login. Once logged in and your able to claim your server, you are pretty much good to go! If your intent is to share out your server or utilize your server beyond the range of your home (or that of your local server), make sure to turn on your remote access. If you are unable to see your server outside of your local location, pay attention to tips provided. Anything beyond that, please visit our forums or the Plex Forums to resolve your issue.

II. Plex Remote Edition

a. PTS YouTube: Remote Setup

Plex Remote Setup

b. Remote Setup Info

Installing the Plex Remote Edition is a-bit more involved, but easy to do if you follow the provided steps. Before Plex Deploys, you will see a screen that will ask about your Plex ID. Visit https://plex.tv/claim and claim your Plex Server Code and paste and press enter within the terminal window.

Plex Claim Ask - Terminal

Now that you entered your code, PTS will prompt you with some more information. You will need to visit: IP Address:32400/web. Do not forget the /web (if you do, you may see some Plex XML garbage and will start to ponder how to ask us a 1000 different ways to access your server).

Ensure to follow the steps as listed to ensure that your able to access your server. It is recommended that if you are having issues, test out with a second device and see if you can access PLEX. Personally, it has been witnessed that PLEX will say your server is not able to get out and then with your phone, you can see it.

4. Configuring Plex

This is the fun part! We'll tackle this portion in two ways. First, we will configure Plex to access your content and then the second part will be in regards to optimization.

Please connect radarr and sonarr to plex in the connect settings page inside of radarr/sonarr to enable autoscans!

I. Remote Access

You can safely disable plex's built in remote access and still access it via your plex.domain.com Disable remote access:

Then under network settings, click show advanced at the top. Then add your plex domain

II. Accessing Content

In the use of all PlexGuide editions, you will access your content as shown below. The best recommendation I can tell you is not to select your location, but rather type it. Here are some examples below:

Type it, do not select it

  • /mnt/unionfs/tv
  • /mnt/unionfs/movies
  • /mnt/unionfs/mycustomcategory

Type it, do not select it

Press [ENTER] and it will come up!

III. Library Settings

Show Advanced settings

Plex Library Setting Value
Scan my library automatically ☐ Unchecked
Run a partial scan when changes are detected ☑️ Checked
Custom server access URLs ☐ Unchecked
Scan my library periodically ☐ Unchecked
Library scan interval daily
Empty trash automatically after every scan ☐ Unchecked (recommended until you are stable)
Allow media deletion ☑️ Checked
Generate video preview thumbnails never, not recommended to enable, will cause 24hr bans
Generate chapter thumbnails never, not recommended to enable, will cause 24hr bans
Analyze audio tracks for loudness never, not recommended to enable, will cause 24hr bans
Location visibility admin only

5. Configuring Hardware Encoding

NOTE: You MUST have Plex Pass to enable hardware transcoding in the Plex server. See Using Hardware-Accelerated Streaming from the Plex site.


Background/quick check:

This assumes your server has a CPU with iGPU or GPU that can do hardware transcoding. If you do, and the drivers are already installed, then the fix to get it working inside the Plex Docker container isn't too difficult.

Bottom line up front: If the hardware and drivers aren't installed on the host, it won't work inside the Docker container. If they are, I'll show you how to ensure they're available inside the Docker container as well.

You can do a quick check to see if the drivers are already installed by "ls -la /dev/dri"; you should see something for "card0" and "renderD128" if they are. --If you have multiple GPUs, including an integrated (iGPU) and a discrete (i.e. nVidia or AMD) you'll probably see additional files labeled "card1" and "renderD129". This won't matter, but we also will only use one card. If the driver files don't exist you'll likely get an error saying the directory doesn't exist, or maybe drivers for other non-GPU/iGPU devices. That's fine - the "Host Install" sections will show you how to "activate" them. If they are, and you're sure, you can skip the next part in between the dashed lines and move to how to enable inside the Docker container.


CPU support info

Does my Intel CPU include an iGPU capable of Quick Sync?

Most "desktop" class CPUs from Intel starting with the second series (i.e. "Sandy Bridge" or the 2500/2600 CPUs) have an iGPU that is capable of at least h264 hardware transcoding.

  • The Sandy Bridge (2xxx series) through Haswell (4xxx) series don't have great quality when hardware transcoding h264 - but they do work.

  • Skylake (6xxx) and higher will even do h265/HEVC.

  • Kaby Lake (7xxx) and higher will do h265/HEVC with HDR/10bit video.

Skylake and higher look GREAT when using hardware encoding - virtually indistinguishable in quality from CPU encodes, but with 5% of the CPU usage.

I have a Xeon - will it work? Some Xeons do have iGPUs. Notably those that end in a "5" or "6".

How can I confirm? Fast check: Intel's Quick Sync capable CPU search page Search for your CPU.

or

Wikipedia's table for Intel Quick Sync hardware encoding and decoding by Intel family For example, using a Xeon E5-1650v3. Look for the E5-1650v3 series. This is a "Haswell" class CPU, but it was sold as a workstation CPU so note there is no "Graphics Clock Rate" column, because they didn't have iGPUs. (They also didn't come with heatsinks, as the users were expected to add discrete GPUs and their own heatsink.)


Host Install

(Specific instructions and examples below are for a Hetzner dedicated server however much is useful for others as a guide):

For Hetzner server users, the following is how to get the drivers and capability installed on the Linux host.

  • Comment out all line referencing i915 in this file: /etc/modprobe.d/blacklist-hetzner.conf

    • sudo nano /etc/modprobe.d/blacklist-hetzner.conf
    • Add a # in front of the lines "blacklist i915" and "blacklist i915_bdw"
    • # blacklist i915
    • # blacklist i915_bdw
  • Remove Hetzner's default grub config "nomodeset" which blocks loading of video card drivers:

    • Ubuntu 16 or earlier: nano /etc/default/grub.d/hetzner.cfg or
    • Ubuntu 18.04 or later: nano /etc/default/grub
    • comment out GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" (it's okay if it also has consoleblank=0 at the end."
    • # GRUB_CMDLINE_LINUX_DEFAULT="nomodeset consoleblank=0"
  • Update and Reload grub.

    • sudo update-grub
    • For older Ubuntu try sudo grub-mkconfig -o /boot/grub/grub.cfg
  • Add user root (or whoever is the user running the Plex service) to the video group:

    • sudo usermod -a -G video root
  • Reboot the server

  • Try ls -la /dev/dri now it should find the folder and list drivers

  • Type chmod -R 777 /dev/dri to change permissions (critical step for use in Docker!)

  • I recommend installing and running vainfo and ensure it gives you a positive readout on your driver

    • sudo apt update
    • sudo apt install vainfo
    • vainfo
      • You want a line similar to "vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Server - 1.7.0" somewhere in the 18-20 lines it puts out.

Note: If VAINFO works, it's almost a sure bet you'll be able to get the Docker Plex to work. However, as long as the /dev/dri folder with the two driver files are there, you're probably okay even if running VAINFO throws an error.


Getting it working (optimally) inside Docker.

The following updates to the Plex Docker container are not strictly necessary - but recommended.

You'll need to run the following commands from the HOST (to make it easier for you):

  • docker exec plex apt-get -y update
  • docker exec plex apt-get -y install i965-va-driver vainfo
  • docker restart plex

That updates the driver now that it can get to the files outside the container.


Additional tips/tricks:

The following command should give a succinct info read on your iGPU:

GPU=$(lspci | grep VGA | cut -d ":" -f3);RAM=$(cardid=$(lspci | grep VGA |cut -d " " -f1);lspci -v -s $cardid | grep " prefetchable"| cut -d "=" -f2);echo $GPU $RAM

For example, on one of the dedicated servers I use (an Intel Xeon E3-1246V3), the output is: Intel Corporation Xeon E3-1200 v3 Processor Integrated Graphics Controller (rev 06) 256M

However on a non-dedicated VPS I use the output is: Cirrus Logic GD 5446 32M (Yeah...the emulated Cirrus Logic isn't going to work for hardware encoding.)

6. Summary

Keep in mind to monitor your Plex Server at times. Ensure that you always have enough diskspace for transcoding and keep in mind that if your server is distant, many of your issues can be related to one common medium known as the Internet (slow downs along the way). Best of Luck!

Useful Starter Links

  1. Introduction
  2. G-Suite Signup
  3. Recommended NewsHosts
  4. Change Log

Prior Planning 101

  1. Recommended Pre-Reading
  2. Server - Storage Planning
  3. Usenet or BitTorrent
  4. PTS Editions
  5. PTS Folder Structure
  6. PTS-Repos
  7. Common Issues

Deploy & Config

PTS-Team
  1. SSH Server Access
  2. Install PTS
  3. WatchTower
  4. Remote Path Mappings

Data Transport
  1. PTS Clone
    1. Google OAuth Keys
    2. PTS Move
    3. PTS Blitz
    4. 2nd HD Option

Key Components

  1. Traefik
  2. Port Guard
  3. PTS Shield
  4. PTS Press
  5. Google Cloud - GCE
    1. Automated setup
  6. Hetzner Cloud
  7. PTS Fork
  8. Extra PTS Commands

Blitz App Info

  1. Accessing PTS Apps
  2. App Port Scheme

Tools & Services

Core Apps [Expand]
  1. Emby
  2. Jackett
  3. Jellyfin
  4. LazyLibrarian
  5. Lidarr
  6. Netdata
  7. NZBGet
  8. Ombi
  9. Plex
  10. Portainer
  11. qBittorrent
  12. Radarr
  13. Radarr4k
  14. RadarrHDR
  15. RuTorrent
  16. SABnzbd
  17. Sonarr
  18. Sonarr4k
  19. SonarrHDR
  20. Tautulli
  21. JDownloader2
Community Apps [Expand]
  1. AirSonic
  2. Bazarr
  3. Bitwarden
  4. BookSonic
  5. cAdvisor
  6. Cloud Commander
  7. Deluge
  8. DelugeVPN
  9. Dozzle
  10. Duplicati
  11. Filebrowser
  12. FlexGet
  13. Gazee
  14. Headphones
  15. Heimdall
  16. HomeAssistant
  17. jd2-openvpn
  18. Kitana
  19. Logarr
  20. MakeMKV
  21. MariaDB
  22. McMyadmin
  23. MEDUSA
  24. Mellow
  25. Miniflux
  26. Monitorr
  27. Muximux
  28. Mylar
  29. NextCloud
  30. NowShowing
  31. NZBHydra2
  32. Organizr
  33. plpp
  34. pyLoad
  35. qBittorrent
  36. QBittorrent VPN
  37. radarrsyncarr
  38. Resilio
  39. rflood-openvpn
  40. rutorrent-openvpn
  41. Shoko Anime Server
  42. SpeedTest
  43. SyncLounge
  44. Teamspeak3
  45. The Lounge
  46. Transmission
  47. Trakt.or
  48. Ubooquity
  49. Varken
  50. vnc-xfce
  51. vnstat
  52. ZeroTier

Misc Info & Articles

  1. Change Server Time
  2. Fail2Ban
  3. Custom Containers
  4. Deploying Varken, Influx, Telegraf, Grafana
  5. cloneclean commands
  6. Understanding htop
Scripts
  1. Scripting Area
    1. Auto Upload for Sonarr and Lidarr
    2. Auto Delete Log
    3. Plex Plugin DB Backup
    4. Plex fast BACKUP
    5. Delete All Unmonitored from Radarr
Clone this wiki locally