In this tutorial, we will be showing you how to install the official Plex Media Player to the Raspberry Pi.
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.
Below is the list of equipment that you will need to get your Raspberry Pi powered Plex client up and running.
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
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.
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
Run the following two commands to adjust the compilation options.
echo --enable-libmpv-shared > mpv_options echo --disable-cplayer >> mpv_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.
$(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.
7. Finally, run the following command so that the operating system knows there are new libraries it needs to link to.
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.
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.
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.
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.
You should now have the Plex Media Player up and running on your Raspberry Pi.
If you have run into any issues with getting this set up on your Pi, feel free to leave a comment below.