How to install Plex Media Server on Ubuntu 18.04

s2 0

In this tutorial, we will walk you through the installation Plex media server
on Ubuntu 04/18.

Plex is a streaming media server that allows you to organize your video, music, and photo collections and stream them to any of your devices anytime, anywhere.

Although this tutorial was written for Ubuntu 18.04 Bionic Beaver, the same steps can be used for Debian and Ubuntu 16.04 Xenial Xerus.


You must be logged in as a user with sudo access in order to install packages on your Ubuntu system.

Install Plex Media Server

The easiest way to install and manage Plex Media Server on Ubuntu 18.04 is to use the official Plex repository. It does not require any technical knowledge and the installation and configuration of the media server should not take more than 20 minutes.

Follow the steps below to install the Plex Media Server on your Ubuntu system:

  1. Start by importing the repository’s GPG key as follows: curl Command:

    curl | sudo apt-key add -

    Add the Plex APT repository to your system’s software repository list by issuing:

    echo deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
  2. Once the Plex repository is enabled, update the apt package list and install the latest version of the Plex Media Server with:

    sudo apt install apt-transport-httpssudo apt updatesudo apt install plexmediaserver
  3. To check if the Plex service is running, type:

    sudo systemctl status plexmediaserver

    The output should look something like this:

    ‚óŹ plexmediaserver.service - Plex Media Server for Linux
    Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
    Active: active (running) since Mon 2018-06-25 10:42:28 PDT; 35min ago
    Process: 2544 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)
    Main PID: 2556 (sh)
        Tasks: 56 (limit: 2321)
    CGroup: /system.slice/plexmediaserver.service

Adjust the firewall rules

Now that you’ve got Plex installed and running on your server, you’ll need to make sure that your firewall is configured to allow traffic on Plex Media Server-specific ports.

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

The following steps assume that you have UFW
To manage your firewall:

Open your favorite text editor and create the following UFW application profile:

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 by typing:

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

Configure Plex Media Server

Before we start the Plex setup wizard, let’s 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 plex who must have read and execute permissions to the media files and directories. To set proper ownership, run the following command.

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

Now we can proceed with the server configuration. Open your browser, type https://YOUR_SERVER_IP:32400/web and you will see the following screen:

In order to use the Plex Media Server you will need to create an account.

Press the Google, Facebook, or Email button to create a free Plex account. If you want to access premium features, you can 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 Got it Button.

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

The next step is to add a media library. click on 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 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, you can update the Plex Media Server package through your desktop standard software update tool or by running the following commands in your terminal:

sudo apt updatesudo apt upgrade


You learned how to install Plex Media Server on your Ubuntu 18.04 computer and create a media library.

You are now ready to 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
Or 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.