How to Install Plex Media Server on Ubuntu

Suraj Joshi Feb 02, 2024 Linux
  1. Install Plex on Ubuntu From Plex Official Repository
  2. Configure Firewall for Plex Media Server
  3. Configure Plex Media Server
How to Install Plex Media Server on Ubuntu

Plex is a media streaming software that allows us to organize media files and stream those media contents anytime we wish. We can install the Plex Media Server from the Plex official repository.

Install Plex on Ubuntu From Plex Official Repository

We can check whether the Plex Media Server is installed or not using the command:

Bash
 bashCopysudo systemctl status plexmediaserver

If the Plex Media Server is installed we will get the output as:

Bash
 bashCopy● plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor 
   Active: active (running) since Wed 2020-10-07 18:01:06 +0545; 2min 5s ago
  Process: 15357 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_A
 Main PID: 15361 (Plex Media Serv)
    Tasks: 111 (limit: 4915)
   CGroup: /system.slice/plexmediaserver.service

Configure Firewall for Plex Media Server

Once the installation is verified, we need to configure the firewall, which will allow traffic on specified ports of the Plex media server. To configure the firewall, we perform the following steps:

To verify whether the rules are configured or not, we use the command:

Bash
 bashCopysudo ufw status verbose

If the configuration is successful, we get the following output:

 textCopyStatus: 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

Now, we create a directory to hold the contents in Plex with the following command:

Bash
 bashCopysudo mkdir -p /opt/plexmedia/<content-folder-name>

After this, we set the permission for plex user to access the content files with the following command:

Bash
 bashCopysudo chown -R plex: /opt/plexmedia

Now we can go to http://server_ip:32400/web and sign in to the plex account and continue.a

Enjoying our tutorials? Subscribe to DelftStack on YouTube to support us in creating more high-quality video guides. Subscribe
Author: Suraj Joshi
Suraj Joshi avatar Suraj Joshi avatar

Suraj Joshi is a backend software engineer at Matrice.ai.

LinkedIn