Plex Media Server - Debian

From WilliamsNet Wiki
Jump to navigation Jump to search

Plex is a streaming media server that lets you organize your video, music, and photo collections and stream them to all of your devices at any time and from anywhere.

This tutorial explains how to install Plex Media Server on Debian 9.

Prerequisites[edit]

  • The user you are logged in as must have sudo privileges to be able to install packages.
  • Install Plex Media Server

Installation[edit]

Plex Media Server is not available in the official Debian package repository. We’ll be using the Plex official repository. Start by importing the repository’s GPG key using the following curl command:

sudo apt install curl
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

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

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

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-https
sudo apt update
sudo apt install plexmediaserver

The Plex service will start automatically. To verify that the installation was successful and SSH service is running type the following command which will print the Plex server status:

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 Thu 2019-03-07 06:35:51 CST; 17min ago
  Process: 2993 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
Main PID: 2998 (sh)
    Tasks: 127 (limit: 4915)
  CGroup: /system.slice/plexmediaserver.service

Configure Plex Media Server[edit]

Before starting the Plex setup wizard let’s create the directories that will store the Plex media files:

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

The Plex Media Server runs as the user plex which must have read and execute permissions to the media files and directories. To set the correct ownership run the following command.

sudo chown -R plex: /opt/plexmedia

You can choose any location to store the media files, just make sure you set the correct permissions.

Now we can proceed with the server configuration. Open your browser, type

http://YOUR_SERVER_IP:32400/web