Plex Media Server transforms your Linux Mint system into a centralized streaming hub for your personal video, music, and photo collections. You’ll set up automatic metadata fetching so your library displays cover art and descriptions, configure transcoding to stream to phones and smart TVs, and enable remote access so you can watch your content anywhere.
This guide covers repository installation with DEB822 format for automatic updates, UFW firewall configuration for network and remote streaming, file permission setup using ACLs or ownership transfer, and optional Nginx reverse proxy with Let’s Encrypt SSL for secure external connections. After completing these steps, you’ll verify the service is running and access the web interface to add your media libraries.
Update Linux Mint Before Installing Plex
Start by updating your Linux Mint system to ensure a smooth installation process. This ensures all existing packages are up to date:
sudo apt update && sudo apt upgrade
Install Repository Dependencies
Plex installation requires some additional packages. Install them by running the following command:
sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y
These packages will provide the tools for handling the Plex repository, including secure connections and GPG key management.
Import Plex APT Repository
Add the Plex repository to your Linux Mint system to install Plex from the official source. This ensures you install and update the software directly from the official repository using the APT package manager.
First, open your terminal and import the Plex GPG key with the following command:
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.key | sudo gpg --dearmor -o /usr/share/keyrings/plex.gpg
This command downloads Plex’s signing key and stores it in the system keyring. The Signed-By directive in the next step ensures only Plex packages are trusted from this key.
Next, create a DEB822 repository definition so APT can pull Plex updates automatically:
sudo tee /etc/apt/sources.list.d/plexmediaserver.sources > /dev/null <<'EOF'
Types: deb
URIs: https://downloads.plex.tv/repo/deb
Suites: public
Components: main
Signed-By: /usr/share/keyrings/plex.gpg
EOF
The Signed-By line scopes the GPG key to this repository only, preventing unrelated packages from trusting it.
Install Plex Media Server
Before installing Plex, update your package index to include the newly added Plex repository:
sudo apt update
Verify the Plex repository appears in the update output:
Get:1 https://downloads.plex.tv/repo/deb public InRelease [5,180 B]
Now you can install Plex Media Server on Linux Mint using the following command:
sudo apt install plexmediaserver -y
During the installation, you may see a prompt asking if you want to replace the repository configuration. Type N to keep your DEB822 .sources file, which already contains the correct Signed-By path. The installer may create a duplicate .list file, which you can safely ignore or remove.
Verify Plex Installation and Service Status
By default, the Plex Media service should start automatically. To verify this, use the following systemctl command to check the status:
systemctl status plexmediaserver
A healthy service shows Active: active (running):
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled)
Active: active (running)

If the service is not active, use the following command to start Plex Media Server:
sudo systemctl start plexmediaserver
To ensure Plex Media Server starts automatically on system boot, enable the service with this command:
sudo systemctl enable plexmediaserver
Verify the service is enabled:
systemctl is-enabled plexmediaserver
enabled
If you need to restart the Plex Media Server service for any reason, use the following command:
sudo systemctl restart plexmediaserver
Configure UFW Firewall
Securing your Plex Media Server is crucial, especially when you plan to access it remotely or allow others to access it. UFW (Uncomplicated Firewall) restricts incoming connections to only the ports Plex requires for streaming and discovery. For comprehensive firewall management beyond Plex, see our guide on configuring UFW on Ubuntu (compatible with Linux Mint).
Enable UFW Firewall
First, check if UFW is installed on your system. If not, install it using the following command:
sudo apt install ufw -y
If you access this system remotely via SSH, allow SSH before enabling UFW. Skipping this step locks out your session immediately and may require physical console access to recover.
Allow SSH (if needed) and enable UFW:
sudo ufw allow OpenSSH
sudo ufw enable
Firewall is active and enabled on system startup
Add Plex Media Server Port Rules
Add the default Plex Media Server port (32400) to the UFW rules. You can customize the port later if you wish. If you change the Plex Media Server dashboard port, delete this rule and add a new one.
sudo ufw allow 32400
Configure Discovery and Companion Ports
Plex Media Server uses several additional ports for different services and connections. To allow them through the UFW firewall, use the following commands:
sudo ufw allow 1900/udp
sudo ufw allow 3005/tcp
sudo ufw allow 5353/udp
sudo ufw allow 8324/tcp
sudo ufw allow 32410:32414/udp
Here’s a brief explanation of the ports and their purposes:
- 1900/udp: Used for the discovery of Plex Media Server by clients over the network.
- 3005/tcp: Required for Plex Companion, a feature that allows you to control Plex playback from a mobile device.
- 5353/udp: Used for mDNS (Multicast Domain Name System) to help Plex discover devices on the local network.
- 8324/tcp: Required for the Plex DLNA server.
- 32410:32414/udp: Used for media streaming to clients.
Adjust your UFW rules if you customize any of the ports mentioned above.
Set Up SSH Tunnel for Headless Setup
If you installed Plex Media Server on a remote headless server or another Linux Mint desktop to which you do not always have local access, you need to set up an SSH tunnel on your local computer for the initial setup. Plex restricts first-time configuration to localhost for security, so the tunnel forwards traffic through a trusted channel. For detailed SSH setup instructions, refer to our SSH installation guide for Ubuntu (compatible with Linux Mint).
Set up the SSH Tunnel
From your local workstation, create a tunnel that forwards port 8888 to the server’s Plex port. Replace {server-ip-address} with your server’s actual IP:
ssh {server-ip-address} -L 8888:localhost:32400
Keep the SSH session open during initial setup. Closing it breaks the tunnel and disconnects you from Plex.
If SSH is not installed on the server yet, install and enable it:
sudo apt install openssh-server -y
sudo systemctl enable ssh --now
Verify SSH is running:
systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
Active: active (running)
Access Plex Media Server via SSH Tunnel
Now you can access the Plex Media Server by opening the following address in your web browser:
http://localhost:8888/web
Or use the alternative address if the above one does not work:
https://localhost:8888/web/index.html#!/setup
The SSH tunnel will redirect the HTTP request to http://localhost:32400/web on the remote server.
Access Plex Media Server Remotely
Once you have completed the initial setup, you can access your Plex Media Server using your server’s IP address on the LAN:
http://{server-ip-address}:32400
After completing setup, you can also connect through Plex’s relay at app.plex.tv, which terminates on a trusted plex.direct hostname.
Complete Initial Setup
Now that Plex is installed on your system, you must configure and finish the setup through the WebUI. To access this, open your preferred internet browser and navigate to:
http://127.0.0.1:32400/web
or
http://localhost:32400/web
If these two do not work, try changing the ends with:
http://localhost:32400/web/index.html#!/setup

Now, you can log in using an existing social media account listed above or with your email to register a new account if you are new to Plex. Once logged in, you will begin the initial configuration setup.
Walk Through the Welcome Screen
The first configuration page briefly explains what Plex is and how it works. Click “GOT IT!” to proceed to the next page.
Firefox users may see a message prompting them to enable DRM. Approve it so the Plex Web UI can display video previews correctly.

Evaluate Plex Pass (Optional)
Plex offers a Plex Pass upsell that unlocks mobile sync, HDR tone mapping, and early access builds. Click the X in the corner if you are not ready to subscribe yet.

Name the Server and Enable Remote Access
Give the server a recognizable name. You also have the option to disable Allow me to access my media outside my home. Leaving it on lets Plex broker connections through its relay service; disable it if you prefer to rely strictly on your own reverse proxy or VPN.
Once configured, click NEXT to continue.

Add or Skip Media Libraries
You can pre-load media folders now or skip and return later from the dashboard. Click ADD LIBRARY when you are ready.

Now select the type of media you want your folders to be organized into, such as TV shows, movies, music, etc.
Click the “NEXT” button to proceed to add folders.

Click the “BROWSE FOR MEDIA FOLDER” button and select the media directory.

Once the folder is added, the Advanced options will appear, where you can further customize Plex to your liking.
When you’re done, click “ADD LIBRARY” to continue with the initial configuration setup installation.

Finish the Wizard
Click NEXT to finish the initial setup, with or without adding a media library. The next screen confirms you are all set. Click DONE to proceed to the Plex Dashboard.

Now, you will arrive at your Plex Dashboard.

Set Media Directory Permissions for Plex
During the initial setup, you may have noticed that your media did not appear. You may have problems adding content that will not be picked up, with Plex refusing to find the content on your existing internal and external secondary hard drives. This is because Plex runs as a dedicated user account named plex, which needs read and execute permission on your media directories.
You can grant access using either setfacl or chown. Use setfacl when you want Plex to access folders without changing ownership, which is ideal for shared drives where other users also need access. Use chown when Plex should own the media directories outright.
Grant Access with setfacl
Use setfacl to grant Plex read and execute access without changing file ownership:
sudo setfacl -R -m u:plex:rx /media/yourfolder/
sudo setfacl -R -m u:plex:rx /media/yourfolder/tv
sudo setfacl -R -m u:plex:rx /media/yourfolder/movies
Verify the permissions were applied immediately after setting them:
getfacl /media/yourfolder/
Expected output shows Plex has read and execute access:
# file: media/yourfolder/ # owner: yourusername # group: yourusername user::rwx user:plex:r-x group::r-x mask::r-x other::r-x default:user::rwx default:user:plex:r-x default:group::r-x default:mask::r-x default:other::r-x
Set a default ACL so any new files added to the directory inherit Plex permissions automatically:
sudo setfacl -d -m u:plex:rx /media/yourfolder/
Transfer Ownership with chown
Use chown when Plex should fully own the media directories:
sudo chown -R plex:plex /media/yourfolder/
Or set permissions for individual files in the hard drive if other folders are present that you do not want Plex to access:
sudo chown -R plex:plex /media/yourfolder/tv
sudo chown -R plex:plex /media/yourfolder/movies
Verify ownership changed correctly:
ls -la /media/yourfolder/
Expected output shows plex plex as owner and group:
drwxr-xr-x 4 plex plex 4096 Nov 28 10:00 . drwxr-xr-x 3 root root 4096 Nov 28 09:00 .. drwxr-xr-x 2 plex plex 4096 Nov 28 10:00 movies drwxr-xr-x 2 plex plex 4096 Nov 28 10:00 tv
Install ACL Package (If Needed)
If the commands above are not working, you may need to reinstall the ACL package if it is missing from your system:
sudo apt install acl -y
Configure Nginx Reverse Proxy
Setting up a reverse proxy allows you to access Plex Media Server from a remote computer or network using a custom domain with SSL encryption. In this example, we will set up an Nginx proxy server. For more Nginx configuration options, see our guide on creating reverse proxies in Nginx.
Install Nginx
First, install Nginx with the following command:
sudo apt install nginx -y
By default, Nginx should be enabled. If it is not activated, use the following command:
sudo systemctl enable nginx --now
Now check to make sure Nginx is activated and has no errors:
systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: active (running)
Create a Plex Server Block
Create a new server block as follows:
sudo nano /etc/nginx/conf.d/plex.conf
You will need an active domain name and need to create a sub-domain. Once done, add the following to the server block file:
server {
listen 80;
server_name plex.example.com;
location / {
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:32400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 3600;
}
}
The proxy_read_timeout value prevents long transcodes from timing out. Save the file (CTRL+O), then exit (CTRL+X).
Test Nginx Configuration
Perform a dry run to ensure there are no errors in the Nginx configuration or your server block:
sudo nginx -t
If everything is working correctly, the example output should be:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful
Reload Nginx for the change to take effect:
sudo systemctl reload nginx
If you have set up your domain and DNS records to point to your server IP, you can now access your Plex Media Server at plex.example.com.
Secure Reverse Proxy with Let’s Encrypt SSL Free Certificate
It would be best to run your Nginx on HTTPS using an SSL certificate. You can use Let’s Encrypt, a free, automated, open certificate authority run by the nonprofit Internet Security Research Group (ISRG).
First, install the certbot package as follows:
sudo apt install python3-certbot-nginx -y
Once installed, run the following command to start creating your certificate:
sudo certbot --nginx --agree-tos --redirect --email you@example.com -d plex.example.com
This command obtains an SSL certificate and configures Nginx to force HTTPS redirects automatically. Certbot’s Nginx plugin handles the virtual host modifications for you. Make sure to adjust the email and domain name to your requirements.
Your URL will now be https://plex.example.com instead of http://plex.example.com. If you use the old HTTP URL, it will automatically redirect to HTTPS.
Verify Automatic Certificate Renewal
Modern certbot installations include a systemd timer that handles automatic renewal. Verify it’s active:
sudo systemctl status certbot.timer
Expected output shows the timer is active:
● certbot.timer - Run certbot twice daily
Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; preset: enabled)
Active: active (waiting) since ...
Test that the renewal process works correctly with a dry run:
sudo certbot renew --dry-run
A successful test shows:
Congratulations, all simulated renewals succeeded: /etc/letsencrypt/live/plex.example.com/fullchain.pem (success)
The systemd timer checks for renewal twice daily and renews certificates within 30 days of expiration. No manual cron job is required.
Troubleshoot Common Plex Issues
Plex Cannot Find Media Files
If Plex shows empty libraries despite media files being present, the plex user likely lacks read permissions on your media directories.
Check current permissions on your media folder:
ls -la /media/yourfolder/
Example output showing folders owned by your user (not plex):
drwxr-xr-x 4 youruser youruser 4096 Nov 28 10:00 . drwxr-xr-x 2 youruser youruser 4096 Nov 28 10:00 movies drwxr-xr-x 2 youruser youruser 4096 Nov 28 10:00 tv
Grant Plex access using setfacl:
sudo setfacl -R -m u:plex:rx /media/yourfolder/
Verify Plex now has access:
getfacl /media/yourfolder/ | grep plex
user:plex:r-x
After fixing permissions, rescan the library in the Plex WebUI: Settings → Libraries → select library → Scan Library Files.
Plex Service Fails to Start
If Plex does not start after installation or reboot, check the service status for errors:
sudo systemctl status plexmediaserver
Example output showing a failed service:
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled)
Active: failed (Result: exit-code)
Check the journal for specific error messages:
sudo journalctl -xeu plexmediaserver --no-pager | tail -30
Common error: Port 32400 already in use by another service. Check what’s using the port:
sudo ss -tulpn | grep 32400
If another service is using port 32400, stop it or reconfigure Plex to use a different port in /etc/default/plexmediaserver. After resolving the conflict, restart Plex:
sudo systemctl restart plexmediaserver
Verify the service started successfully:
systemctl status plexmediaserver | grep Active
Active: active (running)
Manage Plex Media Server
Update Plex Media Server on Linux Mint
Plex Media Server can be updated using the standard apt update command, which is commonly used to update packages on your system.
Check for Updates
To check for updates, run the following command:
sudo apt update
Upgrade Plex Media Server
If an update is available, use the upgrade command to update Plex Media Server:
sudo apt upgrade plexmediaserver -y
Remove Plex Media Server
If you no longer wish to use Plex and want to remove it from your Linux Mint system, follow these steps.
Uninstall Plex Media Server
Execute the following command to remove Plex Media Server from your system:
sudo apt remove plexmediaserver
Remove the Plex Repository and GPG Key
Remove the repository file and GPG signing key:
sudo rm /etc/apt/sources.list.d/plexmediaserver.sources
sudo rm /usr/share/keyrings/plex.gpg
sudo apt autoremove -y
Remove Plex Data (Optional)
The following command permanently deletes all Plex configuration, metadata, and library data. Export any playlists or settings you want to keep before proceeding.
To remove all Plex server data including metadata and preferences:
sudo rm -rf /var/lib/plexmediaserver
Disable Nginx Reverse Proxy (If Applicable)
If you installed the Nginx reverse proxy, remove the configuration file and reload Nginx:
sudo rm /etc/nginx/conf.d/plex.conf
sudo systemctl reload nginx
If you no longer need Nginx at all, disable and remove it:
sudo systemctl disable nginx --now
sudo apt remove nginx
First-Time User Tips
Organize Your Media Library
Plex’s metadata agents rely on consistent file naming to fetch posters, descriptions, and episode data. Follow these naming conventions:
- Movies:
/media/movies/Movie Name (Year)/Movie Name (Year).mkv - TV Shows:
/media/tv/Show Name/Season 01/Show Name - S01E01.mkv - Music:
/media/music/Artist Name/Album Name/01 - Track Name.mp3
Including the year for films and season/episode numbers for TV shows gives Plex enough context to match metadata correctly.
Control Library Scan Behavior
After the wizard finishes, open Settings → Library to customize how Plex watches for new content:
- Scan my library automatically: Reacts immediately when files sync over network shares.
- Run a partial scan when changes are detected: Uses inotify to rescan only affected folders, saving time on larger collections.
- Update my library periodically: Runs a scheduled rescan for content added via cron jobs or download managers.
Disable CPU-heavy extras like Generate video preview thumbnails on older hardware until your initial library import completes.
Optimize Transcoding Performance
Transcoding converts high-bitrate masters into streams each device can handle. Keep sessions smooth with these adjustments:
- Enable hardware acceleration in Settings → Transcoder if your CPU or GPU supports Intel Quick Sync, AMD VCN, or NVIDIA NVENC. Linux Mint users with NVIDIA cards can follow our guide to install NVIDIA drivers on Linux Mint for hardware transcoding support.
- Point the transcoding temporary directory to SSD storage so Plex does not stall on slow spinning disks.
- Ask remote users to select appropriate quality presets in the Plex app to avoid unnecessary 4K to 1080p conversions.
Troubleshoot Remote Access
If Plex’s Remote Access page shows Not available outside your network, the server cannot receive incoming connections on port 32400.
Verify your public IP and that the port is open:
curl -4 ifconfig.me
sudo ss -tulpn | grep 32400
sudo ufw status numbered
The first command shows your public IP (confirm it matches what Plex reports). The second confirms Plex is listening locally. The third verifies UFW allows port 32400. If all checks pass, log into your router and forward TCP 32400 to the Plex server’s LAN IP, then refresh the Remote Access page in Plex.
Useful Links
Bookmark these official Plex resources for updates, troubleshooting, and community support:
- Plex Official Website: Download clients, manage your account, and explore Plex features.
- Plex Support: Official documentation, troubleshooting guides, and FAQs.
- Plex Forums: Community discussions, feature requests, and peer support.
Conclusion
You now have Plex Media Server running on Linux Mint with DEB822 repository configuration for automatic updates, UFW firewall rules protecting ports 32400 and discovery services, file permissions configured via ACLs or ownership transfer, and optionally an Nginx reverse proxy with Let’s Encrypt SSL for secure remote access. The techniques covered—SSH tunneling for initial setup, setfacl for granular permissions, and certbot automation for certificate renewal—form a solid foundation for self-hosted media streaming.
For next steps, consider organizing your media library using Plex’s naming conventions to improve metadata matching, enabling hardware transcoding if you have a compatible GPU (see our NVIDIA drivers guide for Linux Mint), or downloading content with qBittorrent on Linux Mint. If you prefer a fully open-source alternative, Jellyfin Media Server offers similar functionality without proprietary components or subscription features.
Great tutorial. Only one thing missing. And that is how to configure plex server to use on dynamic address that would be nice to add.
Thank you. Followed the steps and it worked perfectly.
What a fantastic blow-by-blow detail of how to get the Plex media server going on Mint! As a newbie this is just what I want; all I have to do now is try it out!! Many Thanks!
I will try this as I am stuck on getting Plex to see my files. Why is it so complicated? The installer should do all this stuff.