Install Plex Media Server on a Raspberry Pi 5 or Pi 4: Step-by-Step Guide
Got a hard drive full of movies, TV shows and music and want to watch them on your TV, tablet or phone? If you are wondering how to create a media server with a Raspberry Pi, a Raspberry Pi Plex server is the most convenient route: Plex Media Server manages your files in one place, fetches artwork and descriptions from the internet and streams everything to the Plex apps on your home network. In this guide you prepare your media drive, install Plex from the official package or with Docker and set up your first library.
Two terms come up again and again. Direct play means Plex sends the file to your player unchanged, so the Pi has almost nothing to compute. Transcoding means Plex converts a video into another format while it plays, because the player cannot handle the original file. For a Pi, that is heavy work.
Free at home: Plex Media Server, the apps and streaming videos, music and photos on your home network cost nothing.
Not free on the go (as of October 2026): Since April 2025, watching videos away from home requires a Plex Pass, Plex’s paid subscription (held by the server owner, it then covers everyone), or a Remote Watch Pass, a subscription only for watching away from home. That also applies to workarounds such as a Cloudflare Tunnel and usually to a VPN back home. Music and photos are exempt. If you don’t want a subscription, use Jellyfin.
A Pi 5 or Pi 4 is enough as long as your devices play the files directly. Plex does not support hardware transcoding on any Raspberry Pi, not even with a Plex Pass.
Installation: the official Plex repository via APT (recommended) or Docker. If you installed Plex from an older guide, you have to switch the repository, otherwise Plex no longer gets updates.
Plex or Jellyfin?
The usual alternative to Plex is Jellyfin. On a Raspberry Pi, two differences matter most: what watching videos away from home costs and how good the apps are.
| Criterion | Plex | Jellyfin |
|---|---|---|
| Account required | yes, a free Plex account | no |
| Videos away from home | only with a Plex Pass or Remote Watch Pass | free, but you need your own way in from outside, such as a VPN |
| Transcoding on the Pi | software only | software only, Jellyfin has deprecated hardware support for the Pi |
| Apps | for almost every TV, streaming stick and phone, very polished | for many platforms, a little less choice and polish |
| Open source | no | yes |
| Best for | families and smart TV users who want convenience | anyone who wants to do without an account and a subscription |
If apps for TVs and streaming sticks matter to you and you mostly watch at home, Plex is the more convenient choice. If you want to watch on the go without an account or subscription, set up Jellyfin on the Raspberry Pi. For a side-by-side look at Plex, Jellyfin and Kodi, see our media center comparison.
What you need
- Raspberry Pi 5 (recommended) or Pi 4: Both handle direct play. The Pi 5 has more processing power to spare when Plex does have to transcode or scans new movies.
- Raspberry Pi OS, ideally the 64-bit version: Plex provides packages for 64-bit (arm64) and 32-bit (armhf), we recommend 64-bit. The Lite version without a desktop is enough, because you control Plex from a browser on another device.
- A microSD card or SSD for the system: for example a SanDisk High Endurance 32 GB*, which is designed for continuous use. It also holds the Plex database with artwork and preview images (
/var/lib/plexmediaserver), which grows with your library. The movies themselves don’t belong on the card.Links marked with * are affiliate links, which makes them advertising. If you buy through one, I earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases. Learn more - A hard drive for your media: for example the Seagate Portable 2 TB* (2.5-inch, powered over USB) or the Seagate Expansion Desktop 6 TB* (3.5-inch with its own power supply). Drives with their own power supply put no load on the Pi.
- Enough power for a 2.5-inch drive: The Pi 4 supplies 1.2 A to all USB devices combined, the Pi 5 1.6 A on the official 27 W power supply* but only 600 mA on a 3 A supply. If that isn’t enough, connect the drive to a powered USB hub such as the TP-Link UH700*. More on this in our power supply guide.
- An Ethernet cable such as the Amazon Basics Cat 6 cable (3 m)*: Wi-Fi works, but a cable is more stable, especially for 4K movies.
- SSH access to the Pi with the username you set in Raspberry Pi Imager (enable SSH on the Raspberry Pi), and the Pi’s IP address. Ideally give it a static IP address so the Plex address stays the same.
Prepare the media drive
Plex needs a fixed path to your movies when you create a library. So first mount the drive permanently at /media/extern. We recommend the Linux file system ext4, which makes the permissions below work as described. If your movies are already on an NTFS or exFAT drive from a Windows PC, you can keep it that way, the matching fstab line follows below. How to format an empty drive with ext4 is covered in our guide Raspberry Pi USB hard drive setup.
Create the folder where the drive will appear and list your drives:
sudo mkdir -p /media/extern
lsblk -o NAME,UUID,FSTYPE,SIZE,MOUNTPOINT
You can spot your drive by its size, its partition is usually called sda1. Copy its UUID, the unique identifier of the partition. Then open the file in which Linux records which drives to mount at boot with sudo nano /etc/fstab and add this line at the bottom (replace the UUID):
UUID=your-uuid /media/extern ext4 defaults,nofail 0 2
NTFS or exFAT drive: If lsblk shows ntfs or exfat in the FSTYPE column, use this line instead. On these file systems chown and chmod have no effect, so the options decide who owns the files (uid/gid: your user and group ID as shown by the id command, usually 1000) and that all users may read (umask=022). For exFAT, replace ntfs3 with exfat:
UUID=your-uuid /media/extern ntfs3 uid=1000,gid=1000,umask=022,nofail 0 0
The ntfs3 and exfat drivers are part of the Raspberry Pi OS kernel, and the options come from the kernel documentation. With these options, the chown command below and step 5 of option A are not needed, Plex can already read.
Save with Ctrl+O and Enter, exit nano with Ctrl+X. nofail makes sure the Pi still boots normally if the drive is ever disconnected. Reload the changed file, mount the drive and check the result:
sudo systemctl daemon-reload
sudo mount -a
findmnt /media/extern
The first command makes systemd pick up the changed fstab, otherwise mount prints a hint. If mount -a reports no error and findmnt shows a line with /media/extern, the entry is correct. So that you can copy files to the drive without sudo, hand it over to your user and create the folders for your media (for NTFS/exFAT, only the second line):
sudo chown -R $USER: /media/extern
mkdir -p /media/extern/Movies "/media/extern/TV Shows" /media/extern/Music
Keep movies, TV shows and music in separate folders, otherwise Plex mismatches content. How you name the files decides whether Plex finds titles and artwork. Plex recommends title and release year, each movie in its own folder, and season folders for TV shows:
/media/extern/Movies/Avatar (2009)/Avatar (2009).mkv
/media/extern/TV Shows/Band of Brothers (2001)/Season 01/Band of Brothers (2001) - s01e01 - Currahee.mkv
All rules and special cases are in the Plex help articles on movies and TV shows. The easiest way to copy movies from your PC is a network share, as described in Raspberry Pi NAS with Samba.
Used an older Plex guide? Switch the repository
If you are installing Plex for the first time, skip this section. If Plex already runs on your Pi via APT, first check which package source it comes from:
apt-cache policy plexmediaserver
If the output shows downloads.plex.tv/repo/deb, or sudo apt update reports an error for that address, you are on the old source. If it shows repo.plex.tv/deb, everything is fine and you can skip the rest of this section.
As of November 2026: with version 1.43.0, Plex moved to a new package source and a new signing key. The old source at downloads.plex.tv/repo/deb stopped getting new versions in September 2025, and Plex has since taken it offline. If you installed Plex from the old package source, your server is stuck on the old release and apt update shows an error. Remove the old source and the old key, add the new source and update:
sudo rm -fv /etc/apt/sources.list.d/plex*
sudo rm -fv /usr/share/keyrings/plex.gpg
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.v2.key | sudo gpg --yes --dearmor -o /etc/apt/keyrings/plexmediaserver.v2.gpg
echo "deb [signed-by=/etc/apt/keyrings/plexmediaserver.v2.gpg] https://repo.plex.tv/deb/ public main" | sudo tee /etc/apt/sources.list.d/plex.list
sudo apt update && sudo apt upgrade -y
Run the block once from top to bottom. The first line removes all Plex sources, including the plexmediaserver.list from the old guide. Don’t repeat it later, otherwise it also deletes the new plex.list. Your library and settings are kept during the update.
Which installation option?
You only need one of the two options. Choose option A if Plex is the first or only service on your Pi: Plex then runs as a system service and gets its updates with your regular system updates. Choose option B if your Pi already runs Docker or you want to move Plex, settings included, to another machine later.
Option A: Install Plex via APT (recommended)
With this option you install Plex from the official Plex repository, the package source from which APT gets programs and updates. Plex then runs as a system service and starts with the Pi.
Step 1: Update the system
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl gnupg
The second line installs the tools for the next step in case they are missing.
Step 2: Add the Plex repository
The first command downloads the key Plex uses to sign its packages. The second adds the package source:
curl -fsSL https://downloads.plex.tv/plex-keys/PlexSign.v2.key | sudo gpg --yes --dearmor -o /etc/apt/keyrings/plexmediaserver.v2.gpg
echo "deb [signed-by=/etc/apt/keyrings/plexmediaserver.v2.gpg] https://repo.plex.tv/deb/ public main" | sudo tee /etc/apt/sources.list.d/plex.list
Plex also offers a setup script that you run with curl … | sudo bash. We prefer to show the two commands separately, so you can see what runs with root privileges on your Pi.
Step 3: Install Plex Media Server
sudo apt update
sudo apt install -y plexmediaserver
The package creates its own system user plex, sets up the service and starts it.
Step 4: Check the service
sudo systemctl status plexmediaserver
The output should say active (running). Press q to leave the view. Plex is now listening on port 32400.
Step 5: Give Plex read access to your media
If your drive is an NTFS or exFAT drive, skip this step, the mount options already set the permissions there. Plex runs as the user plex, not as your user. It needs to open your folders and read the files:
sudo chmod -R a+rX /media/extern
a+rX allows all users to read and to open folders. The capital X only makes folders accessible, your video files do not become executable. The drive still belongs to you, so you can keep adding files as usual. Raspberry Pi OS creates new files readable for everyone by default. If a new movie still doesn’t show up, run the command again.
Plex is installed. Continue with the first-time setup in the browser.
Option B: Plex with Docker Compose
If you chose option A, skip this section. With this option, Plex lives with all its dependencies in its own container. You need Docker on the Raspberry Pi first.
Step 1: Find your user ID
The container should access the media drive with your permissions. For that you need your user and group ID:
id
The output starts with something like uid=1000(alex) gid=1000(alex). You enter these two numbers as PLEX_UID and PLEX_GID in a moment. For the first user created by Imager, it is usually 1000.
Step 2: Create the Compose file
mkdir -p ~/plex/{config,transcode}
nano ~/plex/docker-compose.yml
Paste in this content and keep nano open, you enter the claim token in step 3:
services:
plex:
image: plexinc/pms-docker:latest
container_name: plex
network_mode: host
restart: unless-stopped
environment:
- PLEX_CLAIM=claim-XXXXXXXXXXXXXXXXX # paste your claim token here
- PLEX_UID=1000 # value from "id"
- PLEX_GID=1000 # value from "id"
- TZ=Europe/London # your time zone
volumes:
- ./config:/config
- ./transcode:/transcode
- /media/extern:/data
network_mode: host puts the container directly on your home network. That way Plex reliably recognizes your devices as local, without it Plex may treat them as remote. Replace Europe/London with your own time zone, for example America/New_York. The last line makes your drive visible inside the container as /data. For Plex, your movie folder is therefore /data/Movies, not /media/extern/Movies. You will need that path when creating the library. The Docker image registers the ./transcode folder itself on first start as the folder for temporary transcoding files. Inside the container, it belongs to the user from PLEX_UID.
Step 3: Get a claim token and start Plex
The claim token links the new server to your Plex account. It is only valid for a few minutes, so get it right before you start: sign in at plex.tv/claim, copy the token and, in the nano window that is still open, replace claim-XXXXXXXXXXXXXXXXX with your token. Save with Ctrl+O and Enter, exit nano with Ctrl+X and start the container right away:
cd ~/plex
docker compose up -d
docker compose logs -f
Press Ctrl+C to leave the logs, the container keeps running. After a short while, Plex is reachable in the browser.
First-time setup in the browser
On a PC or laptop on the same home network, open this address and replace the placeholder with your Pi’s IP address. If the page doesn’t load or offers no server to set up, see The browser can’t find a server.
http://<Pi-IP>:32400/web
- Sign in with your Plex account or create a free one. With option B, the claim token has already linked the server to your account, so you just sign in.
- Give the server a name, which is how it will appear in the apps.
- Add a library and choose its type, for example Movies, TV Shows or Music.
- Select the matching folder:
/media/extern/Moviesfor option A,/data/Moviesfor option B. Create a separate library with its own folder for TV shows and music.
Plex then scans the folders and downloads artwork, descriptions and ratings. With a large collection this takes a while. After that, the server shows up in the Plex app on your TV, streaming stick and phone as soon as you sign in there with the same account.
The free account covers everything on your home network. Downloads in the app require a Plex Pass, and what applies to videos away from home is covered in Using Plex away from home.
Smooth playback: direct play instead of transcoding
Whether Plex stutters on a Pi almost always comes down to whether it has to transcode. For hardware transcoding, Plex lists only Intel, NVIDIA and AMD graphics, and the Raspberry Pi is not among them. On every Pi, Plex therefore transcodes on the CPU, with or without a Plex Pass.
How expensive that is can be derived from the Raspberry Pi documentation. The Pi 5 has no video encoder and decodes every format except HEVC in software. Decoding a 1080p H.264 video at 60 frames per second alone takes about half of its CPU according to the documentation. Transcoding adds the re-encoding on top. Several transcodes at once or transcoding 4K videos is therefore not realistic on a Pi. With direct play, Plex delivers the file unchanged, which even a Pi 4 handles.
How to see whether Plex is transcoding: Start a video and open the settings in the Plex web interface. On the left, below your server name, the Status area contains the Dashboard. At the top, under “Now Playing”, it lists every running playback; expanded, it shows details such as codec and resolution and whether the stream is being transcoded. According to Plex, this view is available without a Plex Pass. In addition, the Activity icon in the top bar turns orange while Plex is playing or transcoding. Details are in the Plex help article on the Dashboard.
How to stay on direct play:
- Choose formats your devices support: Most TVs and streaming sticks play videos in H.264 or HEVC with AAC or AC3 audio directly. Which formats your device supports is listed in its specifications.
- Set original quality: In the Plex apps, set the video quality to “Original” or the highest level. If a lower quality is selected, Plex transcodes down even if the device could play the file directly. Where the setting lives differs from app to app.
Optional: put the transcode folder on an SSD
If Plex does have to transcode, it writes temporary files to a transcode folder. According to Plex, it needs roughly as much free space as the source file plus 100 MB, and the Docker image’s documentation expects tens of gigabytes. On a Pi 5, an empty folder on an NVMe SSD on the PCIe connector is a good place for it, see NVMe SSD on the Raspberry Pi 5. For option A, create the folder and hand it over to the user plex (replace /mnt/nvme with your SSD’s mount point):
sudo mkdir -p /mnt/nvme/plex-transcode
sudo chown plex:plex /mnt/nvme/plex-transcode
You set the folder in the Plex web interface under Settings → Server → Transcoder. Turn on the advanced settings at the top right (“Show Advanced”) and the field “Transcoder temporary directory” appears. Plex advises against a network drive, a folder inside your libraries or a folder that already contains data. For option B, change the left part of the line ./transcode:/transcode in the Compose file instead, for example to /mnt/nvme/plex-transcode:/transcode, and restart the container with docker compose up -d.
Using Plex away from home
Since 29 April 2025, playing your own videos outside your home network is no longer free. You need one of these two options (as of October 2026):
- A Plex Pass held by the server owner: Everyone you share the server with can then watch remotely.
- A Plex Pass or Remote Watch Pass held by the individual user: This only covers that user’s own account.
Music in the Plexamp app and photos remain free to access remotely. Plex lists current prices at plex.tv/plans.
With a pass, set it up like this: in the Plex web interface, open the settings, go to Remote Access under your server and enable it. For Plex to be reachable directly, forward port 32400 (TCP) on your router to the Pi’s IP address. Without port forwarding, Plex falls back to a relay, a detour through Plex’s own servers. The relay is limited to 2 Mbps, even with a pass, which is only enough for low-quality video.
A Cloudflare Tunnel doesn’t help with Plex. It only saves you the port forwarding, not the pass, and Cloudflare’s terms do not provide for serving video through its network. A VPN back home usually doesn’t lift the pass requirement either, because Plex counts everything outside your own subnet as remote. A VPN connection typically gets its own subnet.
If you want to watch on the go without a subscription, Jellyfin with your own WireGuard VPN is the free route.
Keeping Plex up to date
With option A, new Plex versions arrive with your regular system updates. This only works with the new Plex package source. If you installed Plex from an older guide, switch the repository first.
sudo apt update && sudo apt upgrade -y
With option B, pull the new image and restart the container with it:
cd ~/plex
docker compose pull && docker compose up -d
Troubleshooting
Plex doesn’t start or port 32400 doesn’t respond
For option A, check the service, its logs and whether Plex is listening on port 32400:
sudo systemctl status plexmediaserver
sudo journalctl -u plexmediaserver -f
sudo ss -tlnp | grep 32400
For option B, docker compose logs in the ~/plex folder shows why the container doesn’t start.
The browser can’t find a server to set up
Setup via the IP address only works if your PC and the Pi are on the same network. If your PC is on a different network, such as the guest Wi-Fi, switch networks. If that isn’t possible, open an SSH tunnel from your PC to the Pi (replace username and IP):
ssh -L 8888:localhost:32400 <your-username>@<Pi-IP>
While this connection is open, you can reach Plex in your PC’s browser at http://localhost:8888/web. You only need the tunnel for the first-time setup.
The library stays empty
With option A, the user plex usually lacks read permissions. If the drive is formatted with NTFS or exFAT, check the options uid, gid and umask=022 in the fstab line from “Prepare the media drive”. For ext4, run sudo chmod -R a+rX /media/extern from option A, step 5 again and rescan the library in Plex. Don’t change the ownership to plex with chown, otherwise you can no longer write to the drive yourself without sudo. With option B, check that you selected the /data/… path in Plex and that PLEX_UID and PLEX_GID match the output of id.
The drive is missing after a reboot
Check the line in /etc/fstab: are the UUID and file system correct? sudo mount -a shows a typo straight away. If a 2.5-inch drive is connected directly to the Pi, insufficient power can also be the cause, see What you need.
Videos stutter or buffer
Check the Dashboard during playback, as described in direct play instead of transcoding. If Plex is transcoding, the Pi is usually the bottleneck: set original quality in the app or store the file in a format your device plays directly. If Plex is direct playing and it still stutters, the network is the more likely cause. Connect the Pi and the player by Ethernet cable if you can. Away from home without port forwarding, the relay limits you to 2 Mbps.
Plex no longer gets updates
With option A, the old package source is almost always the cause, and sudo apt update usually reports an error for downloads.plex.tv/repo/deb. How to check and fix it is described in Switch the repository.
Conclusion and next steps
On your home network, Plex on a Pi 5 or Pi 4 is a free media server with excellent apps. It runs smoothly when your devices play the files directly, and it stays current only with the new Plex repository. For videos on the go, budget for a Plex Pass or use Jellyfin. Here is where to go next:
- Raspberry Pi NAS with Samba: copy movies from your PC to the media drive with ease
- Jellyfin on the Raspberry Pi: the open-source alternative without an account or subscription
- Music server with Navidrome: if you only want to stream music
- Media centers compared: Jellyfin, Plex and Kodi on the Raspberry Pi
Enjoy your media server! Questions or problems? Let us know in the comments.
Frequently asked questions about Plex on the Raspberry Pi
Not for your home network: the server, the apps and local streaming of videos, music and photos are free. Since April 2025, watching videos away from home requires a Plex Pass or a Remote Watch Pass. A Plex Pass does not add hardware transcoding on the Raspberry Pi, because Plex only supports Intel, NVIDIA and AMD graphics for it.
The Raspberry Pi 5 is the recommendation, a Pi 4 is enough for direct play. Both transcode in software only. What matters most is therefore not the model but whether your players can play the files directly.
Yes. The official Plex repository has packages for arm64 and armhf, and the Docker image is also available for both. We recommend the 64-bit version of Raspberry Pi OS.
With direct play, yes, as long as your TV or streaming stick can play the file’s format directly. Transcoding 4K is not practical: the Pi only transcodes in software, and according to the Raspberry Pi documentation, decoding 1080p H.264 video at 60 fps alone takes about half of the Pi 5’s CPU.
Yes. Plex uses port 32400, Jellyfin port 8096, and both can read the same media drive. Both services need memory and scan new files. We would use a Pi 5 with at least 4 GB for this.
Not for your home network. For videos away from home you need a Plex Pass or Remote Watch Pass and Remote Access enabled, plus port forwarding for TCP 32400. Without port forwarding, the connection runs through a relay limited to 2 Mbps.
With version 1.43.0, Plex moved to a new package source and a new signing key. Plex has since taken the old source at downloads.plex.tv/repo/deb offline, so apt update reports an error for it. Remove the old source, add the new one at repo.plex.tv and run apt upgrade, as described in the section on switching the repository.
