Install Plex Media Server on Ubuntu 22.04|20.04|18.04

Posted on 18 views

Plex is a server for media streaming which enables to store all media content in one place and to use a client application to access them, for example another computer or a mobile device. Plex server organizes the uploaded content in a proper manner making them easy to be accessed by the client.

Plex can run on different operating systems including Windows, MacOS and Linux. In this guide, we are going to look at how to install Plex media server on Ubuntu 22.04|20.04|18.04 system.

We are going to download the latest Plex media server for Ubuntu 22.04|20.04|18.04 from Plex website. Install basic dependencies:

sudo apt update
sudo apt install wget curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates

Step 1: Add Plex Media Server APT repository

Add Plex APT repository to your system:

echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

Import GPG key:

wget https://downloads.plex.tv/plex-keys/PlexSign.key
cat  PlexSign.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/PlexSigkey.gpg

Update package index once the repository has been added:

sudo apt update

Step 2: Installing Plex Media server on Ubuntu 22.04|20.04|18.04

Once downloaded, change to the downloaded Plex media directory and install Plex by running the following commands:

$ sudo apt install plexmediaserver
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libcamel-1.2-62 libdpkg-perl libextutils-pkgconfig-perl libfile-fcntllock-perl libgupnp-1.2-0 pkg-config
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  beignet-opencl-icd ocl-icd-libopencl1
The following NEW packages will be installed:
  beignet-opencl-icd ocl-icd-libopencl1 plexmediaserver
0 upgraded, 3 newly installed, 0 to remove and 836 not upgraded.
Need to get 94.8 MB of archives.
After this operation, 291 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

Step 3: Check Plex Media Server Status

After installation Plex Media server runs automatically. Check status as shown below:

$ systemctl status plexmediaserver.service
 plexmediaserver.service - Plex Media Server
     Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-03-08 00:10:58 EAT; 38s ago
    Process: 65511 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/SUC>
   Main PID: 65513 (PMS RunServer)
      Tasks: 120 (limit: 9482)
     Memory: 223.1M
        CPU: 25.239s
     CGroup: /system.slice/plexmediaserver.service
             ├─65513 /usr/lib/plexmediaserver/Plex Media Server
             ├─65709 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.25>
             ├─65779 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.25.6.5577-c8bd13540 32600
             ├─65823 Plex Plug-in [com.plexapp.agents.thetvdb] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-vers>
             ├─66524 Plex Plug-in [tv.plex.agents.movie] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.>
             ├─66629 Plex Plug-in [tv.plex.agents.series] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1>
             ├─66776 Plex Plug-in [tv.plex.agents.music] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.>
             ├─66796 Plex Plug-in [org.musicbrainz.agents.music] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-ve>
             └─66840 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-c8bd13540/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version>

Mac 08 00:10:58 ubuntu22 systemd[1]: Starting Plex Media Server...
Mac 08 00:10:58 ubuntu22 systemd[1]: Started Plex Media Server.

Now enable Plex server to start automatically on system boot by running the below command:

sudo systemctl enable plexmediaserver.service

Confirm the service is enabled.

$ systemctl is-enabled plexmediaserver.service
enabled

If you are running an active firewall, ensure to open the port 32400 through the firewall as shown below:

sudo ufw allow 32400

Step 4: Configure Plex Media Server on Ubuntu 22.04|20.04|18.04

Acces Plex Media server from your browser on port 32400 to configure it. On your browser, type http://:32400/web. You should see a screen as shown where you are being prompted to sign in to plex.

How-to-install-plex-media-server-on-ubuntu-20.04⁄dedian9

Having signed in, click Got it at the bottom of the next page.

How-to-install-plex-media-server-on-ubuntu-20.04-dedian9-02-1

In the next page give your plex a name and also ensure that the box allow me to access my media outside my home is checked. Click Next

How-to-install-plex-media-server-on-ubuntu-20.04-dedian9-03

In the next page, add libraries. Click on ADD LIBRARY.

How-to-install-plex-media-server-on-ubuntu-20.04-dedian9-01-1

This will take you to a page where you choose libraries to add. Once you pick click Next. You can go back to add more libraries.

How-to-install-plex-media-server-on-ubuntu-20.04-dedian9-05

Go ahead to add folders to your library. Click on BROWSE FOR MEDIA FOLDER and once added click on ADD button at the bottom then on the next screen click on ADD LIBRARY. You can as many libraries as you can.

How-to-install-plex-media-server-on-ubuntu-20.04-dedian9-04

After adding your chosen libraries, click Next. You will see a screen telling you that all has been set up and directing you to get plex apps. Click DONE

How-to-install-plex-media-server-on-ubuntu-20.04-dedian9-06-1

In the next page, you will see all sources marked. Unmark any that you do not need and click FINISH SETUP at the bottom end. You will be taken to a screen as shown.

install-plex-media-server-centos-8-centos-7-06-min-1024x522

Step 5 – Secure Plex Media Server with Let’s Encrypt SSL

If using Proxy Server such as Apache web server you can secure Plex with Let’s Encrypt:

That’s it. You have successfully installed Plex Media Server on Ubuntu 22.04|20.04|18.04.

coffee

Gravatar Image
A systems engineer with excellent skills in systems administration, cloud computing, systems deployment, virtualization, containers, and a certified ethical hacker.