Getting Started with Plex on Linux


Getting Started with Plex on Linux 🐧

Welcome to your Plex journey on Linux! This guide covers installation on Ubuntu, Debian, Fedora, CentOS, and other popular distributions.

Prerequisites

Before we begin, make sure you have:

  • Linux distribution (Ubuntu 20.04+, Debian 11+, Fedora, CentOS, etc.)
  • Root or sudo access
  • At least 4GB of RAM (8GB+ recommended)
  • A Plex account (free at plex.tv)
  • Your media files organized and ready

Installation Methods

Choose the method that matches your distribution:

Ubuntu/Debian

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

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

# Update and install
sudo apt update
sudo apt install plexmediaserver

Fedora/RHEL/CentOS

# Create repo file
sudo tee /etc/yum.repos.d/plex.repo << 'EOF'
[PlexRepo]
name=PlexRepo
baseurl=https://downloads.plex.tv/repo/rpm/$basearch/
enabled=1
gpgkey=https://downloads.plex.tv/plex-keys/PlexSign.key
gpgcheck=1
EOF

# Install
sudo dnf install plexmediaserver

Method 2: Manual Download

  1. Go to plex.tv/downloads
  2. Select Plex Media Server
  3. Choose Linux
  4. Download the appropriate package (.deb or .rpm)
# For .deb (Ubuntu/Debian)
sudo dpkg -i plexmediaserver_*.deb
sudo apt-get -f install  # Fix dependencies if needed

# For .rpm (Fedora/RHEL)
sudo rpm -ivh plexmediaserver-*.rpm

Method 3: Docker (Advanced)

docker run -d \
  --name plex \
  --network=host \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=America/New_York \
  -e PLEX_CLAIM="claim-xxxxx" \
  -v /path/to/config:/config \
  -v /path/to/media:/media \
  --restart unless-stopped \
  plexinc/pms-docker

Post-Installation Setup

Start and Enable Plex Service

# Start Plex
sudo systemctl start plexmediaserver

# Enable at boot
sudo systemctl enable plexmediaserver

# Check status
sudo systemctl status plexmediaserver

Open Firewall Ports

# UFW (Ubuntu)
sudo ufw allow 32400/tcp

# firewalld (Fedora/CentOS)
sudo firewall-cmd --permanent --add-port=32400/tcp
sudo firewall-cmd --reload

Step 3: Initial Configuration

  1. Open your browser to http://YOUR-SERVER-IP:32400/web
  2. Sign in with your Plex account
  3. Name your server (e.g., β€œLinux Media Server”)
  4. Enable remote access if desired

Step 4: Set Up Media Permissions

This is crucial on Linux! Plex runs as the plex user by default.

Option 1: Add plex to your group

# Add plex user to your group
sudo usermod -aG $(whoami) plex

# Set group permissions on media folder
sudo chmod -R g+rx /path/to/media
sudo chgrp -R $(whoami) /path/to/media

Option 2: Change media folder ownership

sudo chown -R plex:plex /path/to/media
# Set ACL for plex user
sudo setfacl -R -m u:plex:rx /path/to/media
sudo setfacl -R -d -m u:plex:rx /path/to/media

Step 5: Add Media Libraries

Click Add Library and choose:

  • Movies - For your film collection
  • TV Shows - For series with seasons and episodes
  • Music - For your audio library

Linux Folder Structure

/srv/media/
β”œβ”€β”€ movies/
β”‚   β”œβ”€β”€ The Matrix (1999)/
β”‚   β”‚   └── The Matrix (1999).mkv
β”‚   └── Inception (2010)/
β”‚       └── Inception (2010).mkv
└── tv/
    └── Breaking Bad/
        β”œβ”€β”€ Season 01/
        β”‚   β”œβ”€β”€ Breaking Bad - S01E01 - Pilot.mkv
        β”‚   └── Breaking Bad - S01E02 - Cat's in the Bag.mkv
        └── Season 02/
            └── ...

Managing Plex Service

Useful Commands

# Start/Stop/Restart
sudo systemctl start plexmediaserver
sudo systemctl stop plexmediaserver
sudo systemctl restart plexmediaserver

# View logs
sudo journalctl -u plexmediaserver -f

# Check version
dpkg -l | grep plexmediaserver  # Debian/Ubuntu
rpm -qa | grep plexmediaserver  # Fedora/RHEL

Updating Plex

Automatic Updates (with apt repository)

sudo apt update
sudo apt upgrade plexmediaserver

Manual Update

  1. Download new package from plex.tv
  2. Install over existing:
    sudo dpkg -i plexmediaserver_*.deb

What’s Next?

Congratulations! πŸŽ‰ Your Linux Plex server is now running. Continue with:


Need help? Check out our Troubleshooting Guide for common Linux issues.