How to Install Plex on Ubuntu

Install Plex Media Server on Ubuntu from the official repo.plex.tv APT repository or a .deb download, start plexmediaserver with systemctl, open port 32400, complete setup at http://127.0.0.1:32400/web, and fix plex user permissions on Ubuntu Server.

Published

Updated

Read time 7 min read

Reviewed byDeepak Prasad

Install Plex on Ubuntu banner with media play icon, server streaming motif, and Ubuntu orange accent

Plex Media Server turns your Ubuntu box into a personal Netflix—movies, TV, music, and photos streamed to phones, TVs, and browsers. Ubuntu does not ship a current Plex package in its default archives; you install from Plex’s official APT repository (repo.plex.tv) or a downloaded .deb (Plex Support — Installation).

This guide covers install Plex on Ubuntu and install Plex on Ubuntu Server: add the repo, install plexmediaserver, verify systemd, open the web UI at http://127.0.0.1:32400/web, configure UFW, fix plex user media permissions, and optional Snap install. Commands below were tested on Ubuntu 25.04.

Tested on: Ubuntu 25.04 (Plucky Puffin); kernel 6.14.0-37-generic; amd64; Plex Media Server 1.43.2.10687-563d026ea.

NOTE
Plex Media Server has no desktop window. After install you manage everything in the browser (Plex Web App). On Ubuntu Server, use an SSH tunnel for first-time setup—same workflow Plex documents for remote networks (Plex Support).

Quick command summary

Task Command
Add Plex GPG key curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.v2.key | sudo gpg --dearmor -o /usr/share/keyrings/plexmediaserver.gpg
Add APT repo (DEB822) See Step 2 below
Install (recommended) sudo apt update && sudo apt install -y plexmediaserver
Install from .deb file sudo apt install -y ./plexmediaserver_*.deb
Check service sudo systemctl status plexmediaserver
Local web UI http://127.0.0.1:32400/web
SSH tunnel (headless setup) ssh -L 8888:127.0.0.1:32400 user@SERVER_IPhttp://127.0.0.1:8888/web
Open firewall port sudo ufw allow 32400/tcp
Grant media access sudo setfacl -R -m u:plex:rx /path/to/media
Snap (optional) sudo snap install plexmediaserver
Remove package sudo apt remove plexmediaserver

Prerequisites

  • Ubuntu 22.04 LTS, 24.04 LTS, or newer (25.04 tested) on amd64, arm64, or armhf (Plex publishes builds for each).
  • sudo and outbound HTTPS to repo.plex.tv / downloads.plex.tv.
  • cURL, gpg, and ca-certificates for the Plex apt repository setup.
  • A Plex account (free) for server claim and remote features.
  • Organized media before scanning—movies as Movie Name (Year).ext, TV as Show/Season XX/Show s01e01.ext (Plex naming guide).
  • Filesystem that supports symlinks/hardlinks (standard ext4/xfs is fine).

What you are installing

Item Detail
Package plexmediaserver
Service plexmediaserver.service (systemd)
Process user plex (groups: plex, video, render)
Application dir /usr/lib/plexmediaserver/
Data / metadata /var/lib/plexmediaserver/
Web port TCP 32400
Web UI path /web → setup wizard on first run

Plex is not the Plex desktop player app—it is the server that hosts libraries and transcodes streams.


Choose an install method

Method Best for Updates
APT repo (repo.plex.tv) Ubuntu Server & Desktop (recommended) sudo apt upgrade plexmediaserver
Direct .deb download Air-gapped or one-off install Manual re-download
Snap Quick trial snap refresh plexmediaserver (Snap Store)

Avoid the legacy downloads.plex.tv/plex-media-server-new/debian one-line source if you can—Plex now publishes current builds from https://repo.plex.tv/deb/.


Step 1: Refresh Ubuntu packages

bash
sudo apt update && sudo apt upgrade -y

Install tools for the signed repository:

bash
sudo apt install -y curl gpg ca-certificates

Import Plex’s signing key (replaces deprecated apt-key):

bash
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.v2.key | \
 sudo gpg --dearmor --yes -o /usr/share/keyrings/plexmediaserver.gpg

Create the DEB822 source file (Plex repository updating):

bash
printf '%s\n' \
 'Types: deb' \
 'URIs: https://repo.plex.tv/deb/' \
 'Suites: public' \
 'Components: main' \
 "Architectures: $(dpkg --print-architecture)" \
 'Signed-By: /usr/share/keyrings/plexmediaserver.gpg' | \
 sudo tee /etc/apt/sources.list.d/plexmediaserver.sources > /dev/null

Reload indexes and confirm the candidate:

bash
sudo apt update
apt-cache policy plexmediaserver

Example on Ubuntu 25.04:

text
Get:2 https://repo.plex.tv/deb public InRelease [4,069 B]
Get:6 https://repo.plex.tv/deb public/main amd64 Packages [393 B]
---
plexmediaserver:
 Installed: (none)
 Candidate: 1.43.2.10687-563d026ea
 Version table:
 1.43.2.10687-563d026ea 500
 500 https://repo.plex.tv/deb public/main amd64 Packages

Step 3: Install Plex Media Server

bash
sudo apt install -y plexmediaserver

Relevant installer output:

text
Setting up plexmediaserver (1.43.2.10687-563d026ea) ...
PlexMediaServer install: PlexMediaServer-1.43.2.10687-563d026ea - Installation successful. Errors: 0, Warnings: 0
Created symlink .../plexmediaserver.service → /usr/lib/systemd/system/plexmediaserver.service

Verify:

bash
dpkg -l plexmediaserver
sudo systemctl is-enabled plexmediaserver
sudo systemctl is-active plexmediaserver
text
ii plexmediaserver 1.43.2.10687-563d026ea amd64 Plex organizes all of your personal media...
enabled
active

Confirm the web listener:

bash
ss -tlnp | grep 32400
curl -sI http://127.0.0.1:32400/web | head -8
text
LISTEN 0 1024 *:32400 *:*
HTTP/1.1 302 Moved Temporarily
X-Plex-Protocol: 1.0
Location: http://127.0.0.1:32400/web/index.html#!/setup/...

A 302 redirect to #!/setup/ means Plex is ready for the first-run wizard.


Step 4: Install from a .deb file (alternative)

When you prefer a manual package (Plex Support — Ubuntu):

  1. Download the latest 64-bit .deb from plex.tv/media-server-downloads or resolve the URL from Plex’s API:
bash
curl -sL https://plex.tv/api/downloads/5.json | python3 -c "
import json, sys
data = json.load(sys.stdin)
for r in data['computer']['Linux']['releases']:
 if r.get('distro') == 'debian' and r['url'].endswith('.deb'):
 print(r['url']); break
"
  1. Download and install with wget / apt:
bash
wget -O /tmp/plexmediaserver.deb 'https://downloads.plex.tv/plex-media-server-new/1.43.2.10687-563d026ea/debian/plexmediaserver_1.43.2.10687-563d026ea_amd64.deb'
sudo apt install -y /tmp/plexmediaserver.deb

Tested download size: ~84 MB. Use sudo apt install ./file.debnot dpkg -i file.deb -y (dpkg does not take -y, and apt install fixes dependencies automatically).

To enable future upgrades after a manual .deb, still add the Step 2 repository.


Step 5: Install via Snap (optional)

bash
sudo snap install plexmediaserver

Snap stable on Ubuntu matched the deb version in tests (1.43.2.10687-563d026ea, publisher plexinc). Manage at http://localhost:32400/manage per Snapcraft. Pick either Snap or deb/apt—not both on the same host.


Step 6: Complete Plex Web setup

Ubuntu Desktop

Open a browser on the same machine:

text
http://127.0.0.1:32400/web

Ubuntu Server (headless)

From your workstation, tunnel Plex’s localhost port (Plex Support — SSH tunnel):

bash
ssh -L 8888:127.0.0.1:32400 username@SERVER_IP

Then browse:

text
http://127.0.0.1:8888/web

Wizard steps

  1. Sign in with your Plex account (create one if needed).
  2. Name the server (e.g. ubuntu-plex).
  3. Choose whether to enable remote access (Plex relay) or stay LAN-only.
  4. Add libraries (Movies, TV Shows, Music, Photos) or skip and add later under Settings → Manage → Libraries.
  5. Click Finish—Plex begins scanning attached folders.

LAN access from another device

On the same network, use the server’s IP:

text
http://192.168.1.50:32400/web

Replace with your server’s address (ip -4 addr show).


Step 7: Grant Plex access to media folders

Plex runs as user plex. It needs read + execute on every directory in the path to your files:

bash
id plex
text
uid=993(plex) gid=977(plex) groups=977(plex),44(video),991(render)

ACL approach (keeps your user as owner):

bash
sudo apt install -y acl
sudo setfacl -R -m u:plex:rx /media/movies
sudo setfacl -d -m u:plex:rx /media/movies
sudo -u plex test -r /media/movies && echo "plex can read media"

Ownership approach (dedicated Plex disk):

bash
sudo chown -R plex:plex /media/movies
sudo systemctl restart plexmediaserver

Without correct permissions, libraries stay empty even when paths look right in the UI.


Step 8: Firewall (Ubuntu Server)

If UFW is enabled, allow SSH first, then Plex:

bash
sudo ufw allow OpenSSH
sudo ufw allow 32400/tcp
sudo ufw enable
sudo ufw status
text
To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
32400/tcp ALLOW Anywhere

Reload is automatic on rule add. Remote Plex clients on your LAN can now reach port 32400 directly.


Manage, update, and remove

Service control (systemd):

bash
sudo systemctl start plexmediaserver
sudo systemctl stop plexmediaserver
sudo systemctl restart plexmediaserver

Update (with Plex repo configured):

bash
sudo apt update
sudo apt install --only-upgrade plexmediaserver -y
dpkg-query -W -f='${Version}\n' plexmediaserver

Remove package, keep library data:

bash
sudo apt remove plexmediaserver

Metadata remains under /var/lib/plexmediaserver/.

Full removal:

bash
sudo apt purge plexmediaserver
sudo rm -rf /var/lib/plexmediaserver
sudo rm -f /etc/apt/sources.list.d/plexmediaserver.sources
sudo rm -f /usr/share/keyrings/plexmediaserver.gpg

Troubleshooting

Symptom Likely cause Fix
HTTP/1.1 503 on /web Service still starting Wait 10–30 s; sudo systemctl status plexmediaserver
Libraries empty after scan plex cannot read paths ACLs or chown; verify with sudo -u plex ls /media/...
Unit plexmediaserver.service not found Install failed or partial Reinstall plexmediaserver; sudo systemctl daemon-reload
403 / unsigned repo on apt update Legacy downloads.plex.tv source or bad key Switch to repo.plex.tv DEB822 source (Step 2)
Cannot complete setup on Server No browser on host SSH tunnel ssh -L 8888:127.0.0.1:32400 ...
Remote clients cannot connect UFW blocking 32400 sudo ufw allow 32400/tcp; check router port forward
Two Plex instances conflict Snap + deb both installed Remove one method completely
dpkg: error processing missing deps Used dpkg -i alone sudo apt install -y ./plexmediaserver_*.deb instead
Wrong metadata / unmatched episodes Folder naming Follow Plex movie/TV folder layout before scanning

References


Summary

The reliable way to install Plex on Ubuntu is Plex’s official repo.plex.tv APT repository: import PlexSign.v2.key, add the DEB822 plexmediaserver.sources file, run sudo apt install -y plexmediaserver, then open http://127.0.0.1:32400/web. On Ubuntu Server, tunnel with ssh -L 8888:127.0.0.1:32400 for first-time setup.

Tested install: 1.43.2.10687-563d026ea, service enabled/active, port 32400 listening, web UI returning 302 to the setup wizard. Grant the plex user read access to media, open 32400/tcp in UFW for LAN clients, and use apt upgrade for updates.

Frequently Asked Questions

1. How do I install Plex on Ubuntu?

Add Plex official APT repo (repo.plex.tv/deb with PlexSign.v2.key), run sudo apt update && sudo apt install -y plexmediaserver, then open http://127.0.0.1:32400/web in a browser. Alternatively download the amd64 .deb from Plex downloads and run sudo apt install ./plexmediaserver_*.deb.

2. How do I install Plex on Ubuntu Server without a desktop?

Install plexmediaserver the same way as desktop. Plex has no GUI window—management is via the web app. On a headless server, SSH tunnel: ssh -L 8888:127.0.0.1:32400 user@server, then browse http://127.0.0.1:8888/web for first-time setup.

3. Does Ubuntu ship Plex in the default apt repositories?

No. Ubuntu archives do not include current Plex Media Server. Use Plex vendor repository at repo.plex.tv/deb or download the .deb from plex.tv/media-server-downloads.

4. What port does Plex use on Ubuntu?

TCP 32400. Allow it in UFW with sudo ufw allow 32400/tcp if remote clients on your LAN need direct access. Plex remote access may also use Plex relay when port forwarding is unavailable.

5. Which user does Plex run as on Linux?

The plex system account (uid plex, groups plex, video, render). Media folders must be readable and traversable by plex—use ACLs (setfacl) or chown as needed.

6. Should I install Plex from Snap on Ubuntu?

The official plexmediaserver Snap from Plex Inc works, but most server guides prefer the APT package or .deb for predictable paths (/var/lib/plexmediaserver) and apt upgrades. Choose one method—do not mix Snap and deb installs.

7. How do I update Plex on Ubuntu?

With the Plex repo configured: sudo apt update && sudo apt install --only-upgrade plexmediaserver. For manual .deb installs, download the new package and sudo apt install ./plexmediaserver_NEW.deb.

8. How do I uninstall Plex but keep my library data?

sudo apt remove plexmediaserver keeps /var/lib/plexmediaserver metadata. Use sudo apt purge plexmediaserver and manually delete /var/lib/plexmediaserver only when you want a full wipe.

9. Why does Plex show 503 or not load right after install?

The service may still be starting plugins. Wait 10–30 seconds and retry curl -I http://127.0.0.1:32400/web. Check sudo systemctl status plexmediaserver and /var/lib/plexmediaserver/ permissions.
Omer Cakmak

Linux Administrator

Highly skilled at managing Debian, Ubuntu, CentOS, Oracle Linux, and Red Hat servers. Proficient in bash scripting, Ansible, and AWX central server management, he handles server operations on …