Plex is a media streaming server that allows you to manage and stream your movie, music, and photo collections to your computer, phone, tablet, or television at any time and from anywhere. Plex Media Server is compatible with a wide range of operating systems and devices.
In this article, I will show you how to install Plex Media Server with some steps.
Table of Contents
Installing Plex Media Server on Ubuntu
Plex is a commercial piece of software that isn’t available in the Ubuntu repository.
Steam can be installed on Plex Media Server with relative ease. We’ll activate the official Plex repository and use apt to install the program. It doesn’t require any technical skills, and installing and configuring the media server shouldn’t take more than 20 minutes.
Add the Plex APT repository and import the repository’s GPG key:
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
Update the apt package list and install the newest server version once the repository is enabled:
sudo apt update
sudo apt install plexmediaserver
Check the service status to see if Plex is up and running:
sudo systemctl status plexmediaserver
You will see the output like this:
plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-08-13 15:16:03 UTC; 23min ago
That is all there is to it. On your Ubuntu computer, you now have a Plex media server installed.
Changing the Firewall’s Settings
Now that Plex is up and operating on your server, double-check that the server firewall is set to accept traffic on the Plex-specific ports.
If you do not have a firewall running on your system, skip this section.
The simplest approach if you’re using UFW to control your firewall is to establish a UFW application profile:
sudo vi /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
Save the file and update:
sudo ufw app update plexmediaserver
Apply the new firewall rules:
sudo ufw allow plexmediaserver-all
Finally, use the following commands to see if the new firewall rules have been correctly implemented:
sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), disabled (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
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
Configuring Plex Media Server
You can create the folders that will hold the Plex media files before starting the Plex setup wizard:
sudo mkdir -p /opt/plexmedia/{movies,series}
The Plex Media Server operates as the user plex, and the media files and folders must have read and execute rights. Enter the following command to set the right ownership:
sudo chown -R plex: /opt/plexmedia
You may now continue configuring the server. You’ll be forwarded to the plex website if you open your browser and input http://YOUR SERVER IP:32400/web.

You’ll need to establish an account for Plex to operate correctly.
Create a free Plex account by using the Google, Facebook, Apple, or Email buttons. Purchase a Plex Pass subscription if you want access to premium features.
After you join up, you’ll be routed to the page below, which contains information about how Plex works:

Select the “Got It” option.
Enter your Plex server name on the following page, leave the “Allow me to access my media outside my home” box checked, and click “Next“

After that, you’ll need to add a media library. Select “Add Library” from the drop-down menu.
Select movies as the library type in the popup box that appears, then click Next.

Next, choose “Browse for media folder” and provide the path to the directory where the Movies media files will be stored, in our case /opt/plexmedia/movies.

Then select Add buttom on Add Library.
You are free to create as many libraries as you like.

Click Next, and then click Done. You will be redirected to the Plex web dashboard

Now that you’ve completed the setup process, you can begin exploring Plex’s features and capabilities.
Updating Plex Media Server
To update Plex when a new version is available, use the following instructions in your terminal:
sudo apt update
sudo apt install --only-upgrade plexmediaserver
The official Plex repository may be deactivated during the installation procedure. Open the plexmediaserver.list file and uncomment the line beginning with “deb” to activate the repository:
sudo vi /etc/apt/sources.list.d/plexmediaserver.list
# When enabling this repo please remember to add the PlexPublic.Key into the apt setup.
# wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add -
deb https://downloads.plex.tv/repo/deb/ public main
Conclusion
We’ve taught you how to install Plex Media Server and establish a Media Library on your Ubuntu 20.04 computer.
Plex is now available for download on Android, iPhone, Smart TV, Xbox, Roku, and other compatible devices. On the Plex Downloads page, you can discover a list of compatible Apps & Devices, or you can just install the app from the device’s app store.
Check out the official Plex Quick-Start tutorial and the Plex Documentation website as well.