Plex Media Server
Plex Media Server is a user-friendly way to store all your movies, shows, and other media in one place–and make it accessible from any device, whether you’re at home or on-the-go. If you’re looking for a no-headache way to watch your movies anywhere, this is it.
Plex
Ultra.cc Plex requires Secure connection to be at least set to Preferred in Plex Media Server settings or you will face the error "Can't connect securely".
Plex Media Server is a proprietary media player suite that organizes video, audio, and photos from a user's collections and online services, enabling the user to access and stream the content from the server from any device.
You can learn more about the app in this link.
In this section, we will be detailing the initial configuration of your Plex Media Server. This assumes that you have stored your media in ~/media
.
Our Plex installation automatically creates your media folders inside ~/media
as follows:
~/media/Movies
~/media/TV\Shows
~/media/Music
No further step needed, although if you require to change your libraries path in Plex you can read guide about it [here].
Prerequisites
- A Plex account - you can make one at https://plex.tv.
- A media server(Plex) supported Ultra.cc plan.
Initial UCP Configuration
Like all applications, Plex Media Server is installed from the Ultra.cc Control Panel, this application, however, has one extra step. When you click on Install and are prompted with this screen, you will need to visit https://www.plex.tv/claim/
If you have not done so already, sign in to your Plex account and copy the claim code provided. Paste this into the prompt and then click Install.
Your Plex Media Server is also configured out of the box. Just connect to your Plex Media Server instance by following the link in the UCP - as is typical with all your other applications.
Plex Plug-in Installers
Listed below are scripts that install some of the popular Plex Plug-ins into your PMS instance. To use it, just run the commands of the plug-ins that you need on your service's SSH terminal and access your Plex afterward. Some post-installation notes are detailed on each plug-in.
Absolute Series Scanner/Hama Bundle
curl https://scripts.usbx.me/main/Plex/Plex-Plugins/hama-ass.sh | bash
Post Installation
- More info here: https://github.com/ZeroQI/Hama.bundle
Extended Personal Media Shows
curl https://scripts.usbx.me/main/Plex/Plex-Plugins/epms.sh | bash
Post Installation
- More info here: https://bitbucket.org/mjarends/extendedpersonalmedia-agent.bundle/src/master/README.md
Trakt.tv Scrobbler
curl https://scripts.usbx.me/main/Plex/Plex-Plugins/trakt.sh | bash
Post Installation
- More info here: https://github.com/trakt/Plex-Trakt-Scrobbler
Get SSL-URL for Plex Media Server
- This can be useful if you wish to connect to Plex from a remote device.
- Connect to your service via SSH. How to connect to your Ultra.cc slot via SSH
- Execute the following SSH command:
bash <(wget -qO- https://scripts.usbx.me/main/Plex/plex-ssl-url.sh)
Troubleshooting Information
How do I update Plex?
Our Upgrade/Repair Plex image is locked to a version/image we deemed as stable. This is due to some clients reporting issues on the newest Plex releases.
To upgrade to the latest Plex, you can do this via SSH. You may refer here to how to upgrade your Plex to the newest version.
My Plex is down. What are some Troubleshooting Steps to resolve it?
Usual causes of this are Plex updates, or the server cannot read or write to the library, which is a common occurrence with rclone mounts. In these cases, the RAM usage of Plex would go up, and the system will kill your Plex instance.
It's also worth mentioning that some of Plex's features, especially logins, Server Claiming API, and Web apps, are hosted by Plex. Please check here for any announcements on their system: https://status.plex.tv.
- First, try to restart Plex and see if it returns after 5 minutes.
- Check if the container is not damaged. Try to use the upgrade/repair option from your UCP action menu under Installed Applications -> Plex and wait for 5 minutes.
- Try to claim your server again, as your server token is expired. Visit https://plex.tv/claim to get your claim code. Then, use the Claim option from your UCP action menu under Installed Applications -> Plex. Paste your code and click claim.
- If it's still not running, log in to your slot's SSH and run the following command:
ps aux | grep [p]lex
- If it returns any sort of "D" state or
<defunct>
, something is holding the Plex process.- If Plex is Defunct, this is usually caused by a broken rclone mount. To fix that, you may visit this guide here and restart Plex after. After restarting the mounts and Plex, run
ps aux | grep [p]lex
, and if it returns nothing, your Plex is running normally. If not, repeat the guide. - If it is still D state, then another 3rd party app is holding the process. Stop any application that is affiliated with your instance of Plex.
- If
grep
returns normally, is not in a defunct state, but you cannot access Plex, your Plex database may be corrupted, and you may need to view the logs. You can either run the following command on SSH and look for any errors. You can also download your logs via https://app.plex.tv in your Plex settings.
- If Plex is Defunct, this is usually caused by a broken rclone mount. To fix that, you may visit this guide here and restart Plex after. After restarting the mounts and Plex, run
cat .config/plex/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server.log
- Any SLOW QUERY and SQLite errors/warnings are signs of a corrupted database. You may attempt to repair your database, as stated by the guide here.
- If it doesn't work, the last resort is to back up your old configuration to confirm that your database is corrupted and see if Plex comes online with a new configuration. Execute the following commands:
mv ~/.config/plex ~/.config/plex.bak
- Then afterward, reinstall Plex. If it runs, you may need to do a fresh install of Plex.
Why is Plex producing a transcoder error?
The Plex Transcoder exited error is a general error for not playing back the media using the video player or transcoder, and you may need to view the logs. You can either run the following command on SSH and look for any errors. You can also download your logs via https://app.plex.tv in your Plex settings.
cat .config/plex/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server.log
The most common bug was found recently is that we overlooked that the installer did not mount /transcode
with .config/plex/transcode
correctly, which results in the following error in your log:
ERROR - Error creating directory "/transcode": Permission denied
This can be resolved by running the following command:
app-plex upgrade
ERROR - ERROR - An error occurred reading the file: /homeXX/username/SOMEMOUNT/path/to/File.mp4 (5).
Something is wrong with your mount, and this will need to be troubleshot separately. In this case, it is usually Error 403: Rate Limit Exceeded
, rateLimitExceeded
, or a wholly dropped mount endpoint.
Extra Guides
Upgrading/Downgrading Plex by Specific Version
app-plex upgrade --plex-version=<version number>
- This allows you to specify any version of Plex from v1.15 onward.
- Take note that you have to put in the full version number of the build you want to install, or the command will fail.
- You can refer to Plex's Official Docker Hub Page or LinuxServer.io's Plex Docker Hub Page for the version number you want.
- For instance, if you want to install version 1.20.3.3483. After checking for the full version on the Docker Hub page, you will run the following
app-plex upgrade --plex-version=1.20.3.3483-211702a9f
Plex SQLite
The Plex SQLite binary is accessible from your Ultra.cc service, and can be useful for managing or repair a corrupted Plex database. To access the utility tool, follow the below instructions.
- Connect to your Ultra.cc service via SSH.
- Once connected, execute the below command for usage instructions:
plex-sqlite --help
- Do note, this is an advanced utility tool, make sure to read up on how it works before use. More information can be found here.
How Plex performance is affected
Those not familiar with Plex maybe confused on what factors come into play. This document exists in the hopes to cover most of the factors that can affect playback via Plex and other media server applications. These can be split into two categories, Local and Ultra.
Ultra.cc issues are issues we may be able to assist with. Peering (in some case, more explained below) Disk utilization, Disk abuse, Client misconfiguration.
So with some of the regular problems listed let us address each one and what they mean and their affect.
Factors outside of Ultra.cc control
Peering
What is peering?
Think of peering like a car journey, Data must travel from your slot to your home or wherever you might be sending it. If the roads leading to your home are a ton of broken down back roads that’s going to slow you down. Ultra has no control of your ISP and the “roads” they offer to you. Good peering means a fast quiet road between the two points.
As mentioned below it is possible in some cases to re-route your traffic from your ISP and Ultra.cc however it is not always effective as your ISP will always play a part if we have no other transits that your ISP use then re-routing will not be possible. In some cases even after a re-route there will be zero improvement again this out of our control and purely down to your ISP’s transit lines
As you can imagine peering to ultra.cc is very important for high quality playback of media files the more direct the peering the better your experience will be.
Transcoding
What is Transcoding?
Transcoding is the act of adjusting a media file On-the-Fly to better suit the client device, eg TV, Cell phone, Games console.
Transcoding will usually be fine as long as it is too drastic an adjustment, changing the audio from 7.1 surround sound to standard AAC stereo will have a very very small impact on playback as this is a fairly light task for the server, this leaves the client device happy and you end up with very comfortable playback.
There is the other side of the coin however and this is where the issues arise.
Let me give you a scenario, you have your home movie in 4k but you go to a friends house who has a roku TV stick for example. The roku cannot handle the 4k video so plex will attempt to transcode this (depending on client/server setup. More on this in “Client misconfiguration”) This creates stress for the server and so you may find that performance becomes terrible. Transcoding will also decrease quality of the playback, it could create artificing (odd colours, bright squares, Jumbled frames).
Avoiding these issues:
There are a few things you can do to try to avoid transcoding. The first would be to make sure each client you use is set to original quality. This will vary between clients but the options will be exactly the same.
Step 1: Go to Plex Settings.
Step 2: Go to Video settings
Step 3: Go to Remote Quality on the right hand side of the page
Step 4: Select Original Quality
This will force plex to “Direct Play” (Without transcoding) Wherever possible.
Additionally you can ensure you media is already added to plex in the most compatible formatting possible:
The specification is as follows:
-
Container: mp4
-
Resolution: 1920x1080 or lower
-
Video codec: H.264 (level 4.0 or lower)
-
Framerate: 30 fps (bit depth: 8)
-
Audio Codec: AAC (2 channels)
-
Bitrate: 20 Mbps or lower
Client compatibility
Plex is available on a massive number of devices and as such some work better then others. Plex will be doing most of the hard work so client requirements are low. The key feature of a client will need to be compatibility with your main choice of media container. For example, MKV or MP4. This comes back to the transcoding section above. The more compatible the client the less likely you will need to transcode.
Specific client information
Please note if a device is capable of doing so then it is always recommended to connect via hard-line Ethernet to rule out speed loss from using WI-FI. Older Smart TV's maybe an exception to this, please check your TV manual and the section below for more infomation.
Firestick 4k:
The firestick 4k is limited to 20 Mbps under with some video containers most notability h.246 format.
FireCube:
The FireCube is limited to 30 Mbps under with some video containers most notability h.246 format.
Various smart TV’s:
As mentioned above wired connections are recommended however some TV’s will have a slower ethernet connection then their Wi-Fi. For example 100Mbps instead of 1000Mbps. Please consult your TV manual for specifications of your ethernet port.
Older smart TV’s are unable to use Plex with Secure connection turned on
The solution is to set secure connection to preferred via the app on your smart tv. Ultra.cc Plex requires Secure connection to be at least set to Preferred in Plex Media Server settings or you will face the error "Can't connect securely".
Chromecasts:
Chromecasts are known as the worst device for plex, even the latest google TV is known to suffer on anything over 25-30 Via wireless or wired connection. so 1080p ends up being just playable. 4k is unlikely to work at all. Once again h.246 and HEVC content are the most complicated formats to deal with for this device.
Apple TV 4k:
The Apple TV 4K is a common choice, with one caveat being the lack of TrueHD/DTS-HD passthrough, so Plex will have to transcode it. You can use a third-party client like Infuse, which can decode those codecs. Both 7.1 audio tracks and PGS subtitles are known to cause transcoding as the apple tv does not natively support either. 1080p WMV is reported to crash the Plex application on the Apple TV however this has not been mentioned with Infuse.
PlayStation 4/5:
Much like the Chromecast the PlayStation platform has suffered from poor design and implementation it cannot support native H.265 playback because Sony, have not added H.265 support to the console. This maybe different for the ps5.
Xbox Series S/X:
The Series S/X is known to face issues playing 4K HDR and no Dolby Vision support however the Series S/X does support formats like H.264/H.265.
Roku Express/Ultra:
The Roku series has been reported as a better alternative to the likes of a Amazon 4k Stick, It does not support 7.1 surround sound but will play a number of 4k supported containers like H.264/H.265.
Ipad:
You are unlikely to encounter this issues however it is reported that the plex IOS application will not play vc1 format media. This is a reasonablily old format so this is expected but should you have such files it is recommended you use another device.
Client misconfiguration
As mentioned above some plex configuration will be required out of the box. Plex by default will be set to transcode which will hopefully be unnecessary if you have read the previous parts of this guide. It is best to ensure that plex is set to play original quality using the steps above.
There are some extra steps you can take to ensure plex’s impact on your servers disk is minimal which will not only improve you experience but also show consideration for any users you may share the disk with.
Plex
Settings ⇾ Library
-
Scan my library periodically: Daily
-
This lessens the disk impact as scanning is a fast-acting Input/Ouput task.
-
You can set this down to 6 hours if necessary.
-
You may also use Sonarr/Radarr's Connect to update your libraries if there are any new episodes/movies uploaded with periodic scanning daily.
-
-
Generate video preview thumbnails: never
-
Generate intro video markers: never
-
Generate chapter thumbnails: never
-
Analyze audio tracks for loudness: never
- The following settings do a full scan of the file and are only used to create intro markers, generate thumbnails and analyze the audio track of each file. This can be left on if you so wish.
Plex
Settings ⇾ Video
Remote Quality: Original Quality
- This ensures transcoding does not occur unnecessary.
Cloud based Storage
Cloud storage if used with plex can cause a large number of issues. If you have not followed the application optimization document it is possible you hit the API limit (This is the number of times files can be read), you can think of this like a USB drive that can only be read 10 times per day once you read it 10 times you then have to wait 24 hours from the last time you plugged it in before you can use it again. API works a lot like this so if your applications are reading your cloud heavily you could be cut off for 24 hours, this will cause plex to become non functional because it can no longer read the storage.
To prevent this, you can follow these steps to minimise the effects, however if you have a heavy day of viewing or importing these steps will not be able to help you. You will have to wait out the 24 hour period. rclone Optimizations for Apps
You can also take a look at your logs should you be running an rclone based mount, their location is ~/scripts
if you see read errors this indicates a API block and such plex will fail likely with Transcoder failed error
.
Factors Ultra.cc can assist with
Disk utilisation
In rare cases Plex could become incredibly slow and none of the previous issues are the cause. This could point to disk utilization being far to high, its possible a task you are running is the cause. You can check this for yourself If you are on a HDD based plan. It’s also possible someone is abusing the disk and causing issues.
iostat -xk 2 $(findmnt -T ~ | awk 'END {print $2}')
Pay attention to the last column %util.
If this is 100% after a few minutes, the disk is entirely saturated, affecting performance. You can open a ticket at this point https://my.ultra.cc/submitticket.php and the Ultra.cc team will investigate as soon as possible
Client misconfiguration
If you are stuck with your plex client configuration it is impossible to help you directly as this has to be done on the device, which Ultra staff will have no access too, However it is possible to ask for advice either via ticket or via our community Discord.
Peering (In certain cases)
Peering is something we MAY be able to assist with due to owning our own transit lines we are able to re-route some connections via new lines improving your peering. Currently this is a work in progress and will require a ticket and MTR test which can be performed here: Network Tools and Speedtest