Raspberry Pi Plex Media Player

In this tutorial, we will be showing you how to install the official Plex Media Player to the Raspberry Pi.

Raspberry Pi Plex Media Player

Using the Plex Media Player, you will be able to play media files delivered from your Plex Media Server.

One of the most significant advantages of Plex is that it can transcode video files to your devices. Transcoding allows even a device like the Raspberry Pi to play a vast range of video files.

While RasPlex is often the go-to method for getting a Plex client on the Raspberry Pi, it has no support for the Raspberry Pi 4.

There are advantages to making use of the Plex Media Player over the alternatives like RasPlex and PlexKodiConnect. These advantages include access to all of the latest Plex features as soon as they are implemented.

However, the downside is that the Media Player is a lot more resource-intensive, and you will need to compile it yourself.

Please note that before you start this tutorial, you need to use a Raspberry Pi 4 for optimal performance. If you are using an older Raspberry Pi, we recommend that you use either PlexKodiConnect or RasPlex.

Equipment List

Below is the list of equipment that you will need to get your Raspberry Pi powered Plex client up and running.


Raspberry Pi 4

Micro SD Card

Power Supply

Ethernet Cord or WiFi dongle (The Pi 3 and 4 has WiFi inbuilt)

HDMI Cable


Raspberry Pi Case

For this tutorial on setting up the Plex Media Player, we were using a Raspberry Pi 4 running the latest available version of Raspberry Pi OS Desktop (Buster).

Preparing to Compile the Plex Media Player, on the Raspberry Pi

In this section we will be preparing your Raspberry Pi to compile the Plex Media Player software.

Before you begin, you need to make sure you are running a version of the Raspberry Pi OS that features a desktop interface. We recommend that you use the version that does not come with the recommended packages.

1. Our first task is to make sure all of our packages are up to date.

We can achieve this by running the following two commands.

sudo apt update
sudo apt full-upgrade

2. Our next task is to ensure all the packages we need for the following sections exist on the operating system.

Run the following command to install all the required packages.

sudo apt install -y autoconf make automake build-essential gperf yasm gnutls-dev libv4l-dev checkinstall libtool libtool-bin libharfbuzz-dev libfreetype6-dev libfontconfig1-dev libx11-dev libcec-dev libxrandr-dev libvdpau-dev libva-dev mesa-common-dev libegl1-mesa-dev yasm libasound2-dev libpulse-dev libbluray-dev libdvdread-dev libcdio-paranoia-dev libsmbclient-dev libcdio-cdda-dev libjpeg-dev libluajit-5.1-dev libuchardet-dev zlib1g-dev libfribidi-dev git libgnutls28-dev libgl1-mesa-dev libgles2-mesa-dev libsdl2-dev cmake python3 python python-minimal git mpv libmpv-dev

There is quite a large number of packages to install, so this process may take some time.

Compiling MPV on the Raspberry Pi

One of the requirements to compile the Plex Media Player on your Raspberry Pi is to have the mpv libraries.

In this section, we will be walking you through the steps to get MPV compiled.

1. We first need to clone the MPV master branch to our Raspberry Pi by running the following command.

git clone https://github.com/mpv-player/mpv-build.git

2. Next, we need to change into the newly cloned directory. You can change in to this directory by using the command below.

cd mpv-build

3. Before we compile mpv, we will need to make some changes to its configuration options.

We can do this by adding two lines to the mpv_options file.

Run the following two commands to adjust the compilation options.

echo --enable-libmpv-shared > mpv_options
echo --disable-cplayer >> mpv_options
echo --extra-ldflags="-latomic" >> ffmpeg_options

The first command adds an option telling it to compile the shared MPV libraries.

The second command disables the command line interface for MPV as we don’t need that for the Plex Media Player.

4. The last thing we are required to do is to tell the build scripts to use the release versions of MPV and FFMPEG.

We can achieve this by running the following two commands.


5. Start the compilation process by using the following command within the terminal.

./rebuild -j$(nproc)

By using $(nproc) we are telling it to use as many jobs as we have processes. For the Raspberry Pi 4, this will be four active jobs.

Please note that this process can take considerable time to complete. It has to clone and compile both FFMPEG and MPV on your Pi.

6. Once the compilation process has completed, we can now install the libraries to our Raspberry Pi’s operating system.

To achieve this, we just need to run the command below.

sudo ./install

7. Finally, run the following command so that the operating system knows there are new libraries it needs to link to.

sudo ldconfig

Obtaining QT for the Raspberry Pi

In this section, we will be getting our last required component for the Plex client.

This component is the QT library. This library is used to drive the graphical interface of the Plex Media Player.

1. Luckily for us, we will not need to compile this package ourselves as someone has already done that for us.

Let us download the latest release from koendv’s qt5 GitHub repository by running the command below.

wget https://files.pimylifeup.com/plexmediaplayer/qt5-opengl-dev_5.12.5_armhf.deb

We have self-hosted this file on our CDN just in case the original repository ever becomes unavailable.

2. We can install the package that we just downloaded by running the following command.

As we no longer need the package after installing it, we will also be deleting it.

sudo apt-get install -y ./qt5-opengl-dev_5.12.5_armhf.deb
rm qt5-opengl-dev_5.12.5_armhf.deb

At this point, you should now have QT and mpv installed to your Raspberry Pi.

Compiling the Plex Media Player on a Raspberry Pi

With everything now set up, we can clone and compile the Plex Media Player to our Raspberry Pi.

1. Let us start by making sure we are currently in our home directory.

We can change to the home directory by running the command below.

cd ~

The tilde (~) is used as a reference to the home directory.

2. Now clone the Plex Media Player repository to your Raspberry Pi by using the command below.

git clone https://github.com/plexinc/plex-media-player

3. To compile the Plex client we need to make a build directory for it.

Create this directory and change into it by running the following two commands.

mkdir ~/plex-media-player/build
cd ~/plex-media-player/build

4. We can now use CMake to configure the source code for compilation.

cmake -DCMAKE_BUILD_TYPE=Debug -DQTROOT=/usr/lib/qt5.12/ -DCMAKE_INSTALL_PREFIX=/usr/local/ ..

CMake will auto-detect features that it can enable or disable for our Raspberry Pi.

5. Now let us compile the Plex Media Player by using the following command.

make -j$(nproc)

Please note that on older Raspberry Pi’s, this process may take some time. Using a Raspberry Pi 4, this process only took us about 5 minutes.

6. Our final task is to install the freshly compiled binaries to our operating system.

We can achieve that by making use of the following command.

sudo make install

Opening the Plex Media Player

To open the Plex Media Player on your Raspberry Pi, you will need to make use of the terminal.

1. Within a terminal session on your Rasberry Pi, run the following command to open the Plex Media Player.

plexmediaplayer --fullscreen --tv

This command will launch the software in full-screen mode on your device.

2. You should now be able to log in to your Plex account and gain access to your Plex library.

Raspberry Pi Plex Media Player Library

You should now have the Plex Media Player up and running on your Raspberry Pi.

Starting the Plex Media Player on Start Up

Now that you have the Plex Media Player installed on your Raspberry Pi, you will probably also want it to start at boot on your device.

1. Before we can get started, we need to create a directory to store our configuration file.

This directory may exist already, but it doesn’t hurt to run the following command anyway.

mkdir -p /home/pi/.config/autostart

2. To get the Plex Media Player to start at startup, we will need to create a special “.desktop” file within the folder we just created.

This file will be automatically interpreted when the operating system starts up the desktop interface.

Begin writing this file by running the following command on your Raspberry Pi.

nano /home/pi/.config/autostart/plexmediaplayer.desktop

3. Within this file, you will need to add the following lines.

[Desktop Entry]
Name=Plex Media Player
Exec=plexmediaplayer --fullscreen --tv

These lines are pretty straightforward and define the application we want auto-started. Using the “exec” option, we are telling it to run the Plex Media Player.

4. Once you have added these lines into this new file, you can save and quit by pressing CTRL + X, then Y, followed by the ENTER key.

5. Our next step is to ensure that your Raspberry Pi will boot directly to start up without requiring to be logged in.

To easily modify this setting, we can use the Raspberry Pi Configuration tool. This tool is installed by default on all versions of Raspberry Pi OS.

sudo raspi-config

You can navigate this menu using the ARROW keys. When you want to select an option, you can press the ENTER key.

6. Within the config tool, change to the “System Options” menu. At the time of writing, this is the first option.

Next, you will need to select the “Boot / Auto Login” menu.

Finally, select the “Desktop Autologin” option. This option will allow your Pi to boot directly to the desktop without requiring you to login.

7. At this point, your Pi should be set to run the Plex Media Player at startup.

You can verify that this is working at startup by restarting your Raspberry Pi.

sudo reboot


At this point, you should now have the Plex Media Player running on your Raspberry Pi.

The Plex Media Player is a reasonably resource-intensive player but is one of the best ways of viewing Plex content on your Pi.

As we compile the official source code, it means you will have access to the latest features as they are pushed to the official repository.

If you have any issues with getting this set up on your Pi, feel free to leave a comment below.

Also, be sure to check out some of our other Raspberry Pi media projects.


  1. Avatar for Joe
    Joe on

    I’ve been using Rasplex for years on 3 pi devices. Two have HifiBerry as well. Rasplex was the only option at the time that had gap less playback. It also worked very well. Unfortunately, it hasn’t been supported in years and the software march onward has taken it’s toll. I started getting errors that ‘server could not create playback queue’. A server and Plex upgrade resolved the issue for a couple of weeks but then it returned. I decided to see if there was a better option. I tried both Plex plugins on KODI. I could not get PlexBMC to work at all. The other plugin worked but you couldn’t cast to the player which is a deal breaker for me. I also tried the Plex embedded player. Could not get that to work at all either. So, luckily I found this page. It works great as a music player. It’s jerky for video. Not sure why. For anyone else trying this, make sure that you install Raspbian Buster. I initially downloaded the wrong one and had issues. Other than the video issue, I’m very pleased that I migrated to Raspbian with the Plex media player

  2. Avatar for Dercio
    Dercio on

    How to remove plex autostart on raspberry pi boot?

    1. Avatar for Emmet
      Emmet on

      Hi Dercio,

      You only need to delete the file that we created during the tutorial.

      rm /home/pi/.config/autostart/plexmediaplayer.desktop


  3. Avatar for Drummond
    Drummond on

    I followed these instructions a couple of months ago and it all appeared to work well.

    The one issue I haven’t been able to figure out yet is it plays HD content with fantastic quality but blue screens after 15mins. A reboot and it does another 15mins before blue screening again.

    I have wiped and reinstalled everything from scratch and it is still happening – next stop is to try a different SD card.

  4. Avatar for David
    David on

    Going to follow this guide in 2021, any big changes in the last 12 months that make this a bad idea? In addition how do people get remotes to work? does it just work with TV remote via HDMI?

    1. Avatar for Emmet
      Emmet on

      Hi David,

      I tested this tutorial relatively recently and it all still appears to be working. Of course it still isn’t the best experience if you throw very high definition files at it.

      I however, have never tested this with a remote using HDMI-CEC. Please let me know how you get on if you decide to give it a try.


  5. Avatar for JC Guevara
    JC Guevara on

    did do Gene Latham’s script in auto start, @ reboot is askimg me for a passwor, do enter default password (because i did not change the stock password) and is stuck there, any sugestions

    1. Avatar for Emmet
      Emmet on

      Hi JC,

      I updated the tutorial with new steps for getting Plex Media Player to start at boot, please give them a try.


  6. Avatar for Drummond
    Drummond on

    I installed Plex on a Raspberry Pi 4 using the above process and it all worked fine – however, the image quality isn’t great for 1080p videos. I get horizontal misalignment and some pixellation in the image especially during fast moving sequences. I also have Plex installed on some laptops and a couple of Smart TVs and I don’t have any problems playing the same files on them. I have also tried the Pi on both an HD PC screen (via HDMI) and on a project (via HDMI) and I have the same problems.
    I have increased the graphics memory to 132Mb and I have pushed the clock rate of the processor and the GPU, but none of these have made any difference.
    Has anyone had the same issues? Can anyone suggest a solution?

  7. Avatar for Bill G
    Bill G on

    I got an error building ffmpeg. Looking up the error (undefined reference to `__atomic_store_8′)

    I added the following option to ffmpeg_options:

    echo --extra-ldflags="-latomic" >> ffmpeg_options

    I hope this helps the next person with this error.

    1. Avatar for Scepi
      Scepi on

      Hi, it really helped, though I had to remove the “”s, like this:

      echo --extra-ldflags=-latomic >> ffmpeg_options
    2. Avatar for Giles
      Giles on

      Thanks! Got that one too. Note for anyone else needing to run this — the commenting system converted the double-quotes into smart quotes, so you’ll need to replace them with normal ones — or indeed, like Scepi did, just miss them out, because they’re not strictly necessary.

  8. Avatar for Mathias
    Mathias on

    Hi Emmet,

    I don’t leave feedback often, but in this case, well thanks a lot for this crystal clear guide!! It works like a charm!


  9. Avatar for andrew
    andrew on

    This was really helpful! Thank you!!

  10. Avatar for William Brown
    William Brown on

    First I want to say WOW & Thank You! This article is wonderful/worked perfectly for me the first try!

    By chance is there a way to have that command run on startup? I have tried a couple of ways with no luck.

    1. Avatar for William Brown
      William Brown on

      By “that command” I mean plexmediaplayer –fullscreen –tv

    2. Avatar for Emmet
      Emmet on

      Hi William,

      Sadly at this stage I haven’t had much luck with getting it to start at boot.

      If I work out a solution in the mean time I will be sure to reply to this comment with it.


    3. Avatar for Gene Latham
      Gene Latham on

      If you create the file /home/pi/.config/lxsession/LXDE-pi/autostart you can have PMP start at log in, if the pi user is set for auto login. You have to start everything you want, no just PMP. Here’s mine:

      @lxpanel --profile LXDE-pi
      @pcmanfm --desktop --profile LXDE-pi
      @xscreensaver -no -splash
      plexmediaplayer --fullscreen --tv

      The ‘@‘ says to retry things if they fail. lxpanel puts the menu panel on the bottom of the screen, pcmanfm starts the file manager, xscreensaver starts the screen saver, and the plexmediaplayer line starts PMP.

    4. Avatar for Giles
      Giles on

      +1 to Gene Latham’s suggestion, but just a note — the double-dashes in that command line, before all of the options, have been replaced with m-dashes — so you’ll need to fix that if you want to use the same config.

  11. Avatar for Kerry6a
    Kerry6a on

    How can I remove this if completed successfully ?

    1. Avatar for Emmet
      Emmet on

      Hi Kerry,

      As this wasn’t installed as a typical package it does require extra steps to remove.

      I haven’t tried this myself so take the following steps with care. These steps are basically just uninstalling all the files that the final install command does.

      Remove the desktop desktop config file

      sudo rm /usr/local/share/applications/plexmediaplayer.desktop

      Remove its icon

      sudo rm /usr/local/share/icons/hicolor/scalable/apps/plexmediaplayer.svg

      Delete the qt web engine reosurces

      sudo rm /usr/local/resources/qtwebengine_devtools_resources.pak

      Finally remove the plex media player client resource folders

      sudo rm -r -f /usr/local/share/plexmediaplayer/

      Remove the plex media player binary

      sudo rm /usr/local/bin/plexmediaplayer

      Remove the plex media helper

      sudo rm /usr/local/bin/pmphelper

      There is also the additional packages installed that we need to remove, including mpv and qt5 but the above steps will remove the plex media player itself.

      Honestly, if you wanted to strip it back any further it would probably be easier to just start a fresh copy of Raspberry Pi OS.


  12. Avatar for Paul
    Paul on

    Aloha Emmet,
    Before I start this project will it run ok on the Pi 4B 4 GB or is the 8GB recommended.

    1. Avatar for Emmet
      Emmet on

      Hi Paul,

      It should be fine to run this on a 4GB Raspberry Pi 4. You are more likely to run in to issues with the processor of the Raspberry Pi then you are with the RAM.

      From my experience the Plex Media Player eats up more CPU time then it does RAM.


  13. Avatar for Michael Koch
    Michael Koch on

    thanks for a great guide, it works fine on my rpi 4 8gb.
    Regards Michael

  14. Avatar for aniel arias
    aniel arias on

    i am getting at the very end after running “plexmediaplayer –fullscreen –tv

    error: “Could not initialize egl display

    1. Avatar for Emmet
      Emmet on

      Hi Aniel Arias,

      Make sure that you run that command on your Raspberry Pi itself and not over SSH.

      From memory that error is caused when using it over SSH as techically there is no display attached to the SSH session.


    2. Avatar for aniel arias
      aniel arias on

      i just realized i used the lite version and not the desktop, my bad

  15. Avatar for Girishprasanna
    Girishprasanna on

    would this work on Rpi 2B?

    1. Avatar for Emmet
      Emmet on


      You would be better off using RasPlex on that device. Using the official Plex Media Player will likely run you in to performance problems with the older Raspberry Pi’s.


  16. Avatar for Anthony
    Anthony on

    after i run ./rebuild -j$(nproc) and i try to install it says “The project was not configured: run “waf configure” first!” did i do somthing wrong or am i missing a step

    1. Avatar for Emmet
      Emmet on

      Hi Anthony,

      It looks like there is some compilation errors occuring. I’ve made some adjustments to the tutorial to hopefully solve these.

      Please try running Step 2 under the “Preparing to Compile the Plex Media Player, on the Raspberry Pi” section again.

      Then try recompiling MPV again.

      Hopefully the issue should be solved now.


    2. Avatar for Scott
      Scott on

      I am getting the same exact error. After running ./rebuild -j$(nproc) in step 4 of the “Compiling MPV on the Raspberry Pi” the next step 5 “sudo ./install” command gives the error “The project was not configured: run “waf configure”. I bet this is were the poster above is getting this error as well. Can’t comment on the next section about “Compiling the Plex Media Player on a Raspberry Pi” as I’m stuck in the first section.

    3. Avatar for Emmet
      Emmet on

      Hi Scott,

      Ok I’ve done a bit more problem solving.

      Try running the following two commands within the mpv-build directory.


      Followed by the rebuild and install commands.

      I’ve updated the tutorial to use these additional steps as well.


    4. Avatar for John Marriott
      John Marriott on

      I am also having this issue, it used to work fine but now I just can’t install it on a new pi4…. Any ideas?

      Waf configure

    5. Avatar for Drummond
      Drummond on

      Hi, I had the same problem and then discovered that if you use the Raspbian OS Installer you get this problem, but if you follow the link at the top of this page to the Raspbian Buster download, download the image without recommended apps and write it to an SD card using Etcher, then the above problem doesn’t happen and it compiles ok.

  17. Avatar for Scott
    Scott on

    The whole thing worked beautifully until I got to the ./make -j$(nproc) command near the bottom. That hits me with “No such file or directory.” I have triple checked my work. just wondering what I screwed up?

    1. Avatar for Emmet
      Emmet on

      Hi Scott,

      Try running the command without ./ at the start of it.


Leave a Reply

Your email address will not be published. Required fields are marked *