Today we are going to install Plex on Raspberry Pi 4 using Portainer/Docker. This is episode 23 in our Raspberry Pi series.
In today’s episode we will show you how to install Plex.
If you would like to learn more like how to add media folders, configure the settings, set up remote access, and share your media with family or friends you can learn this from watching episode 23 below.
Difficulty=Easy
Prerequisites:
Recommended USB Hard Drives For Plex On A Raspberry Pi:
WD 1TB My Passport Portable External Hard Drive | WD 4 TB My Passport Portable External Hard Drive |
USA Amazon Link: | USA Amazon Link: |
UK Amazon Link: | UK Amazon Link: |
What is Plex?.

Plex is a *free media server application that can be used to centralize and organize all your media content. It allows you to stream content to any device using their client apps.
Plex can also be configured to share your media with friends and family and to consume your media while you are outside of your server and on the go.
*Plex Pass upgrade available.
Install Plex on Raspberry Pi 4
Step 1 – Create the folders needed for the Plex Docker container.
Open up a terminal or Putty application.
Connect to your Raspberry Pi via SSH (secure shell).
ssh -p PORT [email protected]
Navigate to your “Appdata” folder or the place where you store all your containers persistent configuration data.
cd /srv/YOURUSBDISKUUID/Appdata
Create a folder called “plex“.
mkdir plex
Navigate into the “plex” folder.
cd plex
Create the “config” folder where all the Plex configuration data will reside.
mkdir config
Now navigate into the “config” folder.
cd config
From here you will need to get your “absolute path” for your “config” folder.
pwd
Copy the output of the pwd command and paste it into a text file. You will need this in Step 2.
You now need to locate your Media folders. Using the above steps. Navigate into each folder using the terminal one at a time. Movies, TV Series, Music, and Photos are supported.
Once you are in each folder, as we have done above. Use the “pwd” command to get the absolute path of each folder and copy and paste the output paths into the same text file as above so you can add them to your stack in Step 2.
Step 2 – Create the Docker Compose Stack
Navigate to your Portainer dashboard and log in.

From the left hand menu click on “Stacks“.

Now in the Stacks dashboard click on “Add a stack“.

In the “Name” field enter “plex“
Now Copy and paste the following docker-compose data into the “Web editor” field. Be sure to change all the file paths to the absolute paths you saved to a text file in step 1.
Plex Docker Compose Stack
--- version: "2.1" services: plex: image: ghcr.io/linuxserver/plex:arm32v7-latest container_name: plex network_mode: host environment: - PUID=1001 - PGID=100 - VERSION=docker - PLEX_CLAIM= #optional volumes: - /path/to/library:/config - /path/to/tvseries:/tv - /path/to/movies:/movies restart: unless-stopped
You will also need to change the “TZ“, “PUID” and “PGID” fields to match your setup. You can find these by using the “id” command and use the returned values.
id
You can also add additional folders that you would like to mount and use in Plex. By adding more paths.
Create A Plex Claim Token
Open up a browser and make sure you are logged into plex.tv with your Plex account.
Once logged in navigate to https://plex.tv/claim.

Copy the Claim Code and paste it into your Plex stack under the “PLEX_CLAIM=” field.
Note: you must deploy your stack within 4 minutes of creating this token as it will expire.

Once you have completed that you are ready to click “Deploy the stack“.

If you navigate to “Containers” in the left menu

You should now see your “plex” container in the list.

Give the container a few minutes to fully start up then you can connect to the Plex dashboard GUI.
http://YOURRASPBERRYPIIP:32400/web
You should now see the “Sign In” screen.
Because you used a claim code all you need to do is click the “Sign In” button to complete the account linking process.

You should now be redirected to your Plex setup wizard and you are ready to configure Plex.

If you would like to know how to configure Plex, add media, and set up remote access. Please follow our Youtube video for this episode.
We need your support.
We hope you enjoyed this episode and that it was helpful and you got benefit out of it.
If you did, please consider supporting our channel by Subscribing to our YouTube channel, and liking and sharing our content.
You can also make a donation via Paypal or become a Patreon if you wish to do so.
You can also follow us on Facebook or Twitter.
If you have any questions or any requests please ask in the comments below or on YouTube.
Set mine up the same way and I am unable to go to my server address and am not able to see the server on my account. after running netstat on my server 32400 doesn’t even show up. please help
All I see in the container logs for plex is:
sleep: cannot read realtime clock: Operation not permitted
I had to enable priv mode to get past error “sleep: cannot read realtime clock: Operation not permitted”. Duplicate the container, set Privileged mode under Runtime and Resources. Note the Logs image under Quick Links gains you access to the log with my error.
Thank you Joey. This fixed the issue for me.