Giter VIP home page Giter VIP logo

plex-server-docker-rpi's Introduction

Docker images: https://hub.docker.com/r/greensheep/plex-server-docker-rpi/tags

Plex Server for Raspberry Pi

A simple way to run a plex media server in Docker on the Raspberry Pi.

NOTE: The Pi 1 is NOT supported.

Usage

Install docker on your raspberry pi. There are numerous ways to do this but the easiest is to run:

curl -sSL https://get.docker.com | sh

Source: https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi

Next, you'll need to create three local folders for the plex config, data and transcode volumes (I have all of these on an external HDD because they get very large). For example:

mkdir -p ~/media/plex/{config,data,transcode}

Using the above folders, run the following to start plex:

docker run \
  -d \
  --name plex \
  --net host \
  --restart always \
  --volume $(echo $HOME)/media/plex/config:/config \
  --volume $(echo $HOME)/media/plex/data:/data \
  --volume $(echo $HOME)/media/plex/transcode:/transcode \
  greensheep/plex-server-docker-rpi:latest

After around 30 seconds, the Plex web admin should be available at http://{ip address of Pi}:32400/web.

NFS Shares

If you have permission issues using NFS shares as the mounted volumes, set the SET_PLEX_UID and SET_PLEX_GID environment variables to the user/group id of the owner of those directories.

To find the uid/gid:

# show user/group owner of a directory
ls -n ~/media/plex/config

# outputs something like this:
# drwxr-xr-x 20 1001  1001  4096 Apr  9 19:00 config
#               ^ uid ^ gid

Updated docker run:

docker run \
  -d \
  --name plex \
  --net host \
  --restart always \
  -e SET_PLEX_UID=1001 \
  -e SET_PLEX_GID=1001 \
  --volume $(echo $HOME)/media/plex/config:/config \
  --volume $(echo $HOME)/media/plex/data:/data \
  --volume $(echo $HOME)/media/plex/transcode:/transcode \
  greensheep/plex-server-docker-rpi:latest

Updating

Plex cannot be updated via the web ui. Run the following to download and run a new version:

docker pull greensheep/plex-server-docker-rpi:latest
docker stop plex
docker rm -f plex
# `docker run ...` command from above!

Transcoding

The Pi isn't powerful enough for transcoding but if you have media that will direct play on your client it works great! I've tested this on the Pi 2 (Hypriot) and 3 (Arch) and 4 (ubuntu).

Be sure to set the "Transcoder temporary directory" setting to /transcode in the Plex -> Transcoder settings UI.

Development

To build the images yourself clone this repository and run the following:

sudo docker buildx build -t plex-dev:latest --platform linux/arm,linux/arm64 .

plex-server-docker-rpi's People

Contributors

greensheep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plex-server-docker-rpi's Issues

Can't access any files or Media, everything appears to be blank in Plex

I followed the instructions as specified, and I got this issue. When attempting to add Media to Plex it can't see anything. If I go to /mnt it appears to be empty. I just tried the below command and now I can see "WD_Black" the name of my drive but it's empty. Any suggestions?

sudo docker run -d --name plex --net host -p 32400:32400 --restart always --volume /mnt/usb/WD_Black/Media/Plex/config:/config --volume /mnt/usb/WD_Black/Media/Plex/data:/data --mount source=WD_Black,destination=/WD_Black greensheep/plex-server-docker-rpi:latest

Update to latest version of Plex

The current image runs 0.9.12.19.

I did a re-build and everything seems to work fine with 0.9.14.6. (Plex server version history: https://plex.tv/downloads/1/archive)
Could you do a re-build and push to Docker Hub?

Also, it doesn't seem to detect when the version gets out of date which is weird? Likely to do with the version in the apt-get repo rather than the Docker image.

mapped but it still doesnt shows the content

Hello ,

I have created symlink of Movies folder in my external drive to ~/plex/data,and restarted docker restart lex sambaserver but the content of Movies folder is still not showing up.

Unable to build the image

I just git cloned the repo and tried this:

$ docker build .
Sending build context to Docker daemon   89.6kB
Step 1/17 : FROM balenalib/armv7hf-debian:stretch AS src
 ---> d6509515d4cb
Step 2/17 : ENV DEBIAN_FRONTEND="noninteractive"   PLEX_PATH=/opt/plex/Application
 ---> Using cache
 ---> 5f1b7194f04e
Step 3/17 : COPY VERSION .
 ---> c891dce97920
Step 4/17 : RUN apt update   && apt install -y wget ca-certificates locales
 ---> Running in ad56133840a9
standard_init_linux.go:211: exec user process caused "exec format error"
The command '/bin/sh -c apt update   && apt install -y wget ca-certificates locales' returned a non-zero code: 1

I've tried this on a Raspberry Pi 3 running Arch Linux ARM.

Output of docker info:

$ docker info
Client:
 Debug Mode: false

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 5
 Server Version: 19.03.1-ce
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: a4bc1d432a2c33aa2eed37f338dceabb93641310.m
 runc version: 425e105d5a03fabd737a126ad93d62a9eeede87f
 init version: fec3683
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.2.10-1-ARCH
 Operating System: Arch Linux ARM
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 901.9MiB
 Name: alarm
 ID: 42ZQ:PEI3:ZSDA:K6JU:SSSB:IYZR:ASRC:PEX4:DTEU:R6AN:S6OL:TZNG
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Thanks.

1.23 images clock_gettime(CLOCK_MONOTONIC) failed

Hya!

Raspberry Model Raspberry Pi 3 Model B Rev 1.2

Running Raspbian Linux OS

PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Docker version 20.10.7, build f0df350.

Since the last 2 versions of the image (1.23) I've been having issues with starting the container:

=> Plex user id: 1000
=> Plex group id: 1000
=> Starting plex... to load the UI go to: http://{ip address of Pi}:32400/web

libc++abi: terminating with uncaught exception of type std::__2::system_error: clock_gettime(CLOCK_MONOTONIC) failed: Operation not permitted
libc++abi: terminating with uncaught exception of type std::__2::system_error: clock_gettime(CLOCK_MONOTONIC) failed: Operation not permitted
****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /config/Library/Application Support/Plex Media Server/Crash Reports/1.23.2.4656-85f0adf5b/PLEX MEDIA SERVER/44e13a30-7f6e-4556-389428aa-ba9ea36c.dmp
Aborted

This seems to be related to an issue with the/an Alpine image base being used, more specifically thelibseccomp2 component in that image.

The userid of the user plex inside the container is the same as the user pi on my Pi, and that user has rwx access. on the config directory inside the container

id
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),101(input),108(netdev),995(docker),997(gpio),998(i2c),999(spi)

and

root@pi-media-server:/config# id plex
uid=1000(plex) gid=1000(plex) groups=1000(plex),100(users)

root@pi-media-server:/# cd /config/
root@pi-media-server:/config# ls -pla
total 20
drwxr-xr-x  4 plex plex 4096 Apr 26 07:41 ./
drwxr-xr-x+ 1 root root 4096 Jun  7 14:18 ../
drwxr-xr-x  5 plex plex 4096 Apr 26 07:07 Library/
drwxr-xr-x  3 plex plex 4096 Jun  7  2021 trans/

Setting the environemt variable SYSCALL_MAX_ENABLED=1 for the container does in fact solve it for me, it indeed moves "forward" to the Critical: libusb_init failed error, yet in my case it will play media (YMMV).

#!/usr/bin/env bash

#DOCKERTAG='1.22.3.4523-d0ce30438'
DOCKERTAG='1.23.2.4656-85f0adf5b'

docker run -d \
  --name plex \
  --net host \
  -p 32400:32400 \
  --restart always \
  --volume /foo/bar1:/config \
  --volume /foo/bar2:/data \
  --env SYSCALL_MAX_ENABLED=1 \
  greensheep/plex-server-docker-rpi:"${DOCKERTAG}"
docker ps
CONTAINER ID   IMAGE                                                     COMMAND            CREATED          STATUS         PORTS     NAMES
e1f43a133db9   greensheep/plex-server-docker-rpi:1.23.2.4656-85f0adf5b   "/entrypoint.sh"   10 minutes ago   Up 9 minutes             plex

If I revert to image 1.22.3.4523-d0ce30438 everything is fine again. This also occurred with previous version(s) of Docker 20.10.5.

If so desired I could provide the .dmp file.

I'm not asking you to fix this (this will be done upstream), but just a heads up, and maybe incorporate in the readme for now? :)

Thank you for the effort!

Raspberry Pi2 is actually able to transcode streams

Hi greensheep,

Thanks for creating this repo. I too have been interested in Docker and Plex on the Pi2, and recently came across this blog post on the awesome HTPC Guides blog

http://www.htpcguides.com/fix-plex-server-is-not-powerful-enough-on-raspberry-pi-2/

which has a method for tricking ARM hardware so it will transcode. Apply this hack to your Dockerfile, I have now successfully created a Docker image which is able to transcode up to three streams simultaneously on the RPi2. Thought you might be interested and I can send you a PR if want to update your repo.

https://github.com/bradleybossard/plex-server-docker-rpi

b.

unable to navigate mounted drive even with correct permissions

Using an NTFS mounted external hdd, I'm unable to get Plex to see my media folders. I've run the command ln -s to get the appropriate UID and GID, but when browsing for media, i appear to be stuck. the top most folder i can get to is the one containing entrypoint.sh, and simply pasting in the full path to my media results in nothing being found. this occurs both with the straight docker run as well as with a compose yaml file. any suggestions?

Error in command line:the argument for option '--serverUuid' should follow immediately after the equal sign

Running on a pi 3b+.
This is a clean raspbian (a few months old, but nothing altered, other than enabling ssh)

Just ran the instructions directly from readme (with sudo)

Not sure where this command line --serverUuid comes from

pi@raspberrypi:~ $ sudo  docker run --name plex --net host -p 32400:32400 --restart always --volume $(echo $HOME)/media/plex/config:/config --volume $(echo $HOME)/media/plex/data:/data greensheep/plex-server-docker-rpi:latest
Unable to find image 'greensheep/plex-server-docker-rpi:latest' locally
latest: Pulling from greensheep/plex-server-docker-rpi
ebe5f2b76040: Pull complete 
1a1e10ff4b41: Pull complete 
2b88cf08649f: Pull complete 
Digest: sha256:fa6dfc8e9ae7f66d3fecf5715fd9cc55f1720685bb25d2db1664e057526c6bc2
Status: Downloaded newer image for greensheep/plex-server-docker-rpi:latest
WARNING: Published ports are discarded when using host network mode
Error in command line:the argument for option '--serverUuid' should follow immediately after the equal sign
Crash Uploader options (all are required):

Unable to use network drive for plex/config volume

Hi, first, great work :)
But I have an issue, if I try to use a network drive to store the plex/config and /plex/data, but my plex media server does not start.
If I use a local directory (on the raspberry pi 3 sd card, like /home/pi/media/plex/config) it works like a charm.
I use to have sd card corruption issues on my previous plex installs. I would like to store the config and data on a bigger network drive.

FYI, I mount the drive on startup on /home/pi/media/PlexHDD, it's a FAT32 hdd drive, SMB1 (old apple timecapsule)

Below the error from the logs

pi@raspberrypi3:~/media $ docker logs -f plex
Error in command line:the argument for option '--serverUuid' should follow immediately after the equal sign
Crash Uploader options (all are required):
--directory arg Directory to scan for crash reports
--serverUuid arg UUID of the server that crashed
--userId arg User that owns this product
--platform arg Platform string
--platformVersion arg Platform version string
--vendor arg Vendor string
--device arg Device string
--model arg Device model string
--sentryUrl arg Sentry URL to upload to
--sentryKey arg Sentry Key for the project
--version arg Version of the product
^C

And the docker command I use

docker run -d --name plex --net host -p 32400:32400 --restart always --volume /home/pi/media/PlexHDD/plex/config:/config --volume /home/pi/media/PlexHDD/plex/data:/data --volume /home/pi/media/PlexHDD:/PlexHDD --volume /etc/localtime:/etc/localtime:ro greensheep/plex-server-docker-rpi:latest

any ideas ?

Plex Server Error

HypriotOS: root@black-pearl in ~/plex-server-docker-rpi/plex on master*
$ docker logs plex
start.sh: line 12: 10 Illegal instruction (core dumped) ./Plex\ Media\ Server
start.sh: line 12: 10 Illegal instruction (core dumped) ./Plex\ Media\ Server
start.sh: line 12: 10 Illegal instruction (core dumped) ./Plex\ Media\ Server
start.sh: line 12: 8 Illegal instruction (core dumped) ./Plex\ Media\ Server
start.sh: line 12: 8 Illegal instruction (core dumped) ./Plex\ Media\ Server
start.sh: line 12: 11 Illegal instruction (core dumped) ./Plex\ Media\ Server
start.sh: line 12: 10 Illegal instruction (core dumped) ./Plex\ Media\ Server

Cannot add server in web interface

I've pulled the image and it's running, but where I would normally see a place to add media, I'm seeing the link to go to plex.tv and download the server software.

I'm noticing a lot of articles about verifying folder permissions or the user running Plex. See:

Does this docker image need any special folder permissions? Or is there somewhere that “PLEX_MEDIA_SERVER_USER=plex” can be changed?

Docker Compose

Hi,

Can you create a docker-compose.yml file instead of the docker run command? It might make things easier, especially when using portainer.

Thanks,
Feriman

Wrong ownership for /transcode folder

I mount /transcode folder to /dev/shm/plex to perform all the transcoding in memory.
But since this is a tmpfs partition it gets cleared on boot.
Then the folder for this mount is created with the default ownership root:root and it breaks the transcoding since this folder should have the default permission like pi:pi or 1000:1000 to be more precise.

That would not be an issue if the transcode directory is mounted somewhere on a persistent partition.
But with /dev/shm this is a kind of issue.

I would suggest adjusting /transcode ownership from Dockerfile accordingly:

RUN mkdir $PLEX_TRANSCODE_DIR && chown $PLEX_USER_NAME $PLEX_TRANSCODE_DIR

upd. As for now, fixed with adding the following to fstab:

tmpfs /dev/shm/plex tmpfs defaults,mode=0755,uid=1000,gid=1000,nofail 0 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.