Cyberithub

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa)

Advertisements

In this article, I will take you through the steps to install plex media server on Ubuntu 20.04 LTS (Focal Fossa). Plex media server provides you a free media server to store and manage all the personal media files like Films, TV shows, music, videos, photo gallery etc. It provides an excellent platform to stream your personal favorite music audio and video files without any hiccups. You can access either through web or through an app. You just need to create an account and then you are good to go. More on official website. Here we will see how to install plex media server on Ubuntu 20.04 LTS System.

 

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa)

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa)

Also Read: How to Install and Play Worddle Game on Ubuntu 20.04 LTS(Focal Fossa)

Step 1: Prerequisites

a) You should have a running Ubuntu 20.04 LTS Server.

b) You should have sudo or root access to run privileged commands.

c) You should have apt or apt-get utility available in your Server.

d) You should have curl utility available in your Server.

 

Step 2: Update Your Server

Before installing a new package in the system, it is wise to first sync the system packages with the latest available updates from Ubuntu repo by using sudo apt update && sudo apt upgrade command as shown below.

cyberithub@ubuntu:~$ sudo apt update && sudo apt upgrade
Hit:1 https://downloads.plex.tv/repo/deb public InRelease
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:3 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:4 http://in.archive.ubuntu.com/ubuntu focal InRelease
Hit:5 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease
Get:6 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Fetched 108 kB in 2s (54.7 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
45 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
#
# News about significant security updates, features and services will
# appear here to raise awareness and perhaps tease /r/Linux ;)
# Use 'pro config set apt_news=false' to hide this and future APT news.
#
The following packages will be upgraded:
apport apport-gtk binutils binutils-common binutils-x86-64-linux-gnu ca-certificates dnsmasq-base google-chrome-stable libasn1-8-heimdal libbinutils
libctf-nobfd0 libctf0 libfprint-2-2 libfprint-2-tod1 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal
libkrb5-26-heimdal libmysqlclient21 libnss-systemd libpam-systemd libroken18-heimdal libsmbclient libsystemd0 libudev1 libwbclient0 libwind0-heimdal
libxml2 linux-firmware mysql-client-8.0 mysql-client-core-8.0 mysql-server mysql-server-8.0 mysql-server-core-8.0 python3-apport python3-problem-report
samba-libs systemd systemd-sysv systemd-timesyncd ubuntu-advantage-tools udev xdg-desktop-portal
45 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
17 standard LTS security updates
Need to get 268 MB/271 MB of archives.
After this operation, 1,709 kB of additional disk space will be used.
....................................................................

 

Step 3: Install Plex Server

There are two different ways to install plex media server on Ubuntu based systems. We will see both the ways below.

a) Using Deb Package

You need to visit Plex media server download page and choose your Linux distribution to Ubuntu (16.04+) / Debian (8+) - Intel/AMD 64-bit as shown below. Click on it to start downloading the deb package.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 2

In a while, you will see it getting downloaded to your local system as shown below.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 3

Then go the downloaded path and run sudo dpkg -i ./plexmediaserver_1.29.2.6364-6d72b0cf6_amd64.deb command to install Plex Media Server as shown below.

cyberithub@ubuntu:~$ sudo dpkg -i ./plexmediaserver_1.29.2.6364-6d72b0cf6_amd64.deb
[sudo] password for cyberithub:
Selecting previously unselected package plexmediaserver.
(Reading database ... 198796 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.29.2.6364-6d72b0cf6_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.29.2.6364-6d72b0cf6) ...
Setting up plexmediaserver (1.29.2.6364-6d72b0cf6) ...
PlexMediaServer install: PlexMediaServer-1.29.2.6364-6d72b0cf6 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: New
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /tmp
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Processor: Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
PlexMediaServer install: Intel i915 Hardware: Not found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
Created symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service → /lib/systemd/system/plexmediaserver.service.
PlexMediaServer install: PlexMediaServer-1.29.2.6364-6d72b0cf6 - Installation successful. Errors: 0, Warnings: 0
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...

b) Using apt or apt-get

First you need to download and add the gpg key using below curl command.

cyberithub@ubuntu:~$ curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3072 100 3072 0 0 18618 0 --:--:-- --:--:-- --:--:-- 18618
OK

Then you need to add the repo information in the source list using below echo command.

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

After adding the repo information, update the package cache using sudo apt update command as shown below.

cyberithub@ubuntu:~$ sudo apt update
Get:1 https://downloads.plex.tv/repo/deb public InRelease [6,685 B]
Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
Get:3 https://downloads.plex.tv/repo/deb public/main amd64 Packages [432 B]
Hit:4 http://in.archive.ubuntu.com/ubuntu focal InRelease
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:6 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1,892 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2,266 kB]
Get:10 http://security.ubuntu.com/ubuntu focal-security/main i386 Packages [530 kB]
Get:11 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [40.7 kB]
Get:12 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [11.5 kB]
Get:13 http://security.ubuntu.com/ubuntu focal-security/universe i386 Packages [574 kB]
Get:14 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [777 kB]
Get:15 http://in.archive.ubuntu.com/ubuntu focal-updates/main i386 Packages [761 kB]
Get:16 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [93.9 kB]
Get:17 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [275 kB]
Get:18 http://in.archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.1 kB]
Get:19 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [16.9 kB]
Get:20 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 DEP-11 Metadata [940 B]
Get:21 http://in.archive.ubuntu.com/ubuntu focal-updates/universe i386 Packages [704 kB]
Get:22 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1,009 kB]
Get:23 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [408 kB]
Get:24 http://in.archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [23.2 kB]
Get:25 http://in.archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 DEP-11 Metadata [940 B]
Get:26 http://in.archive.ubuntu.com/ubuntu focal-backports/main amd64 DEP-11 Metadata [7,992 B]
Get:27 http://in.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
Fetched 9,781 kB in 4s (2,179 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done

Now download and install Plex Media Server from newly added repo by using sudo apt install plexmediaserver command as shown below. This will download and install the package along with all its dependencies.

cyberithub@ubuntu:~$ sudo apt install plexmediaserver
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
plexmediaserver
0 upgraded, 1 newly installed, 0 to remove and 45 not upgraded.
Need to get 84.5 MB of archives.
After this operation, 251 MB of additional disk space will be used.
Get:1 https://downloads.plex.tv/repo/deb public/main amd64 plexmediaserver amd64 1.29.2.6364-6d72b0cf6 [84.5 MB]
Fetched 84.5 MB in 12s (7,222 kB/s)
Selecting previously unselected package plexmediaserver.
(Reading database ... 198803 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.29.2.6364-6d72b0cf6_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.29.2.6364-6d72b0cf6) ...
Setting up plexmediaserver (1.29.2.6364-6d72b0cf6) ...
PlexMediaServer install: PlexMediaServer-1.29.2.6364-6d72b0cf6 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: systemd
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: render
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /tmp
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Processor: Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz
PlexMediaServer install: Intel i915 Hardware: Not found
PlexMediaServer install: Nvidia GPU card: Not Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.29.2.6364-6d72b0cf6 - Installation successful. Errors: 0, Warnings: 0
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

 

Step 4: Verify Installation

After successful installation, you can list all the files installed from plexmediaserver package using dpkg -L plexmediaserver command as shown below.

cyberithub@ubuntu:~$ dpkg -L plexmediaserver 
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/plexmediaserver
/usr/share/doc/plexmediaserver/README.Debian
/usr/share/doc/plexmediaserver/copyright
/usr/share/doc/plexmediaserver/changelog.Debian.gz
/usr/share/applications
/usr/share/applications/plexmediaserver.desktop
/usr/share/pixmaps
/usr/share/pixmaps/plexmediaserver.png
/usr/lib
/usr/lib/plexmediaserver
/usr/lib/plexmediaserver/Plex Media Fingerprinter
/usr/lib/plexmediaserver/Plex Commercial Skipper
/usr/lib/plexmediaserver/Plex SQLite
/usr/lib/plexmediaserver/Plex DLNA Server
/usr/lib/plexmediaserver/Plex Transcoder
/usr/lib/plexmediaserver/etc
/usr/lib/plexmediaserver/etc/ld-musl-x86_64.path
/usr/lib/plexmediaserver/Plex Media Scanner
..........................................................

 

Step 5: Check Service Status

Before accessing it through web, you need to check the running status of plexmediaserver service by using systemctl status plexmediaserver command as shown below.

cyberithub@ubuntu:~$ systemctl status plexmediaserver
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2022-12-08 19:13:57 IST; 1h 9min ago
Process: 5766 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_>
Main PID: 5768 (Plex Media Serv)
Tasks: 44 (limit: 2280)
Memory: 60.4M
CGroup: /system.slice/plexmediaserver.service
├─5768 /usr/lib/plexmediaserver/Plex Media Server
├─5801 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-6d72b0cf6/Framework.bundle/Contents/Resources/Versions/2/P>
└─5966 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Sh>

Dec 08 19:13:57 ubuntu systemd[1]: Starting Plex Media Server...
Dec 08 19:13:57 ubuntu systemd[1]: Started Plex Media Server.

If service is not found to be running then you can start or restart the service by using systemctl start plexmediaserver or systemctl restart plexmediaserver command.

 

Step 6: Allow access from Firewall

If you are running ufw firewall in your Server then you need to make sure to allow TCP Port 32400 from it or else you won't be able to access the Media Server. To allow, you need to simply run sudo ufw allow 32400/tcp command as shown below.

cyberithub@ubuntu:~$ sudo ufw allow 32400/tcp
Rules updated
Rules updated (v6)

 

Step 7: Launch and Configure

To launch plex media server, you need to open your favorite web browser and go to URL http://localhost:32400/web. You will be able to see below login page.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 4

You can either login with Google, Facebook or Apple or you can Sign Up and create an account by clicking on Continue with Email.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 5

After creating an account, you need to verify your email ID and then login. When you login for the first time, you should see below screen.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 6

After going through the instructions, you can scroll down and click on Got it to proceed. Next you will be asked to select a package as per your requirement. If you don't want to select, then close it for now and then proceed further. Here you need to provide a meaningful name to your plex media server and click on Next.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 7

Next you will get an option to sync your watch state and ratings. You can select your option accordingly and proceed.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 8

Next you need to add the Library to organise your media. You can click on Add Library as shown below.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 9

You will then be asked to select your library type. Here we have selected Films and then clicked on Next. Similarly, you can also select the relevant type and click on Next.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 10

You will now have to add the folder at an appropriate location. For example, we are adding Films folder under /home/cyberithub as shown below. Similarly you can also choose the appropriate location and click on Add Library.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 11

You can now see that the library is added. Scroll down a bit and click on Next to continue.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 12

Finally you will see below screen indicating that configuration is now completed. Click on Done and then finish the setup.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 13

You will be redirected to below Dashboard.

How to Install Plex Media Server on Ubuntu 20.04 LTS (Focal Fossa) 14

 

Step 8: Uninstall Plex Media Server

Once you are done using plex media server, you can choose to uninstall it from your system by using sudo apt remove plexmediaserver command as shown below.

cyberithub@ubuntu:~$ sudo apt remove plexmediaserver
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libfwupdplugin1 libllvm11 libxmlb1
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
plexmediaserver
0 upgraded, 0 newly installed, 1 to remove and 33 not upgraded.
After this operation, 251 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 201447 files and directories currently installed.)
Removing plexmediaserver (1.29.2.6364-6d72b0cf6) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...

Leave a Comment