How to Install Plex Media Server on Ubuntu 24.04
Learn how to install Plex Media Server on Ubuntu 24.04 LTS via official Plex repository. Configure media libraries, UFW firewall, and remote streaming.

6 min read
Learn how to install Plex Media Server on Ubuntu 24.04 LTS via official Plex repository. Configure media libraries, UFW firewall, and remote streaming.
- Prerequisites and Supported Releases
- Step 1: Updating System Packages and Installing Dependencies
- Step 2: Adding the Official Plex Repository and GPG Key
Plex Media Server is a robust, feature-rich media streaming and management solution that transforms an Ubuntu Linux computer into a sophisticated private home theater and cloud streaming system. By automatically scanning your local storage for video, music, and image collections, Plex enriches your personal media with cover art, plot summaries, cast biographies, album reviews, trailer teasers, and subtitle tracks.
With official client apps available across smart TVs, Apple TV, Roku, Chromecast, Amazon Fire TV, Android, iOS, Windows, and web browsers, Plex delivers a commercial Netflix-style streaming experience directly from your personal hardware. Learning how to install plex media server on ubuntu 24.04 allows movie enthusiasts and music collectors to build a self-hosted personal media streaming hub with dynamic transcoding and rich metadata.
In this comprehensive step-by-step tutorial, we demonstrate how to install Plex Media Server on Ubuntu 24.04 LTS (Noble Numbat). We cover importing the official Plex GPG signing key, registering the official APT package repository, installing the server daemon, managing systemd services, structuring media storage directories with correct permissions, configuring UFW firewall port allowances, claiming the server via an initial SSH tunnel, and optimizing hardware transcoding.
Step-by-step tutorial on installing and configuring Plex Media Server on Ubuntu 24.04 LTS using the official Plex repository, media directory permissions, UFW firewall, and web setup.
Prerequisites and Supported Releases
This guide is thoroughly verified on Ubuntu 24.04 LTS (Noble Numbat). The instructions apply cleanly to cloud instances (AWS EC2, Google Compute Engine, DigitalOcean, Hetzner), bare-metal servers, and local virtual machines.
Before proceeding, ensure you have the following requirements satisfied:
- A physical machine, VPS, or home server running
Ubuntu 24.04 LTS. - A non-root user account configured with administrative
sudoprivileges. - Sufficient local or networked disk storage for your multimedia libraries (movies, music, TV shows, and photos).
- A free Plex account created at plex.tv to link and manage your server.
Step 1: Updating System Packages and Installing Dependencies
Before installing Plex Media Server, update your local APT repository index and upgrade existing packages to ensure complete library compatibility.
Install curl, gnupg, and apt-transport-https, which are required to fetch and verify packages over secure HTTPS repositories.
Verify that the necessary tools are installed before proceeding.
# Refresh package index and upgrade packages
sudo apt update && sudo apt upgrade -y
# Install prerequisite tools
sudo apt install -y curl gnupg apt-transport-https wget
Step 2: Adding the Official Plex Repository and GPG Key
The most reliable method to install and maintain Plex Media Server is through the official Plex APT repository, which delivers up-to-date versions directly from the Plex engineering team.
Import the official Plex GPG signing key into the modern /etc/apt/keyrings/ directory.
Register the official repository entry in /etc/apt/sources.list.d/plexmediaserver.list.
Update your package index to load the Plex package definitions.
# Create keyrings directory if not present
sudo mkdir -p /etc/apt/keyrings
# Download and import Plex GPG key
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /etc/apt/keyrings/plexmediaserver.gpg
# Add Plex official repository
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/plexmediaserver.gpg] https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
# Refresh local repository index
sudo apt update
Step 3: Installing Plex Media Server via APT
With the official repository registered, install the plexmediaserver package using APT.
The installation script automatically creates a dedicated system user and group named plex, generates default application databases in /var/lib/plexmediaserver, and registers the systemd service.
Execute the installation command below.
# Install Plex Media Server
sudo apt install -y plexmediaserver
# Verify installed package details
apt-cache policy plexmediaserver
Step 4: Enabling and Verifying the Plex Systemd Service
Once the installation completes, verify that the plexmediaserver.service daemon is active and configured to start automatically on system boot.
Query the service status using systemctl.
Confirm that the daemon reports active (running).
# Enable service to start at boot
sudo systemctl enable plexmediaserver
# Verify active service status
sudo systemctl status plexmediaserver --no-pager
Step 5: Configuring Media Storage Directories and Permissions
The Plex daemon runs under the unprivileged plex system user account. For Plex to scan, index, and stream your media files, the plex user must possess read and execute permissions on your media directories.
Create a structured directory layout for your media libraries (e.g., in /media/plex/movies, /media/plex/tv, and /media/plex/music).
Set appropriate ownership or grant the plex user read and execute access using standard group permissions.
# Create organized media directories
sudo mkdir -p /media/plex/movies /media/plex/tv /media/plex/music
# Add your user and the plex user to a shared media group
sudo groupadd -f mediagroup
sudo usermod -aG mediagroup $USER
sudo usermod -aG mediagroup plex
# Set ownership and read/execute permissions
sudo chown -R $USER:mediagroup /media/plex
sudo chmod -R 775 /media/plex
Step 6: Configuring UFW Firewall for Plex Streaming Ports
Plex requires several network ports to support client playback, remote access, mobile companion apps, and local network device discovery (GDM/DLNA).
The primary web interface and streaming engine operates on TCP port 32400.
Additional optional ports include UDP 1900 (Plex DLNA server), TCP 32469 (Plex DLNA), UDP 32410, 32412, 32413, and 32414 (GDM network discovery).
Open the core ports in Ubuntu's Uncomplicated Firewall (UFW).
# Allow primary Plex streaming and web management port
sudo ufw allow 32400/tcp comment 'Plex Media Server Web'
# Allow optional network discovery and DLNA ports
sudo ufw allow 1900/udp comment 'Plex DLNA Server'
sudo ufw allow 32469/tcp comment 'Plex DLNA Server'
sudo ufw allow 32410:32414/udp comment 'Plex GDM Discovery'
# Verify active firewall rules
sudo ufw status numbered
Step 7: Initial Server Setup and SSH Tunneling for Remote Servers
For security reasons, Plex requires that the initial server setup and administrative account linking occur from the local network (localhost or a private 192.168.x.x subnet).
If you are installing Plex on a remote headless cloud server or VPS, direct browser access to http://server_ip:32400/web will display a locked interface without the initial setup wizard.
To bypass this restriction securely, establish an SSH tunnel from your local laptop or workstation forwarding port 32400.
Open your browser to http://localhost:8888/web on your local computer to complete the setup wizard and claim your server.
# Run this command on your LOCAL computer to create an SSH tunnel:
# ssh -L 8888:localhost:32400 username@<server_ip_address>
# Then open this URL in your local browser:
# http://localhost:8888/web
Step 8: Completing the Web Setup Wizard and Library Creation
In the Plex Web interface, sign in with your Plex account.
Provide a friendly name for your server (e.g., Ubuntu-Media-Hub) and ensure Allow me to access my media outside my home is checked if you want remote streaming.
Click Add Library, select the library type (Movies, TV Shows, Music, or Photos), and browse to your corresponding directory path (e.g., /media/plex/movies).
Click Finish to initiate the automated background scanning and metadata matching process.
Web URL: http://localhost:32400/web (or via SSH tunnel http://localhost:8888/web)
Step 1: Sign in with Plex.tv account
Step 2: Server Naming & Remote Access
Step 3: Add Libraries (/media/plex/movies, /media/plex/tv)
Step 4: Automated Metadata Matching
Troubleshooting and Common Errors
When configuring Ubuntu servers, unexpected permission errors, network timeouts, or lock contention can occur. Review these common issues and verified resolutions:
Plex Web interface shows 'Server is unclaimed and not secure'
Resolution: Open Settings > Server > General in Plex Web and click Claim Server. Ensure your server can communicate outbound with plex.tv over HTTPS port 443 to validate your account token.
Plex library does not detect media files inside folder
Resolution: This is almost always a Linux filesystem permission issue. Verify that the plex user can read the files: sudo chmod -R 755 /media/plex and ensure all parent directories possess the execute (+x) permission.
Remote access fails or reports 'Double NAT detected'
Resolution: In Plex Web, navigate to Settings > Remote Access. Check 'Manually specify public port' (32400), and configure a Port Forwarding rule on your home router directing external TCP port 32400 to your Ubuntu server's static internal IP address.
Security Best Practices and Hardening
Never execute the Plex Media Server daemon under the root user account; always use the dedicated unprivileged 'plex' user.
Require secure connections (HTTPS) by selecting Settings > Network > Secure connections > Required.
Enable Two-Factor Authentication (2FA) on your linked Plex.tv master account to safeguard your personal streaming libraries against unauthorized access.
Regularly backup your Plex database and metadata directories located in /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/.
Related Ubuntu Tutorials and Documentation
Deepen your Linux system administration skills with our related production-tested guides:
Authoritative References and Official Documentation

The Linux Command Line, 2nd Edition: A Complete Introduction
Frequently Asked Questions
Quick answers to common questions and configurations
sudo apt update && sudo apt install --only-upgrade plexmediaserver.intel-media-va-driver-non-free for Intel CPUs or NVIDIA proprietary drivers), Plex automatically offloads real-time video transcoding from the CPU to your GPU.Editorial Disclosure: Website Vidya is supported by our readers. When you purchase hosting, tools, or software through our verified partner links, we may earn an affiliate commission at no extra cost to you. We only recommend solutions we trust and rigorously verify.
Rajesh Ray
I’m Rajesh Rai, a full-stack developer, Linux administrator, and technology enthusiast passionate about making complex technology easier to understand and use.
Most Read Guides
TrendingUbuntu Server Not Booting? 10 Simple Steps to Fix It Fast
How to Create a 3D Button in HTML and CSS: Easy Steps
How to Install Python and Pip on Ubuntu 24.04 LTS
How to Install Nginx on Ubuntu 24.04
How to Install Python on Ubuntu 24.04 LTS
Related Technical Guides
Tested runbooks, server administration walkthroughs, and troubleshooting guides


Join the Conversation & Perspective
Have thoughts, counterpoints, or reflections on this story? Engage directly with fellow readers and editorial contributors.
No comments on this guide yet. Be the first to share your thoughts or ask a question!