Installing Plex Media Server on Centos 7

I’ve been running Plex Media Server on an old desktop machine that runs in my closet for a few years now. It was running on Centos 5 and has performed beautifully, with the family using it constantly. Unfortunately, as it goes, hardware fails, and I lost two hard drives and the optical drive at the same time. With the new hardware in place, these are the steps I took to get the family fun center up and running.

Plex Media Server Step-by-step Installation Guide for Centos 7

  1. Download and install Centos 7. This is the latest version of the OS. I have done a minimal install. The install goes great, but Red Hat have removed support for 100mbps NIC’s in this latest version, so be sure your hardware is running a gigabit network card, or else Centos will not pick it up. I bought a Trendnet card from Amazon for $10, and Centos picked it up perfectly during the install.
  2. Once installed, log in and install a few packages that I find useful, namely
    1. net-tools
    2. nano
    3. wget
  3. Perform a system update – yum update
  4. Secure your server. Linode has got some great articles & tutorials, and their one on securing your server is a must. Follow their instructions for a secure Linux server. Just remember to check your permissions and ensure 0700 for ~/.ssh and 0644 for the authorized_key file in that folder.
  5. Disable SELinux by editing the file /etc/sysconfig/selinux I have found that SELinux messes with the media server, and in all honesty is not necessary for a media server.
  6. My media is on a NAS that I will be accessing via NFS, so I will install the NFS client – yum install nfs-utils nfs-utils-lib
  7. Connect to my NAS. I created a folder called /mnt/NAS and have added the following line to the /etc/fstab file: 192.168.1.110:/mnt/HD/HD_a2/media /mnt/NAS nfs defaults 0 0. To test it run mount -a
  8. Download Plex using wget
  9. Install Plex by running yum localinstall
  10. Open the appropriate firewall ports for PMS. See the following article for the list of ports. The command to open a port in Centos 7 looks like this: firewall-cmd --add-port=32400/tcp --permanent. (Those are double dashes in front of add and permanent) You can use nmap to check the open ports (sudo nmap -sT -O localhost) or firewall-cmd --query-port 32400/tcp
  11. Make sure Plex starts on system boot. You can check this with systemctl is-enabled plexmediaserver.service. If it returns “disabled” then turn it on with sudo systemctl enable plexmediaserver.service
  12. Now go to your Plex media server via a web browser on another machine and start adding libraries – http://192.168.1.231:32400/web/index.html

Troubleshooting

If you are having trouble, there are a few resources that may help.

  • DigitalOcean also have great articles on setting up a Centos 7 server.
    • https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-7
    • https://www.digitalocean.com/community/tutorials/additional-recommended-steps-for-new-centos-7-servers
  • If you’re having permission issues – check out this page: https://support.plex.tv/hc/en-us/articles/200288596-Linux-Permissions-Guide

Plex Media Server

Centos 7

 

15 Replies to “Installing Plex Media Server on Centos 7”

  1. Great Tutorial! A minor adjustment for people who take instructions as literal as I do, the syntax for allowing the port on your firewall is:

    firewall-cmd –-add-port=32400/tcp –-permanent

    (two tacks instead of one)

    1. Jimmy,

      Glad the tutorial helped and thanks for the feedback! It’s weird, in the article edit screen I have two dashes but when WordPress renders it, it only shows one. I’ve added a note behind it to clarify.

    1. John, thanks for the suggestion. I added the <kbd> tag to the appropriate places and it cleans it up nicely.

  2. Thanks for this post.

    I’ve been running Plex on a windows desktop for a couple of years and it’s become a pain to have to log in as the plex user all the time. So I got a home server and Plex will be running in a CentOS 7 VM on that.

    Some other CentOS Plex blogs talk about adding a plex repo. You didn’t have to do this?

      1. Gotcha. I installed it the other day. I did an rpm -ivh plexmediaserver-.rpm
        Works great and now I don’t have to log into the plex user account to get it to work.

        1. From my experience, Plex maintains its data well through upgrades. This is how I update Plex (I did an update 3 days ago)

          1. Firstly download the latest version of Plex. For me this weekend it was:
          wget https://downloads.plex.tv/plex-media-server/0.9.16.3.1840-cece46d/plexmediaserver-0.9.16.3.1840-cece46d.x86_64.rpm

          2. Install it with Yum.
          sudo yum localinstall plexmediaserver-0.9.16.3.1840-cece46d.x86_64.rpm

          3. Restart the Plex server.
          sudo /etc/init.d/plexmediaserver restart

          1. After updateing my plex server when I run sudo /etc/init.d/plexmediaserver restart

            I get
            Restarting plexmediaserver (via systemctl): Job for plexmediaserver.service failed because the control process exited with error code. See “systemctl status plexmediaserver.service” and “journalctl -xe” for details.

            systemctl status plexmediaserver.service shows
            plexmediaserver.service – Plex Media Server for Linux
            Loaded: loaded (/usr/lib/systemd/system/plexmediaserver.service; enabled; ven dor preset: disabled)
            Drop-In: /etc/systemd/system/plexmediaserver.service.d
            └─overide.conf
            Active: failed (Result: start-limit) since Fri 2016-07-15 00:47:42 CST; 6min ago

            Please help

Leave a Reply

Your email address will not be published. Required fields are marked *