Install Plex Media Server On Ubuntu 20.04

Install Plex Media Server On Ubuntu 20.04
Written by itsubuntu

Plex is a streaming media server. It is cross-platform and can be installed on all major operating systems. With the help of the Plex streaming media server, you can organize your music, videos, and photo collection. You can also stream your media to your devices like computers, phones, tv from anywhere with the help of a Plex media server.

In this tutorial post, we will show you the methods for installing the Plex media server on Ubuntu 20.04.

Install Plex Media Server On Ubuntu 20.04

Plex is not included in the Ubuntu repositories. Run the following commands:

curl | sudo apt-key add
echo deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

Now, update the apt package list and install the latest Plex media server with the help of the following command:

sudo apt updatesudo apt install plexmediaserver

After installing, run the following command to make sure that the Plex is running:

sudo systemctl status plexmediaserver

The output should look something like the below:

● plexmediaserver.service - Plex Media Server
    Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
    Active: active (running) since Thu 2021-12-18 15:25:48 UTC; 13min ago

Now, you need to make sure the server firewall is allowing the traffic on the Plex-specific port.

For UFW users, the easiest option is to create a UFW application profile. For this, run the following command:

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)

Now, You need to save the file and update the profiles list:

sudo ufw app update plexmediaserver

Run the following commands to apply the new firewall rules:

sudo ufw allow plexmediaserver-all

Just to make sure that the new firewall rules are applied successfully:

sudo ufw status verbose

You will output something like below:

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

Now we need to create the directories so that we can store the Plex media files:

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

There will be the user plex to run the Plex Media Server and that should have read and execute permissions to the media files and directories.

sudo chown -R plex: /opt/plexmedia

Now, open your favorite browser and run http://SERVER_IP:32400/web, and follow the onscreen instructions.

About the author


Leave a Comment