| Tested on | Debian 13 (trixie) |
|---|---|
| Package | plexmediaserver 1.43.2.10687 |
| Applies to | Debian |
| Privilege | sudo or root |
| Scope | 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. |
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.
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.
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-architecturemust match). - cURL,
gpg, andca-certificatesfor 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 asShow Name/Season XX/Show Name - s01e01.ext(Plex naming guide). - A 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) |
| 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
sudo apt update && sudo apt upgrade -yInstall tools for the signed repository:
sudo apt install -y curl gpg ca-certificatesStep 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:
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.gpgThis removes repository metadata only—not installed packages or /var/lib/plexmediaserver library data.
Step 3: Add the official Plex APT repository (recommended)
Import Plex’s v2 signing key (replaces deprecated apt-key):
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.gpgOptional fingerprint check (current key ends in 0B9C FFDE):
gpg --show-keys --with-fingerprint /etc/apt/keyrings/plexmediaserver.v2.gpgpub 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.):
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/nullReload indexes and confirm the candidate:
sudo apt update
apt-cache policy plexmediaserverOn Debian 13 the tail of apt update and apt-cache policy looked like this:
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 PackagesA non-empty Candidate from repo.plex.tv means the repository is wired correctly.
Step 4: Install Plex Media Server
sudo apt install -y plexmediaserverRelevant installer output:
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: 0Verify 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.
dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package} ${Version}\n' plexmediaserver
systemctl is-enabled plexmediaserver
systemctl is-active plexmediaserver
ss -tlnp | grep ':32400'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:
sudo systemctl enable --now plexmediaserverConfirm the web UI responds (give Plex 10–30 seconds on first boot):
curl -sI http://127.0.0.1:32400/web | head -8HTTP/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):
- Download the latest
.debfor your architecture from plex.tv/media-server-downloads or resolve the URL from Plex’s API:
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
"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.debUse 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:
sudo apt update
sudo apt install -y snapd
sudo snap install snapd
sudo snap install plexmediaserverManage 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:
http://127.0.0.1:32400/webHeadless server (SSH tunnel)
From your workstation, tunnel Plex’s localhost port (Plex Support — SSH tunnel):
ssh -L 8888:127.0.0.1:32400 username@SERVER_IPThen browse:
http://127.0.0.1:8888/webLAN access from another device
On the same network, use the server’s IP:
http://192.168.1.50:32400/webFind the address with hostname -I or your router’s DHCP page.
Wizard steps
- Sign in with your Plex account (create one if needed).
- Name the server (for example
debian-plex). - Choose whether to enable remote access or stay LAN-only.
- Add libraries (Movies, TV Shows, Music, Photos) or skip and add later under Settings → Manage → Libraries.
- 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:
id plexuid=997(plex) gid=986(plex) groups=986(plex),44(video),992(render)ACL approach (keeps your user as owner)—see Linux ACL examples:
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/moviesThe uppercase X grants execute on directories without making ordinary media files executable.
Home-directory media also needs traverse permission on parents:
sudo setfacl -m u:plex:x /home /home/youruser
sudo setfacl -R -m u:plex:rX /home/youruser/mediaOwnership approach (dedicated Plex disk only):
Ownership changes in this section use chown command syntax.
sudo chown -R plex:plex /media/plex
sudo systemctl restart plexmediaserverInspect the full path when scans still find nothing:
namei -l /media/plex/moviesf: /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 moviesDrives 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:
sudo apt install -y ufw
sudo ufw allow OpenSSH
sudo ufw allow 32400/tcp
sudo ufw enable
sudo ufw statusTo Action From
-- ------ ----
OpenSSH ALLOW Anywhere
32400/tcp ALLOW AnywhereFor LAN-only access, narrow the rule:
sudo ufw delete allow 32400/tcp
sudo ufw allow from 192.168.1.0/24 to any port 32400 proto tcpRemote 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.
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):
sudo systemctl start plexmediaserver
sudo systemctl stop plexmediaserver
sudo systemctl restart plexmediaserver
sudo journalctl -u plexmediaserver -n 50 --no-pagerUpdate (with Plex repo configured):
sudo apt update
sudo apt install --only-upgrade plexmediaserver -y
dpkg-query -W -f='${Version}\n' plexmediaserver
systemctl is-active plexmediaserverRemove package, keep library data:
sudo apt remove plexmediaserverMetadata remains under /var/lib/plexmediaserver/.
Remove repository and keyring:
sudo rm -f /etc/apt/sources.list.d/plexmediaserver.sources \
/etc/apt/keyrings/plexmediaserver.v2.gpg
sudo apt updateFull removal (wipes metadata and settings):
sudo systemctl stop plexmediaserver
sudo apt purge -y plexmediaserver
sudo rm -rf /var/lib/plexmediaserverTroubleshooting
| 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
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.
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.
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.
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.
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.
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.
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.
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.
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.

