Installing Plex on CentOS 7 to Create Your Own Home Entertainment

Publish: 2018-11-19 | Modify: 2018-11-19

Plex can store images, audio, videos, and other files in one place, allowing you to play them anytime, anywhere on your PC or mobile device. It is perfect for creating your own home media library.

Plex

Installing Plex

Plex consists of two parts: the server-side, where you store your video files, and the client-side. Plex supports multiple platforms for both the server and client. Let's start by installing the server.

Plex Server download link: https://www.plex.tv/zh/media-server-downloads/#plex-media-server

This article uses CentOS 7 as an example. Plex provides RPM packages, making the installation process very simple. Just copy and run the following commands:

# Download the RPM package
wget https://downloads.plex.tv/plex-media-server/1.13.9.5456-ecd600442/plexmediaserver-1.13.9.5456-ecd600442.x86_64.rpm
# Install Plex Server
rpm -ivh plexmediaserver-1.13.9.5456-ecd600442.x86_64.rpm
# Set Plex Server to start on boot
systemctl enable plexmediaserver.service
# Start Plex Server
systemctl start plexmediaserver.service

Plex Server listens on port 32400 by default. You need to allow communication on this port for it to work properly. Run the following commands to open the port:

# Open the port in firewalld
firewall-cmd --zone=public --add-port=32400/tcp --permanent
firewall-cmd --reload
# If you are using iptables
iptables -I INPUT -p tcp --dport 32400 -j ACCEPT
iptables save
service iptables restart

Connecting to Plex

After the server installation is complete, you need to associate it with your Plex account in order to use the client. Initially, Plex only supports access via the local network. If you have installed Plex Server on a VPS, you can use port forwarding to achieve this. Here is an example using Xshell.

Right-click on your VPS in Xshell and open the session properties. Switch to the "Tunnel" tab and add a new tunnel according to the screenshot below:

Xshell Tunnel Configuration

Check the "X11 forwarding" option as shown in the screenshot below:

Xshell X11 Forwarding

Then, access the following URL to associate your Plex Server with your account: http://localhost:32400/web/. If you don't have a Plex account, you will need to register one. If everything goes smoothly, follow the prompts to complete the association.

Basic Plex Settings

Plex Client download link: https://www.plex.tv/zh/media-server-downloads/#plex-app

If you don't want to install the client, you can directly access Plex using the IP address of your VPS and the port (http://ip:32400/web/). The Windows client and web version are almost the same. Plex supports Chinese language and is easy to use. For the best playback quality, you can adjust the video quality according to your needs. If your VPS has a slow internet connection, you can optimize it by installing Google BBR using the guide here.

Plex Client

Offline Download

You can use the CCAA script I previously wrote, "CentOS 7 One-Click Installation of Caddy + Aria2 + AriaNg for Offline Download", to download videos to your VPS and then play them using Plex.

Home Media Solution

Even with a fast VPS, it cannot match the speed of a local network. You can make full use of a VPS like "Zhanmei" by using CCAA to download videos to it and then play high-definition movies using Plex.

Other Notes

Plex supports iOS and Android clients. If you have a good internet connection, you can play videos on your phone anytime.


Comments