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

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

3 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

5 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

6 days ago