How to Install Plex Media Server on Debian

Install Plex Media Server on Debian 11, 12, or 13 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, grant the plex user media permissions, update with apt, and remove cleanly.

Published

Updated

Read time 10 min read

Reviewed byDeepak Prasad

Install Plex Media Server on Debian hero with DEBIAN INSTALL badge, Plex streaming graphics, and apt repository feature highlights

Plex Media Server turns a Debian box into a personal streaming hub—movies, TV, music, and photos organized with metadata and delivered to phones, TVs, and browsers. Debian 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 Media Server on Debian for Debian 11 (Bullseye), 12 (Bookworm), and 13 (Trixie): add the current v2 repository, install plexmediaserver, verify systemd, open the web UI, fix plex user media permissions, configure UFW, back up server data, update, and uninstall. I ran these steps on Debian 13 and kept real terminal output below so you can compare your machine.

Tested on: Debian 13 (trixie); kernel 6.12.94+deb13-amd64; 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 a headless server, use an SSH tunnel for first-time setup—the same workflow Plex documents for remote networks (Plex Support).

Choose an install method

Method Best for Updates
APT repo (repo.plex.tv) Debian servers and desktops (recommended) sudo apt install --only-upgrade plexmediaserver
Direct .deb download One-off install or air-gapped hosts Manual re-download, or add the repo afterward

Most readers should use the APT repository—you get the same package as a manual .deb, and security updates arrive through apt. Avoid mixing Snap and deb installs on one host.

IMPORTANT
Plex changed its Linux repository starting with Plex Media Server 1.43.0. Do not follow older guides that use https://downloads.plex.tv/repo/deb with PlexSign.key and apt-key add. This article uses https://repo.plex.tv/deb/ and PlexSign.v2.key.

Confirm the Debian architecture before adding repos; the dpkg command covers --print-architecture and multiarch setup.

Prerequisites

  • Debian 11, 12, or 13 on amd64, arm64, or armhf (Plex publishes builds for each; dpkg --print-architecture must match).

  • sudo and outbound HTTPS to repo.plex.tv / downloads.plex.tv.

  • cURL, gpg, and ca-certificates for the signed repository setup.

  • A Plex account (free) to claim the server and use clients.

  • Organized media before scanning—movies as Movie Name (Year).ext, TV as Show Name/Season XX/Show Name - s01e01.ext (Plex naming guide).

  • A filesystem that supports symlinks/hardlinks (standard ext4/xfs is fine).

  • For broader CLI reference beyond the apt and sudo steps below, see the Linux commands.


What you are installing

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

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


Step 1: Refresh Debian packages

bash
sudo apt update && sudo apt upgrade -y

Install tools for the signed repository:

bash
sudo apt install -y curl gpg ca-certificates

Step 2: Remove legacy Plex repository files

Skip this on a fresh host. If Plex was installed from an older article (downloads.plex.tv/repo/deb, apt-key, or one-line .list files), remove stale sources before adding the current v2 repository:

bash
sudo rm -f \
  /etc/apt/sources.list.d/plex.list \
  /etc/apt/sources.list.d/plexmediaserver.list \
  /etc/apt/sources.list.d/plexmediaserver.sources \
  /usr/share/keyrings/plex.gpg \
  /usr/share/keyrings/plexmediaserver.gpg \
  /etc/apt/keyrings/plexmediaserver.gpg

This removes repository metadata only—not installed packages or /var/lib/plexmediaserver library data.


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

bash
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.v2.key | \
 sudo gpg --dearmor --yes -o /etc/apt/keyrings/plexmediaserver.v2.gpg
sudo chmod 0644 /etc/apt/keyrings/plexmediaserver.v2.gpg

Optional fingerprint check (current key ends in 0B9C FFDE):

bash
gpg --show-keys --with-fingerprint /etc/apt/keyrings/plexmediaserver.v2.gpg
text
pub   ed25519 2024-02-20 [C]
      6EFF EB47 8A65 59D7 5C7C  4FE7 06C5 2179 0B9C FFDE
uid                      Plex Inc. (SHA-512)
sub   ed25519 2024-02-20 [S] [expires: 2029-02-18]

Create the DEB822 source file. Suites: public is Plex’s repository suite—not your Debian codename (bookworm, trixie, etc.):

bash
printf '%s\n' \
 'Types: deb' \
 'URIs: https://repo.plex.tv/deb/' \
 'Suites: public' \
 'Components: main' \
 "Architectures: $(dpkg --print-architecture)" \
 'Signed-By: /etc/apt/keyrings/plexmediaserver.v2.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

On Debian 13 the tail of apt update and apt-cache policy looked like this:

text
Get:4 https://repo.plex.tv/deb public InRelease [4,069 B]
Get:5 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

A non-empty Candidate from repo.plex.tv means the repository is wired correctly.


Step 4: Install Plex Media Server

bash
sudo apt install -y plexmediaserver

Relevant installer output:

text
PlexMediaServer install: Plex User:           plex
PlexMediaServer install: Metadata Dir:        /var/lib/plexmediaserver/Library/Application Support
Created symlink .../plexmediaserver.service → /usr/lib/systemd/system/plexmediaserver.service
PlexMediaServer install: PlexMediaServer-1.43.2.10687-563d026ea - Installation successful. Errors: 0, Warnings: 0

Verify the package, service, and listener:

Enable or disable the unit at boot with systemctl enable; the systemctl command documents enable --now, symlinks under /etc/systemd/system, and masks.

List listening TCP sockets with process names using ss -tlnp; the ss command documents -p, -n, and filtering by port.

bash
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package} ${Version}\n' plexmediaserver
systemctl is-enabled plexmediaserver
systemctl is-active plexmediaserver
ss -tlnp | grep ':32400'
text
ii  plexmediaserver 1.43.2.10687-563d026ea
enabled
active
LISTEN 0 1024 *:32400 *:* users:(("Plex Media Serv",pid=3454,fd=51))

If the service is not active yet:

bash
sudo systemctl enable --now plexmediaserver

Confirm the web UI responds (give Plex 10–30 seconds on first boot):

bash
curl -sI http://127.0.0.1:32400/web | head -8
text
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 5: Install from a .deb file (alternative)

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

  1. Download the latest .deb for your architecture 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)
arch = {'amd64':'amd64','arm64':'arm64','armhf':'armhf'}.get('$(dpkg --print-architecture)', 'amd64')
for r in data['computer']['Linux']['releases']:
 if r.get('distro') == 'debian' and arch in r['url'] 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

Use sudo apt install ./file.deb—not dpkg -i file.deb alone (apt install pulls dependencies automatically). To enable future upgrades after a manual .deb, still complete Step 3 (add the APT repository).


Step 6: Install via Snap (optional)

On Debian 9 and newer, enable snapd first:

bash
sudo apt update
sudo apt install -y snapd
sudo snap install snapd
sudo snap install plexmediaserver

Manage at http://localhost:32400/manage per Snapcraft — plexmediaserver on Debian. Pick either Snap or deb/apt—not both on the same host.


Step 7: Complete Plex Web setup

On the Debian server

Open a browser on the same machine:

text
http://127.0.0.1:32400/web

Headless server (SSH tunnel)

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

LAN access from another device

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

text
http://192.168.1.50:32400/web

Find the address with hostname -I or your router’s DHCP page.

Wizard steps

  1. Sign in with your Plex account (create one if needed).
  2. Name the server (for example debian-plex).
  3. Choose whether to enable remote access 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.

Start with one small library before pointing Plex at a multi-terabyte disk—permission and naming mistakes are easier to spot on a few files.


Step 8: Grant Plex access to media folders

Plex runs as user plex. It needs read + execute on every directory in the path to your files—not only the final media folder:

bash
id plex
text
uid=997(plex) gid=986(plex) groups=986(plex),44(video),992(render)

ACL approach (keeps your user as owner)—see Linux ACL examples:

bash
sudo apt install -y acl
sudo setfacl -R -m u:plex:rX /media/plex
sudo find /media/plex -type d -exec setfacl -m d:u:plex:rX {} +
sudo -u plex test -r /media/plex/movies && sudo -u plex test -x /media/plex/movies
sudo -u plex ls /media/plex/movies

The uppercase X grants execute on directories without making ordinary media files executable.

Home-directory media also needs traverse permission on parents:

bash
sudo setfacl -m u:plex:x /home /home/youruser
sudo setfacl -R -m u:plex:rX /home/youruser/media

Ownership approach (dedicated Plex disk only):

Ownership changes in this section use chown command syntax.

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

Inspect the full path when scans still find nothing:

bash
namei -l /media/plex/movies
text
f: /media/plex/movies
drwxr-xr-x root root /
drwxr-xr-x root root media
drwxr-xr-x root root plex
drwxr-xr-x root root movies

Drives mounted under /media/username/ often block the plex user until you grant execute on /media and the username directory—a common fix from community reports when external disks look invisible to Plex.


Step 9: Firewall (UFW)

Debian does not enable UFW by default on every install. When you use UFW, allow SSH before enabling it on a remote server:

bash
sudo apt install -y ufw
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

For LAN-only access, narrow the rule:

bash
sudo ufw delete allow 32400/tcp
sudo ufw allow from 192.168.1.0/24 to any port 32400 proto tcp

Remote Plex access also needs router port forwarding (external TCP port → internal 32400) when you want direct connections outside your home network.


Back up and restore Plex data

Plex stores metadata, watch state, posters, and preferences under /var/lib/plexmediaserver. Back up before major Debian upgrades or storage migrations:

Create a gzip-compressed archive with tar -czf; the tar command documents -z, verbose -v, and exclude patterns.

bash
backup_file="$HOME/plexmediaserver-backup-$(date +%Y%m%d).tar.gz"
sudo systemctl stop plexmediaserver
sudo tar -C /var/lib -czf "$backup_file" plexmediaserver
sudo chown "$USER:$USER" "$backup_file"
sudo systemctl start plexmediaserver
ls -lh "$backup_file"

On my test host the archive was about 157 KB with a fresh install (grows with library size). Store backups off the same disk as the live data.


Manage, update, and remove

Service control (systemd):

bash
sudo systemctl start plexmediaserver
sudo systemctl stop plexmediaserver
sudo systemctl restart plexmediaserver
sudo journalctl -u plexmediaserver -n 50 --no-pager

Update (with Plex repo configured):

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

Remove package, keep library data:

bash
sudo apt remove plexmediaserver

Metadata remains under /var/lib/plexmediaserver/.

Remove repository and keyring:

bash
sudo rm -f /etc/apt/sources.list.d/plexmediaserver.sources \
  /etc/apt/keyrings/plexmediaserver.v2.gpg
sudo apt update

Full removal (wipes metadata and settings):

bash
sudo systemctl stop plexmediaserver
sudo apt purge -y plexmediaserver
sudo rm -rf /var/lib/plexmediaserver

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; sudo -u plex ls /media/...; namei -l on full path
Candidate: (none) for plexmediaserver Bad source file or key Confirm DEB822 uses repo.plex.tv/deb, Suites: public, v2 keyring path
403 / unsigned repo on apt update Legacy downloads.plex.tv/repo/deb source Remove old files (Step 2); re-add v2 repository
Cannot complete setup on headless host No local browser SSH tunnel ssh -L 8888:127.0.0.1:32400 ...
Remote clients cannot connect UFW or router blocking 32400 sudo ufw allow 32400/tcp; forward WAN port to server
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 layout before scanning
Permission denied writing repo file sudo echo ... > file Use sudo tee as in Step 3

References

  • Plex Support — Installation
  • Plex Downloads
  • Install plexmediaserver Snap (Debian)
  • , , ,

Summary

The reliable way to install Plex Media Server on Debian is Plex’s official repo.plex.tv APT repository: import PlexSign.v2.key into /etc/apt/keyrings/plexmediaserver.v2.gpg, add the DEB822 plexmediaserver.sources file, run sudo apt install -y plexmediaserver, then open http://127.0.0.1:32400/web. On a headless host, 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 traverse and read access to media, open 32400/tcp in UFW for LAN clients, back up /var/lib/plexmediaserver before major changes, and use apt install --only-upgrade plexmediaserver for updates.


Frequently Asked Questions

1. How do I install Plex Media Server on Debian?

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. Does Debian ship Plex in the default apt repositories?

No. Debian 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.

3. What port does Plex use on Debian?

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

4. Which user does Plex run as on Debian?

The plex system account (groups plex, video, render). Media folders must be readable and traversable by plex on every parent directory in the path—use ACLs (setfacl) or chown as needed.

5. How do I install Plex on a headless Debian server?

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

6. Should I use the old downloads.plex.tv/repo/deb repository?

No. Plex moved to repo.plex.tv/deb with PlexSign.v2.key. Older articles that use apt-key and downloads.plex.tv/repo/deb can cause signature errors on Debian 12 and 13. Remove legacy source files before adding the current DEB822 source.

7. How do I update Plex on Debian?

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, or add the APT repository for future upgrades.

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

sudo apt remove plexmediaserver keeps /var/lib/plexmediaserver. Use sudo apt purge plexmediaserver and manually delete /var/lib/plexmediaserver only when you want a full wipe of settings, posters, and watch history.

9. Why does Plex show empty libraries after a scan?

The plex user cannot read or traverse the media path. Grant ACLs with setfacl, verify with sudo -u plex ls /path/to/media, and check namei -l on the full path. Home-directory media also needs execute permission on /home and the owning user directory.
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 …