Raspberry Pi

Install Plex on Raspberry Pi 4

Plex is a media streaming service. Plex can stream movies, music, TV shows, LIVE TV channels, and so on from the Plex server. Plex can also stream local media files. Plex can organize video and audio files as well.

To set up Plex on your Raspberry Pi 4, you will have to install the Plex Media Server package on your Raspberry Pi 4 from the official Plex package repository.

In this article, I am going to show you how to add the official Plex package repository on your Raspberry Pi 4 running the Raspberry Pi OS and install Plex Media Server on your Raspberry Pi 4 from there. So, let’s get started.

Table of Contents

  1. Adding Plex GPG Key
  2. Adding Official Plex Package Repository
  3. Installing Plex on Raspberry Pi OS
  4. Initial Setup of Plex Media Server
  5. Adding a New Library
  6. Conclusion
  7. References

Adding Plex GPG Key

Before you add the Plex package repository on your Raspberry Pi 4, you have to download and add the GPG key of the Plex package repository on your Raspberry Pi 4.

To download and add the GPG key of the Plex package repository, run the following command:

$ curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

The GPG key of the Plex package repository should be downloaded and added to your Raspberry Pi 4.

Adding Official Plex Package Repository

In this section, I am going to show you how to add the official Plex package repository on your Raspberry Pi 4 running the Raspberry Pi OS.

Update the APT package repository cache as follows:

$ sudo apt update

To make sure that the APT program can download packages via the HTTPS protocol (required for Plex), install the apt-transport-https package as follows:

$ sudo apt install apt-transport-https -y

The apt-transport-https package should be downloaded and installed.

To add the official Plex package repository on your Raspberry Pi 4, run the following command:

$ echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

The official Plex package repository should be added to your Raspberry Pi 4.

For the changes to take effect, update the APT package repository cache again as follows:

$ sudo apt update

The APT package repository should be updated.

Installing Plex on Raspberry Pi OS

To install Plex Media Server from the official Plex package repository on your Raspberry Pi 4, run the following command:

$ sudo apt install plexmediaserver -y

The APT package manager should start downloading the plexmediaserver package from the official Plex package repository. It will take a while to complete.

Once the plexmediaserver package is downloaded, the APT package manager should start installing it on your Raspberry Pi 4.

You will be prompted to replace the official Plex package repository that you’ve just added to your Raspberry Pi 4 with the one that comes with the plexmediaserver package. Press <Enter> to keep the one you already have.

The installation should continue and plexmediaserver should be installed.

Initial Setup of Plex Media Server

In this section, I am going to show you how to access Plex Media Server and do the initial setup.

To access Plex Media Server, you need to know the IP address of your Raspberry Pi 4. You can run the following command to find the IP address of your Raspberry Pi 4:

$ hostname -I

In my case, the IP address of my Raspberry Pi 4 is 192.168.0.107. It will be different for you. So, make sure to replace it with yours from now on.

Plex Media Server will run on port 32400 of your Raspberry Pi 4. So, to access Plex Media Server, visit the URL http://192.168.0.107:32400/web from your favorite web browser.

You will be asked to log in to Plex. If you already have a Plex account, log in to your Plex account. Otherwise, create one from here.

NOTE: Make sure to replace the IP address 192.168.0.107 with yours.

Once you log in to your Plex account, it may take a while for Plex to show you the initial setup wizard. If it takes too long, press <F5> to refresh the page.

Once Plex shows you the initial setup wizard, click on GOT IT!.

Click on the X button as marked in the screenshot below.

Type in a name for your Plex Media Server and click on NEXT.

Click on NEXT.

Click on DONE.

You should see the home page of the Plex Media Server. If you’re new to Plex, the home page will be empty.

Adding a New Library

To add a new media library to your Plex Media Server, click on MORE as marked in the screenshot below.

Click on the + icon of your Plex Media Server (RASPBERRYPI in my case) as marked in the screenshot below.

The Add Library wizard should be displayed. Select your library type from the list1, type in a Name for your library2, select the Language from the dropdown menu3, and click on NEXT4.

Click on BROWSE FOR MEDIA FOLDER.

Select the directory that you want to add to this library. You can also type in the directory path directly if you want. Once you’re done, click on ADD.

In this case, I am going to add the /home/pi/Videos directory to the library.

Click on ADD LIBRARY.

All the media files that you have should be added to the library automatically as you can see in the screenshot below.

You can stream any media file from the library as you can see in the screenshot below.

Conclusion

In this article, I have shown you how to add the official Plex package repository on your Raspberry Pi 4 running the Raspberry Pi OS. I have also shown you how to install Plex Media Server on your Raspberry Pi 4 and access it from a web browser. I have shown you how to do the initial setup of the Plex Media Server and add a new library to your Plex Media Server as well.

References

[1] Enable repository updating for supported Linux server distributions | Plex Support

About the author

Shahriar Shovon

Freelancer & Linux System Administrator. Also loves Web API development with Node.js and JavaScript. I was born in Bangladesh. I am currently studying Electronics and Communication Engineering at Khulna University of Engineering & Technology (KUET), one of the demanding public engineering universities of Bangladesh.