0% found this document useful (0 votes)
89 views6 pages

Plex - ArchWiki

This document summarizes information about Plex, a media player system consisting of client applications and a media server. The Plex server is split into a closed-source Plex Media Server and an open-source Plex Home Theater client. It provides instructions for installing the Plex Media Server on Arch Linux, configuring it with options like custom domains and Nginx reverse proxies, using plugins and Live TV/DVR, managing security and resources, and opening necessary ports.

Uploaded by

k1ko_mkd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views6 pages

Plex - ArchWiki

This document summarizes information about Plex, a media player system consisting of client applications and a media server. The Plex server is split into a closed-source Plex Media Server and an open-source Plex Home Theater client. It provides instructions for installing the Plex Media Server on Arch Linux, configuring it with options like custom domains and Nginx reverse proxies, using plugins and Live TV/DVR, managing security and resources, and opening necessary ports.

Uploaded by

k1ko_mkd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Plex - ArchWiki https://wiki.archlinux.

org/title/plex

Plex
Plex (https://www.plex.tv/) is a media player system and software suite consisting of many player
applications for 10-foot user interfaces and an associated media server that organizes personal media stored
on local devices. Integrated Plex Channels provide users with access to a growing number of online content
providers such as YouTube, Vimeo, TEDTalks, and CNN among others. Plex also provides integration for
cloud services including Dropbox, Box, Google Drive, or Copy.

Plex for Linux is split into a closed-source server Plex Media Server, and an open-source client Plex Home
Theater, a fork of the popular Kodi project.

Contents
Plex Media Server (PMS)
Installation
Setup
Custom domain
Nginx reverse proxy
Plugins
Plex Live TV and DVR
Hauppauge
Security
Resource management
Network
UFW Rule
Library Updates
Troubleshooting
Plex's WebUI returns 404
Plex Home Theater (PHT)
Installation
Plex Media Player (PMP)
Installation
Kodi and PleXBMC
Installation

Plex Media Server (PMS)

Installation

Install plex-media-server (https://aur.archlinux.org/packages/plex-media-se


rver/)AUR (stable update channel) or plex-media-server-plexpass (https://aur.archli
nux.org/packages/plex-media-server-plexpass/)AUR (beta update channel). The latter is

1 of 6 12/19/21, 14:25
Plex - ArchWiki https://wiki.archlinux.org/title/plex

only available to Plex Pass subscribers and can provide early access to improvements and/or new
functionalities, but also early access to potential bugs. Even though the beta update channel is typically quite
stable, it is recommended to install the stable release unless you require specific early access content (release
notes (https://forums.plex.tv/t/plex-media-server/30447/430)).

Setup

Start/enable the plexmediaserver.service systemd unit.

To begin configuring the Plex Media Server, browse to http://localhost:32400/web/.

To configure Plex Media Server remotely, you can first create an SSH tunnel (setup can only be done from
localhost )

ssh ip.address.of.server -L 8888:localhost:32400

and then browse to http://localhost:8888/web/ .

or if you are running apache, with a reverse proxy, by adding this configuration in httpd-vhosts.conf

<VirtualHost *:80>
ServerName ip.address.of.server
ProxyPass / http://localhost:32400/
ProxyPassReverse / http://localhost:32400/
</VirtualHost>

Custom domain

Nginx reverse proxy

Below an example server configuration is given for a reverse proxy using Nginx, including certificate
configuration.

/etc/nginx/sites-available/domain.com.conf

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name media.domain.com;

# SSL
ssl_certificate /etc/letsencrypt/live/media.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/media.domain.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/media.domain.com/chain.pem;

# logging
access_log /var/log/nginx/media.domain.com.access.log;
error_log /var/log/nginx/media.domain.com.error.log warn;

# reverse proxy
location / {
proxy_pass https://localhost:32400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

# HTTP redirect
server {

2 of 6 12/19/21, 14:25
Plex - ArchWiki https://wiki.archlinux.org/title/plex

listen 80;
listen [::]:80;
server_name media.domain.com;
include nginxconfig.io/letsencrypt.conf;

location / {
return 301 https://media.domain.com$request_uri;
}
}

Plugins
PMS can be expanded with additional plugins. For example, PMS can be used as an IPTV client with the
IPTV plugin (https://github.com/Cigaras/IPTV.bundle).

Plugins can be installed inside /var/lib/plex/Plex Media Server/Plug-ins .

Plex Live TV and DVR


Plex live TV requires a plexpass.

To enable live TV viewing and DVR support with plex, you must have one of the supported tuners listed on
the support page (https://support.plex.tv/hc/en-us/articles/225877427-Supported-DVR-Tuners-and-Ant
ennas). PMS will automatically recognize any connected tuners.

The plex user needs to be part of the video group in order to access local tuners. This can be done by running
usermod -a -G video plex

To enable IPTV support via m3u playlist install xTeVe (https://aur.archlinux.org/package


s/xTeVe/)AUR.

Hauppauge

The drivers for all Hauppauge tuners have been included in the Linux kernel for some time now (e.g. ~v4.7
for WinTV-DualHD), however the firmware isn’t loaded by default. Look for a kernel message:
firmware file ‘dvb-demod-siXXXX-YY.fw’ not found by e.g. starting a tail with
dmesg -w and enable/insert the (USB) tuner device. If missing, download the respective firmware file (ht
tps://github.com/OpenELEC/dvb-firmware/blob/master/firmware/) and copy it file to /var/lib/ .

Security
It is recommended to store your media files outside of your home directory, as making it accessible to PMS
would mean lowering its security. Having a separate /media or /mnt/media partition is a good setup
for use with PMS.

You can further increase security via systemd, by editing plexmediaserver.service as follows:

/etc/systemd/system/plexmediaserver.service.d/restrict.conf

[Service]
ReadOnlyPaths=/
ReadWritePaths=/var/lib/plex /tmp

3 of 6 12/19/21, 14:25
Plex - ArchWiki https://wiki.archlinux.org/title/plex

Note: Those mechanisms are currently limited. For instance, ReadOnlyDirectories do not apply to any
submount, you have to list them as well.

Resource management
Originally, PMS used ulimit to limit its allocated resources, however this is not compatible with running as a
regular user. Instead, you can now set a maximum amount of memory via, again, systemd. For example, you
can add:

MemoryMax=4G

to the file mentioned above.

Network
Note: PMS supports both IPv4 and IPv6. This section only assumes the use of IPv4.

PMS and its DLNA server require several ports to be open:

▪ Plex Media Server: TCP 32400


▪ Plex DLNA Server: TCP 32469, UDP 1900
▪ Network Discovery: UDP 32410, 32412, 32413, 32414
▪ Bonjour/Avahi Network Discovery (legacy): UDP 5353

A short example with iptables:

# iptables -A INPUT -p tcp -m multiport --dports 32400,32469 -j ACCEPT


# iptables -A INPUT -p udp -m multiport --dports 1900,32410,32412,32413,32414 -j ACCEPT

In order to connect to Plex through on a standard http port, this command can be used (for port 8080):

#iptables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 32400

Then you can connect directly to http://yourplexaddress:8080 on this port

UFW Rule

If you use UFW and would like to create an App List entry for Plex, create/edit
/etc/ufw/applications.d/plexmediaserver and ensure it contains the following content:

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
ports=1900/udp|32469/tcp

[plexmediaserver-all]
title=Plex Media Server (Standard + DLNA)

4 of 6 12/19/21, 14:25
Plex - ArchWiki https://wiki.archlinux.org/title/plex

description=The Plex Media Server (with additional DLNA capability)


ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp|1900/udp|32469/tcp

Once you have saved the file, reload the UFW application definitions with:

# ufw app update plexmediaserver

And then finally allow the Plex app with:

# ufw allow plexmediaserver-all

Library Updates
Plex Media Server has a setting "Update my library automatically" which can detect new media files as they
are downloaded to your library. But as your library grows, these updates might stop working reliably. To fix,
you need to increase the number of files non-root users are allowed to subscribe to via inotify. Create the file
/etc/sysctl.d/40-max-user-watches.conf

/etc/sysctl.d/40-max-user-watches.conf

fs.inotify.max_user_watches=524288

and run sudo sysctl --system to apply without rebooting. Now plex should see any new files.

Troubleshooting
Logs are located in:

/var/lib/plex/Plex Media Server/Logs

In case there are no logs or they are not helpful, you might want to launch PMS manually to get some
terminal output:

sudo -u plex /usr/bin/bash


source /etc/conf.d/plexmediaserver
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver
/usr/lib/plexmediaserver/Plex\ Media\ Server

Plex's WebUI returns 404

There may be a situation when updating Plex's WebUI will return 404 Not Found. To fix this you just need
to restart plexmediaserver.service .

Plex Home Theater (PHT)


Previously known as Plex Media Center, Plex Home Theater is the software component used for a long time
as the front-end media player for Plex's back-end server component Plex Media Server. This component came
from a fork of XBMC Media Center software on May 21, 2008.

5 of 6 12/19/21, 14:25
Plex - ArchWiki https://wiki.archlinux.org/title/plex

Official support for Plex Home Theater (from Plex, Inc.) has been discontinued in favour of Plex Media
Player (based on MPV). However, Plex Home Theater was forked and has been developed further by the
Open Source community under the name OpenPHT (https://github.com/RasPlex/OpenPHT)

Installation

Install the openpht (https://aur.archlinux.org/packages/openpht/)AUR package.

Plex Home Theater can be launched by running plexhometheater.sh from your terminal.

Plex Media Player (PMP)


Plex Media Player is the current release of Plex's media client. It has officially replaced #Plex Home Theater
(PHT) (which is still receiving bug fixes) and builds upon previous functionality, such as using mpv. Plex has
made PMP available (https://www.plex.tv/blog/plex-media-player-now-ambidextrous-free-kodi-said/) to
all users and it has also become compatible with Kodi. Keep in mind, PMP is not open-source (https://foru
ms.plex.tv/t/plex-media-player-open-source-contributions-and-building-faq/119290) (unlike PHT).

Installation

Install the plex-media-player (https://aur.archlinux.org/packages/plex-media-


player/)AUR package.

Kodi and PleXBMC


With the PleXBMC add-on, Kodi can be used as a replacement for PHT.

Installation

Install the kodi (https://archlinux.org/packages/?name=kodi) package, then follow the


instructions over here (https://kodi.wiki/view/Add-on:PleXBMC).

Retrieved from "https://wiki.archlinux.org/index.php?title=Plex&oldid=699999"

This page was last edited on 26 October 2021, at 08:12.

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.

6 of 6 12/19/21, 14:25

You might also like