
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:
Method 1: Official Plex Repository (Recommended)
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 plexmediaserverFedora/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 plexmediaserverMethod 2: Manual Download
- Go to plex.tv/downloads
- Select Plex Media Server
- Choose Linux
- 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-*.rpmMethod 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-dockerPost-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 plexmediaserverOpen Firewall Ports
# UFW (Ubuntu)
sudo ufw allow 32400/tcp
# firewalld (Fedora/CentOS)
sudo firewall-cmd --permanent --add-port=32400/tcp
sudo firewall-cmd --reloadStep 3: Initial Configuration
- Open your browser to
http://YOUR-SERVER-IP:32400/web - Sign in with your Plex account
- Name your server (e.g., βLinux Media Serverβ)
- 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/mediaOption 2: Change media folder ownership
sudo chown -R plex:plex /path/to/mediaOption 3: ACL (Recommended for shared systems)
# 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/mediaStep 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/RHELUpdating Plex
Automatic Updates (with apt repository)
sudo apt update
sudo apt upgrade plexmediaserverManual Update
- Download new package from plex.tv
- 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.