1. Prerequisites
- Raspberry Pi 4 or 5 (Raspberry Pi OS 64-bit recommended for Plex).
- Basic knowledge of the terminal.
- Optional: External storage for media files.
2. Install Docker
2.1. Add Docker's official GPG key
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
2.2 Add the repository to apt sources
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
2.3 Fetches the latest package information
sudo apt-get update
2.4 Install the docker packages
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
3. Install Plex
3.1. Clone plex Docker repo
git clone https://github.com/plexinc/pms-docker
3.2. Change directory
cd pms-docker
3.3. Build Plex Docker image for Raspberry Pi
sudo docker build -t plexinc/pms-docker:latest -f Dockerfile .
here is the output of build command:
[+] Building 47.3s (11/11) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.74kB 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:20.04 4.2s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 191B 0.0s
=> [1/6] FROM docker.io/library/ubuntu:20.04@sha256:fa17826afb526a9fc7250e0fbcbfd18d03fe7a54849472f86879d8bf562c629e 0.1s
=> => resolve docker.io/library/ubuntu:20.04@sha256:fa17826afb526a9fc7250e0fbcbfd18d03fe7a54849472f86879d8bf562c629e 0.0s
=> => sha256:fa17826afb526a9fc7250e0fbcbfd18d03fe7a54849472f86879d8bf562c629e 1.34kB / 1.34kB 0.0s
=> => sha256:420b6f4cc783dc199667eae3316d9e066bd6e19931448c1e4b6f9a3759e52106 424B / 424B 0.0s
=> => sha256:2788af2ba581a02af2023a67e83596fcf92f74591bdea327f03cc3fd9ca25fe7 2.31kB / 2.31kB 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 12.11kB 0.0s
=> [2/6] RUN useradd -U -d /config -s /bin/false plex && usermod -G users plex && mkdir -p /config /transcode /d 0.5s
=> [3/6] RUN apt-get update && apt-get install -y tzdata curl xmlstarlet uuid-runtime unrar && apt- 36.8s
=> [4/6] RUN if [ "linux/arm64" = 'linux/arm/v7' ]; then S6_OVERLAY_ARCH='armhf'; elif [ "arm64" = 'amd64' ]; then S6_OV 3.5s
=> [5/6] COPY root/ / 0.0s
=> [6/6] RUN /installBinary.sh 0.3s
=> exporting to image 1.6s
=> => exporting layers 1.6s
=> => writing image sha256:a2d5487473d878add0df0c191ec49b12daf5ecba44bec54a6536eb646367ad31 0.0s
=> => naming to docker.io/plexinc/pms-docker:latest
3.4. Create directories for Plex data
Create folders to store the Plex configuration and media files.
mkdir -p ~/plex/config
mkdir -p ~/plex/transcode
mkdir -p ~/plex/media
Replace ~/plex/media
with the path to your external media storage if applicable.
3.5. Get Plex claim token
- Visit https://plex.tv/claim.
- Log in and copy the token.
- Use it for the PLEX_CLAIM option in next step.
Note - This token is only valid for 4 minutes.
3.6. Run Plex media server in Docker
Use the following command to start Plex:
docker run \
-d \
--name plex \
--network=host \
-e TZ="YOUR_TIMEZONE" \
-e PLEX_CLAIM="YOUR_PLEX_CLAIM_TOKEN" \
-v ~/plex/config:/config \
-v ~/plex/transcode:/transcode \
-v ~/plex/media:/data \
plexinc/pms-docker:latest
3.7. Docker compose stack
Here is the Docker compose file if you want to use the Docker compose
version: '3.5'
services:
plex:
image: plexinc/pms-docker:latest
container_name: plex
network_mode: 'host'
volumes:
- ~/plex/config:/config
- ~/plex/transcode:/transcode
- ~/plex/media:/data
ports:
- 8096:8096
restart: 'unless-stopped'
environment:
- TZ="YOUR_TIMEZONE"
- PLEX_CLAIM="YOUR_PLEX_CLAIM_TOKEN"
3.8. Access Plex
- Open a browser and visit:
http://YOUR_RASPBERRY_PI_IP:32400/web
- Sign in with your Plex account and follow the setup process.
Now you have Plex Media Server running on your Raspberry Pi through Docker! You can add media libraries, tweak settings, and stream your content.