Categories: TutorialsUbuntu

How to Install Plex Media Server on Ubuntu 20.04 | 18.04

In this article, we are going to shows how to install Plex Media Server on Ubuntu 20.04 | 18.04. If you are interested to install Plex Media Server on your Ubuntu server then this post is ideal for you.

Plex Media Server  is a streaming media service and a client–server media player platform that allows you to organize all your video, music and photo collections from your media collections and stream them to your mobile devices, TV and computer from anywhere. 



Sponsored

It is based on the client-server model, so it has two main components:

  • Plex Media Server – Store and organize your all media files.
  • Client application – Allows you to access your media files and it is runs on Windows, macOS, Linux and almost all mobile devices.

For more details about Plex, please check its official page.


Install Plex Media Server on Ubuntu

Simply follow below steps to install Plex Media Server on Ubuntu:

Step 1 : Update the package list

To install Plex, first update the default package index list in your system by running commands below:

sudo apt update
sudo apt upgrade




Step 2 : Install Plex Media Server

Plex is not available in the Ubuntu default repositories, so you will need to manually add its repository. To do that, run the commands below:

wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add -
sudo sh -c 'echo "deb https://downloads.plex.tv/repo/deb/ public main $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/plexmediaserver.list'

The commands above will add Plex APT repository and import the GPG key for the repository.

Next, run the commands below to install Plax Media Server:

sudo apt update
sudo apt install plexmediaserver



To verify the installation of Plex, run the command below:

sudo systemctl status plexmediaserver

You can use the commands below to stop, start and enable Plex media server:

sudo systemctl stop plexmediaserver
sudo systemctl start plexmediaserver
sudo systemctl enable plexmediaserer

Adjust Ubuntu Firewall(UFW)

If you are using UFW to manage your firewall then you will need configure UFW firewall to allow traffic to Plex server. To do that, create a new UFW Plex media server profile by running the commands below :

sudo nano /etc/ufw/applications.d/plexmediaserver

After that, paste the below lines into the UFW Plex media server profile file:

[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

Save the file and exit.

Next, run the commands below to update profiles list and apply the new firewall rules:

Sponsored



sudo ufw app update plexmediaserver
sudo ufw allow plexmediaserver-all

To check the new firewall rules are applied or not, run the command below:

sudo ufw status verbose
Output
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
32400/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  
3005/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  
5353/udp (plexmediaserver-all) ALLOW IN    Anywhere                  
8324/tcp (plexmediaserver-all) ALLOW IN    Anywhere                  
32410:32414/udp (plexmediaserver-all) ALLOW IN    Anywhere                  
1900/udp (plexmediaserver-all) ALLOW IN    Anywhere                  
32469/tcp (plexmediaserver-all) ALLOW IN    Anywhere  

Configure Plex Server

Create the Plex catalog directory that will store its media files by running command below:

sudo mkdir -p /opt/plexmedia/{movies,series}

Now, set the correct permission for the Plex user named plex to access the directory:

sudo chown -R plex: /opt/plexmedia



Access Plex Media Web

At this point, Plex is installed and ready to use. To launch it, open your web browser and browse the below address:

http://YOUR_SERVER_IP:32400/web

The above link open its portal page similar to below:

Create an account to use plex media server. You can use Google, Facebook, Apple and Email authentication methods to create Plex account.



After create account, it will be redirected to you a new page that contains information about how Plex works:

Click on the GOT IT! button and Continue with the setup wizard.

During the Plex setup, do not forget to check the box to Allow me to access my media outside my home and on the browse for media folder, select the path of directory created in above steps: /opt/plexmedia/movies.


Update Plex Media Server

Run the commands below to update Plex Media Server:

sudo apt update
sudo apt install --only-upgrade plexmediaserver

If our article helps you, please consider buying us a coffee

Thank you for your support.


The post How to Install Plex Media Server on Ubuntu 20.04 | 18.04 appeared first on Linux Tutorial Hub.

Ubuntu Server Admin

Recent Posts

How we used Flask and 12-factor charms to simplify Canonical.com development

Our latest Canonical website rebrand did not just bring the new Vanilla-based frontend, it also…

5 hours ago

Web Engineering: Hack Week 2024

At Canonical, the work of our teams is strongly embedded in the open source principles…

1 day ago

Ubuntu Weekly Newsletter Issue 873

Welcome to the Ubuntu Weekly Newsletter, Issue 873 for the week of December 29, 2024…

3 days ago

How to resolve WiFi Issues on Ubuntu 24.04

Have WiFi troubles on your Ubuntu 24.04 system? Don’t worry, you’re not alone. WiFi problems…

3 days ago

Remembering and thanking Steve Langasek

The following is a post from Mark Shuttleworth on the Ubuntu Discourse instance. For more…

3 days ago

How to Change Your Prompt in Bash Shell in Ubuntu

I don’t like my prompt, i want to change it. it has my username and…

3 days ago