How to install Plex Media Server on Ubuntu 20.04

s2 0

Plex is a streaming media server that lets you organize your video, music, and photo collections and stream your media to your computer, phone, tablet, or TV anytime, anywhere. Plex Media Server can be installed on all common operating systems and devices.

This article explains the installation Plex media server
on Ubuntu 04/20.

Install Plex Media Server on Ubuntu

Plex is proprietary computer software and is not included in the Ubuntu repositories.

Installing Steam on the Plex Media Server is pretty straightforward. We activate the official Plex repository and install the package with it apt
. It does not require any technical knowledge and the installation and configuration of the media server should not take more than 20 minutes.

  1. Add the Plex APT repository to your system and import the repository’s GPG key:

    curl | sudo apt-key add -echo deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
  2. Once the repository is activated, update the apt package list and install the latest server version:

    sudo apt updatesudo apt install plexmediaserver
  3. To see if the Plex is running, check the service status:

    sudo systemctl status plexmediaserver

    The output should look something like this:

    ‚óŹ plexmediaserver.service - Plex Media Server
        Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
        Active: active (running) since Thu 2021-06-17 19:36:33 UTC; 23min ago

That’s it. By this point, you have a Plex media server installed on your Ubuntu computer.

Adjusting the firewall

Now that Plex is installed and running on your server, you need to make sure that the server firewall is configured to allow traffic on the Plex-specific ports.

If your system isn’t running a firewall, skip this section.

If you use UFW
The easiest way to manage your firewall is to create a UFW application profile:

sudo nano /etc/ufw/applications.d/plexmediaserver
title=Plex Media Server (Standard)
description=The Plex Media Server

title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)

title=Plex Media Server (Standard + DLNA)
description=The Plex Media Server (with additional DLNA capability)

Save the file and refresh the profile list:

sudo ufw app update plexmediaserver

Apply the new firewall rules:

sudo ufw allow plexmediaserver-all

Finally, check whether the new firewall rules are being applied successfully with:

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

Before starting the Plex setup wizard, you can first create the directories where the Plex media files will be stored:

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

The Plex Media Server runs as a user plexwho must have read and execute permissions to the media files and directories. Enter the following command to set proper ownership:

sudo chown -R plex: /opt/plexmedia
You can choose any location for the media files. Just make sure you have the correct permissions set.

You can now proceed with the server configuration. Open your browser, type https://YOUR_SERVER_IP:32400/web, and you will be redirected to the plex website.

In order for Plex to work properly, you need to create an account.

Press the Google, Facebook, Apple, or Email button to create a free Plex account. To access premium features, buy a Plex pass
to plan.

Once you are signed in, you will be taken to the page with information on how Plex works, as shown below:

click on the Got it Button.

On the next screen, enter your Plex server name, leave that Allow me to access my media outside my home Check box checked and click Next.

The next step is to add a media library. click on the Add Library Button.

When the pop-up appears, select Movies as the Library Type and click Next.

In the next step, click that Browse for media folder and add the path to the directory which in our case contains the movie media files /opt/plexmedia/movies.

click on the Add Key and then the Add Library.

You can add as many libraries as you want.

click Next, then Done, and you will be taken to the Plex web dashboard.

After you’ve completed the setup wizard, you’re ready to begin exploring the Plex options and all of its possibilities.

Update Plex Media Server

When a new version is released, run the following commands in your terminal to update Plex:

sudo apt updatesudo apt install --only-upgrade plexmediaserver

The official Plex repository may be disabled during the installation process. To activate the repository, open the plexmediaserver.list file and uncomment the line that begins with “deb”:

sudo nano /etc/apt/sources.list.d/plexmediaserver.list
# When enabling this repo please remember to add the PlexPublic.Key into the apt setup.
# wget -q -O - | sudo apt-key add -
deb public main


We showed you how to install Plex Media Server on your Ubuntu 20.04 computer and create a media library.

You can now install the Plex application on your Android, iPhone, Smart TV, Xbox, Roku, or any other supported device. A list of supported apps & devices can be found on the Plex downloads
Page, or you can simply install the application from the device’s app store.

You should also look at the officers Plex quick start
Leader and Plex documentation

If you have any questions please leave a comment below.