Install Plex On Raspberry Pi 4 Using Portainer Docker – Episode 23

30, May 2021 | Raspberry Pi 4 Series

Recommended Hardware & Tools

Check out my official Amazon Storefront to browse the exact parts, tools, and gear I use in my tutorials and videos.

As an Amazon Associate I earn from qualifying purchases.

Introduction:

Today we are going to install Plex on Raspberry Pi 4 using Portainer/Docker. This is episode 23 in our Raspberry Pi 4 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.

YouTube Video

Prerequisites:

Recommended USB Hard Drives For Plex On A Raspberry Pi:

WD 4 TB My Passport Portable External Hard Drive Recommended

WD 4 TB My Passport Portable External Hard Drive

Buy from Amazon USA
Buy from Amazon UK
WD 1 TB My Passport Portable External Hard Drive Alternative

WD 1 TB My Passport Portable External Hard Drive

Buy from Amazon USA
Buy from Amazon UK

What is Plex?.

Plex is a *free media server application that can be used to centralise and organise 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 USERNAME@YOURRASPBERRYPIIP

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.

Support My Work!

Buy Me A Coffee

Click The Image To Go To Site

Buy Me A Coffee

I Am An Affiliate!

Just so you know, we may collect a share of sales or other compensation from the links on this page. As an Amazon Associate, I earn from qualifying purchases.

The affiliate link recommendations come at no extra cost to you.

We hope you love the products we recommend!

Thank you if you use our links; we really appreciate the support!

5 Comments

  1. bckelley

    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

    Reply
  2. James

    All I see in the container logs for plex is:

    sleep: cannot read realtime clock: Operation not permitted

    Reply
  3. Joey

    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.

    Reply
    • Shawn

      Thank you Joey. This fixed the issue for me.

      Reply
  4. Francis Jurdan

    hum, i already have any erro arm7…. when i try to deploy

    Reply

Submit a Comment

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

Support My Work!

Buy Me A Coffee

Click The Image To Go To Site

Buy Me A Coffee

I Am An Affiliate!

Just so you know, we may collect a share of sales or other compensation from the links on this page. As an Amazon Associate, I earn from qualifying purchases.

The affiliate link recommendations come at no extra cost to you.

We hope you love the products we recommend!

Thank you if you use our links; we really appreciate the support!