Plex Media Server
"Plex Media Server organizes video, audio, and photos from a user's collections and from online services, and streams it to the players."
Plex is a multimedia player that can also be used as a media server. You can easily organize and manage your Movies, TV shows, Music, Photos, Other Videos, and Games. In this section, I will focus on installing Plex Media Server on a Linux system. If you use Windows, Mac, FreeBSD, various NAS systems, or Docker then go to the Plex Media Server Downloads webpage and download the most current version of the media server. At the time of creating this webpage, I am using Ubuntu MATE 20.04 LTS. The steps below should also work on most of the Ubuntu derivatives or flavors and Debian-based systems. Installing the media server on your system increases the capabilities and features of Plex. However, you don't need to install anything on your system to enjoy Plex Live TV streaming services.
How to Install Plex Media Server
It is an easy process to install Plex Media Server on your system. Just follow the steps below and it will be up and working in no time.
Add the Plex Repository
To keep your Plex updated on your system you must add the Plex repository to your system. You will need import the Plex repository’s GPG key using the curl command. So, enter the following commands to install the curl command and GPG key. Open your Terminal and enter the following:
sudo apt update
sudo apt install -y curl
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
Next, you must add the Plex repository to your system.
echo "deb https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
It is an easy process to install Plex Media Server on your system. Just follow the steps below and it will be up and working in no time.
Add the Plex Repository
To keep your Plex updated on your system you must add the Plex repository to your system. You will need import the Plex repository’s GPG key using the curl command. So, enter the following commands to install the curl command and GPG key. Open your Terminal and enter the following:
sudo apt update
sudo apt install -y curl
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
Next, you must add the Plex repository to your system.
echo "deb https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
Install Plex Media Server
You will now need to update the apt repository index and then install the most current version of the Plex Media Server.
sudo apt update
sudo apt install -y plexmediaserver
In the fourth step in the installation process you created a plexmediaserver.list to allow you to download the Plex Media Software software. During the installation process you will be prompted to keep or replace the existing file. I recommend that you press the Y key to replace and then press the Enter key.
You will now need to update the apt repository index and then install the most current version of the Plex Media Server.
sudo apt update
sudo apt install -y plexmediaserver
In the fourth step in the installation process you created a plexmediaserver.list to allow you to download the Plex Media Software software. During the installation process you will be prompted to keep or replace the existing file. I recommend that you press the Y key to replace and then press the Enter key.
Start the Plex Media Server
The Plex Media Server should be up and running by this time. You can check to see if it running by entering the following in your Terminal:
sudo systemctl status plexmediaserver
You should see something similar to the contents in my Terminal. You should see a green light to the left of plexmedia.service at the top and Active: active (running).
The Plex Media Server should be up and running by this time. You can check to see if it running by entering the following in your Terminal:
sudo systemctl status plexmediaserver
You should see something similar to the contents in my Terminal. You should see a green light to the left of plexmedia.service at the top and Active: active (running).
If the service is not running or has stopped, then Enter the following in the Terminal:
sudo systemctl start plexmediaserver
sudo systemctl start plexmediaserver
Configure Your Firewall
Plex Media Server requires certain ports to be open for it to work. I will be using UFW (Uncomplicated Firewall) in my example. (If you do not have firewall running on your system you can skip this section.)
For most users allowing port 32400 is all you need to do in order to stream your media throughout your local network. All you need to do is to open your Terminal and enter the following:
sudo ufw allow 32400
Next, update the profile list:
sudo ufw app update plexmediaserver
Then apply the new firewall rule by typing:
sudo ufw allow plexmediaserver-all
Finally check if the new firewall rule applied successfully with:
sudo ufw status verbose
Plex Media Server requires certain ports to be open for it to work. I will be using UFW (Uncomplicated Firewall) in my example. (If you do not have firewall running on your system you can skip this section.)
For most users allowing port 32400 is all you need to do in order to stream your media throughout your local network. All you need to do is to open your Terminal and enter the following:
sudo ufw allow 32400
Next, update the profile list:
sudo ufw app update plexmediaserver
Then apply the new firewall rule by typing:
sudo ufw allow plexmediaserver-all
Finally check if the new firewall rule applied successfully with:
sudo ufw status verbose
If the above steps didn't work then you'll need to create a UFW application profile called plexmediaserver. This new file must be placed in the /etc/ufw/applications.d/ directory (/etc/ufw/applications.d/plexmediaserver). Now open your favorite text editor and create the following UFW application profile (/etc/ufw/applications.d/plexmediaserver). I will use gedit (Open the Terminal and enter the following to install gedit: sudo apt-get install gedit) in my example.
Open your Terminal and enter the following: sudo gedit /etc/ufw/applications.d/plexmediaserver
Open your Terminal and enter the following: sudo gedit /etc/ufw/applications.d/plexmediaserver
[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)
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
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)
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
Save the file and update profiles list:
sudo ufw app update plexmediaserver
Apply the new firewall rules by entering:
sudo ufw allow plexmediaserver-all
sudo ufw app update plexmediaserver
Apply the new firewall rules by entering:
sudo ufw allow plexmediaserver-all
Finally check if the new firewall rules are applied successfully with:
sudo ufw status verbose
sudo ufw status verbose
Configure Plex Media Server
Before you start the Plex setup wizard let’s create the directories that will store the Plex media files. You need to create folders that will reflect the type of files that will be placed in them. In my example I will create a plexmedia folder in the opt folder (a folder not part of the operating system) and create two folders inside the plexmedia folder. I will create a Movies folder that will contain all my movies and a TV folder that will contain all my TV shows. To create these folders enter the following in your Terminal:
sudo mkdir -p /opt/plexmedia/Movies
sudo mkdir -p /opt/plexmedia/TV
You don't have to create those same named folders or place them in the same location. Actually, on my desktop system I installed the Plex Media Server on my SSD and my Movies and TV folders on another internal hard drive. In order for Plex to read or locate your media files on another hard drive you must create a mount point. A mount point defines where to find the data or files on the hard drives in your system. I have the instructions on my How-To Create a Mount Point section of my website.
The Plex Media Server user should have read and write permissions on the directories we just created. Enter the following to give read and write privileges to each new folder. Also, don't use any spaces when creating any of these folders.
sudo chown -R plex: /opt/plexmedia/Movies
sudo chown -R plex: /opt/plexmedia/TV
If you add an extra folder to the /opt/plexmedia/ then don't forget to do the steps above but use the new folder name.
My actual Movies and TV Shows are on a separate internal hard drive via a Mount Point of Media, so I had to enter the following:
sudo chown -R plex: /home/tommy/Media/Movies
sudo chown -R plex: /home/tommy/Media/TV
You can also create a Movies and TV folder in your Videos folder if you have s big enough hard drive. Just replace my name tommy with your name. Then enter the following (remembering to replace my name with your name):
sudo chown -R plex: /home/tommy/Videos/Movies
sudo chown -R plex: /home/tommy/Videos/TV
For the rest of this webpage I will use the /opt/plexmedia/ as my example that contains my Movies and TV folders.
Before you start the Plex setup wizard let’s create the directories that will store the Plex media files. You need to create folders that will reflect the type of files that will be placed in them. In my example I will create a plexmedia folder in the opt folder (a folder not part of the operating system) and create two folders inside the plexmedia folder. I will create a Movies folder that will contain all my movies and a TV folder that will contain all my TV shows. To create these folders enter the following in your Terminal:
sudo mkdir -p /opt/plexmedia/Movies
sudo mkdir -p /opt/plexmedia/TV
You don't have to create those same named folders or place them in the same location. Actually, on my desktop system I installed the Plex Media Server on my SSD and my Movies and TV folders on another internal hard drive. In order for Plex to read or locate your media files on another hard drive you must create a mount point. A mount point defines where to find the data or files on the hard drives in your system. I have the instructions on my How-To Create a Mount Point section of my website.
The Plex Media Server user should have read and write permissions on the directories we just created. Enter the following to give read and write privileges to each new folder. Also, don't use any spaces when creating any of these folders.
sudo chown -R plex: /opt/plexmedia/Movies
sudo chown -R plex: /opt/plexmedia/TV
If you add an extra folder to the /opt/plexmedia/ then don't forget to do the steps above but use the new folder name.
My actual Movies and TV Shows are on a separate internal hard drive via a Mount Point of Media, so I had to enter the following:
sudo chown -R plex: /home/tommy/Media/Movies
sudo chown -R plex: /home/tommy/Media/TV
You can also create a Movies and TV folder in your Videos folder if you have s big enough hard drive. Just replace my name tommy with your name. Then enter the following (remembering to replace my name with your name):
sudo chown -R plex: /home/tommy/Videos/Movies
sudo chown -R plex: /home/tommy/Videos/TV
For the rest of this webpage I will use the /opt/plexmedia/ as my example that contains my Movies and TV folders.
Now we can proceed with the server configuration. Open your browser, type http://YOUR_SERVER_IP:32400/web
Normally entering http://127.0.0.1:32400/web/index.html#! or https://app.plex.tv/desktop in your browser will open up Plex.
You will be presented with the following screen:
Normally entering http://127.0.0.1:32400/web/index.html#! or https://app.plex.tv/desktop in your browser will open up Plex.
You will be presented with the following screen:
You have the options to login to Plex via your Google account, Facebook account, or Apple account. You also have the option to enter your Email address and create a password and then click the Create an Account button. You can also go online to https://www.plex.tv/sign-up/ to sign up for a new Plex account. If you already have a Plex account then click the Sign In link.
The installation should place a Plex icon in your menu. It placed the icon in my Internet folder on my Ubuntu MATE 20.04.2 LTS system, but I moved it into my Entertainment folder to keep my streaming sites organized. The Plex Live TV icon also works for Plex Media Server.
Once you sign in to your new Plex account, you will be directed to a How Plex Works page. Click the GOT IT! button to continue.
You will then be greeted with a Plex Pass dialog box trying to encourage you to sign up for one of their premium plans that will provide you with additional features. Click the X in the upper right to close the dialog box.
On the next screen set the Plex Server name and click Next. I entered Ubuntu as my Plex Media Server name to make it easy to locate on my network. Leave the box checked for Allow me to access my media outside my home if you want to view your media files at other locations. It allows you to access your Plex multimedia content by using your server IP address. Don't share this address with others unless you want them to access your files.
Setup Your Library
You should see a screen that allows you to create your Media Library. Click the Add LIBRARY button.
You should see a screen that allows you to create your Media Library. Click the Add LIBRARY button.
You will be greeted with a + Add Library dialog box. You can now select your first library type you plan to setup first. I will setup my Movies first. You can change the name of Movies; however, that works good for me. Click the Next button to proceeed.
On the next screen, click the BROWSE FOR MEDIA FOLDER.
You can select the media folder manually or type the folder path and then click the ADD button. Then click the ADD Library button on the next screen.
Repeat the last four steps above for the TV Shows. When you are finished adding your folders click the DONE button.
You will then be redirected to the Plex web dashboard.
Click the Home icon in the upper left corner. Plex should soon start scanning your system to locate all your movies and TV shows in the folders you selected. If it doesn't or you can't wait for the scan process to start, then click the three dots or hamburger menu to the right of Movies and click on Scan Library Files.
Click the Home icon in the upper left corner. Plex should soon start scanning your system to locate all your movies and TV shows in the folders you selected. If it doesn't or you can't wait for the scan process to start, then click the three dots or hamburger menu to the right of Movies and click on Scan Library Files.
You should see the Activity icon in the upper right corner become animated. When you see this happening, it means Plex is updating its multimedia database. It may take a long time to complete the first initial scan, but it will be a lot faster in future scans.
You can customize the left panel by clicking on the MORE> option on the left.
You can pin (to view) or unpin (to hide) categories. The topic Ubuntu is my media server using my media files and the topic Plex is the streaming content from Plex. Click on <Pinned in the upper left to go back.
Clicking on Movies on the left will display your movies. You can click the Recommended view or Library view.
You can display your TV Shows by clicking on the TV Shows icon on the left. You now can start exploring all the options that Plex has. You'll discover it has lots of features.
Updating Plex Media Server
When a new version of Plex is released you can update the Plex Media Server through your desktop standard Software Update tool or by running the following commands in your terminal:
sudo apt-get update
sudo apt-get upgrade
When a new version of Plex is released you can update the Plex Media Server through your desktop standard Software Update tool or by running the following commands in your terminal:
sudo apt-get update
sudo apt-get upgrade
Uninstall Plex Media Server
To completely remove the Plex Media Server from the computer, first make sure the Plex Media Server is not running by entering the following: sudo systemctl stop plexmediaserver or service plexmediaserver stop
Then do the following:
To completely remove the Plex Media Server from the computer, first make sure the Plex Media Server is not running by entering the following: sudo systemctl stop plexmediaserver or service plexmediaserver stop
Then do the following:
- Run the command: dpkg -r plexmediaserver or sudo apt-get purge plexmediaserver
- Remove the directory /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/
To remove the folder plexmediaserver and all of its contents, enter the following: sudo rm -rf /var/lib/plexmediaserver - Remove Plex user by entering: sudo userdel plex
- Remove both /etc/init/plexmediaserver.conf and /etc/default/plexmediaserver by entering the following:
sudo rm /etc/init/plexmediaserver.conf
sudo rm /etc/default/plexmediaserver - Remove the UFW application profile called plexmediaserver by entering: sudo rm /etc/ufw/applications.d/plexmediaserver
- Next, you need remove the open port 32400 by entering: sudo ufw delete 32400
- To remove any dependencies that were installed with Plex Media Server that are no longer used by anything else on the system enter the following: sudo apt-get autoremove
Need Additional Help
Below are some links to help you if you need additional help with Plex.
Below are some links to help you if you need additional help with Plex.
Conclusion
You now should have a working Plex Media Server on your system. You can start adding to your Media Library.
You now can install the Plex app on a variety of devices and enjoy the multimedia content on your system. Get the Plex player app for Android, Mac/iOS, Roku, Fire TV, and many more devices.
You now should have a working Plex Media Server on your system. You can start adding to your Media Library.
You now can install the Plex app on a variety of devices and enjoy the multimedia content on your system. Get the Plex player app for Android, Mac/iOS, Roku, Fire TV, and many more devices.
May 20, 2021