Run PLEX via container station

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Sat Apr 25, 2020 11:40 pm

I'm a little confused how to setup Docker using Container Station. I've installed linuxserver/docker-plex and when I run it the console says it started. I can enter a terminal window but that's about it, I can't attach to the Plex server to set anything up.

Someone mentioned "the creation of the container itself is done via the ssh terminal" and there's been a lot of docker startup scripts listed above. But, how do I actually go about doing that? Container Station has a "Command" setting and then under Advanced Settings there's Link, Environment, Network, Device, and Shared Folders. I assume these loosely relate to the command line settings listed above?

So how would I ignore these Container Station settings and run Plex from a command line?

I guess I'm looking for just a basic setup, something like:

1) Install the linuxserver/docker-plex docker
2) Do this...
3) Do that...
4) Create a script "file" in "folder" that contains the following... "docker create \..."
5) Then do this...
6) And finally this...
7) To access your Plex server, do that...

I've searched Google and here and I can't find these basic first setup instructions. They all must assume you already know Docker, which I've tried to use on other platforms but I've found it too difficult so I've used other methods (like just using a VM).

Thanks!

Tim

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Mon Apr 27, 2020 12:28 am

Okay, so after a few hours of trial and error I figured it out, here's what you do for those who don't already use Docker.

1) Install Container Station on the QTS App Center
2) Don't do anything in Container Station at this point, ignore it
3) From a shell on your QNAP server, create a script that looks something like this (more info on customizing this below):

Code: Select all

docker create \
--name="plex" \
--net=host \
--device=/dev/dri:/dev/dri \
-h "qnaplex" \
-e VERSION=public \
-e PUID=0 -e PGID=100 \
-e TZ="America/New_York" \
-v /share/Container/linuxserver-plex/config:/config:rw \
-v /share/Container/linuxserver-plex/transcode:/transcode:rw \
-v /share/Multimedia/Videos:/data/multimedia/videos:rw \
-v /share/Multimedia/Music:/data/multimedia/music:rw \
-v /share/Multimedia/Pictures:/data/multimedia/pictures:rw \
linuxserver/plex
4) Run the above command, this will create your Plex Docker which will show up in Container Station
5) Now get into Container Station and you'll see the plex container, Start it
6) Once started, view the console to make sure it started okay, should say something like Starting Plex Media Server
7) Visit htttp://<your-ip>:32400/web/ to setup Plex!

The command above will need to be customized to your particular situation. The "-v" lines need to be set to the folders were your media files are located. Also, the "config" and "transcode" folders will be where the Plex config and transcode files are stored. I stuck them in my Container share in the "linuxserver-plex" folder, but you could store them anywhere.

Hope this helps another Docker noob!

MikeLagit
Easy as a breeze
Posts: 332
Joined: Fri Mar 22, 2013 11:40 pm

Re: Run PLEX via container station

Post by MikeLagit » Mon Apr 27, 2020 12:55 am

What is your reason for using docker vs the qpkg? Just for security?


Sent from my SM-G973U1 using Tapatalk

Model: TVS-872XT 16GB
(HDD): [RAID-5] 6 x 8TB Seagate Ironwolf

Model: TS-877-1700 16GB
(HDD): [RAID-5] 4 x 8TB Seagate Ironwolf

Model:TS-569L 3GB
(HDD): [RAID-5] 4 x 3TB WD Red

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Mon Apr 27, 2020 5:38 am

MikeLagit wrote:
Mon Apr 27, 2020 12:55 am
What is your reason for using docker vs the qpkg? Just for security?


Sent from my SM-G973U1 using Tapatalk
Several reasons...

Mainly, I can't upgrade past Plex v1.14 without updating my QNAP but doing that breaks a few things that I use 24/7 (Transmission and VPN). With Docker, I can run the latest version of Plex.

Other reasons include:

1) Running the Plex database on an SSD drive instead of spinning drives, which makes it more quite as it's in my media room and probably cancels out any slowdown from running it as a container instead of native.
2) Portability: At any time I can export the container and quickly install it on any other system (like a NAS upgrade for example).
3) Backups
4) Automatic Plex updates
5) Security

There's probably other reasons too. The only real down-side is a slight speed hit. But it's not noticeable and running the database and all the thumbnails on the SSD probably offset that anyway.

I'm also attempting to switch everything over to Docker containers. This makes services agnostic to the hardware/platform. For example, next I'll be creating a Transmission Docker and moving away from the QNAP qpkg. Next, I'll do the same with surveillance (WiFi cameras right now being done with Surveillance Station qpkg). Once completed, I can easily upgrade the OS of the QNAP, switch to another NAS vendor or build my own server and simply export/import each Docker container from one platform to the other without spending a lifetime setting it all up again.

Basically, going forward I believe using containers for everything is much more forward-thinking than native applications specific to each platform. I'm running an i7 TVS-471 with 16GB RAM, so I'm not desperate for new hardware right now. But in a year I'll probably build my own NAS server where I can throw in a fast GPU to do all the transcoding. I can do 4K transcoding now, but things are always getting bigger and better and require more hardware. This is just one step towards where I'll need to be in a year or so.

Hope that helps!

MikeLagit
Easy as a breeze
Posts: 332
Joined: Fri Mar 22, 2013 11:40 pm

Re: Run PLEX via container station

Post by MikeLagit » Mon Apr 27, 2020 6:16 am

Very cool and awesome response! I didn't have the time or patience after messing around with it initially and not getting anywhere, but if you get it going I'd be very interested in your settings to make it work! Portability in docker is amazing. Please report back if you have some success. If I get some time I may fiddle with it again. Best of luck.



Sent from my SM-G973U1 using Tapatalk

Model: TVS-872XT 16GB
(HDD): [RAID-5] 6 x 8TB Seagate Ironwolf

Model: TS-877-1700 16GB
(HDD): [RAID-5] 4 x 8TB Seagate Ironwolf

Model:TS-569L 3GB
(HDD): [RAID-5] 4 x 3TB WD Red

User avatar
moody_blue
Know my way around
Posts: 111
Joined: Tue Jan 10, 2017 9:23 am

Re: Run PLEX via container station

Post by moody_blue » Mon Apr 27, 2020 10:26 pm

@teckel When using Plex qpkg it's not recommended to use ´/share/Multimedia´ for media. I don't know it this also affects CS.
QNAP TS-253A 4G QTS 4.4.3.1354
Plex Media Server 1.19.4.2935
OpenHAB 2.5.6
Unifi 5.13.29
GLPI 9.4.6

ranranran
Starting out
Posts: 13
Joined: Mon Jan 28, 2019 6:55 am

Re: Run PLEX via container station

Post by ranranran » Wed Apr 29, 2020 11:37 pm

Hi all,

This seems the appropriate thread to post, so here goes:

I have been running the native Plex Server package and have uploaded transcoded mkv movies (via MakeMKV/Handbrake) to a folder on my QNAP for viewing on my Roku (which I take with me when traveling). However, my impression from reading forums and such is that putting the Plex Server in a Docker container is somewhat more secure than running the native app as it separates Plex-mediated access to your NAS from the rest of your NAS where I have personal backup files. Is this correct?

So, I installed Container Station, searched for 'Plex' and then installed the Official Plex Media Server Docker Repo "plexinc/pms-docker".

Now I'm stuck.
1) How do I move all my multimedia files from the native NAS folder to the container so that the Docker Plex Server can access them and they are now isolated from the NAS? I guess I'm thinking of this like a VM where I can move files into it and treat the VM as an isolated "sandboxed" system from my main system.
2) How do I de-link the native Plex Server from my Plex account and associate the Docker Plex Server?

thanks in advance to all that respond. I read teckel's posts, but don't see why I can't just use the official Plex Docker.... ?

navier
Starting out
Posts: 24
Joined: Sat Mar 18, 2017 11:56 pm

Re: Run PLEX via container station

Post by navier » Fri May 01, 2020 2:39 pm

I am not an expert on Docking, but I don’t think moving your multimedia files inside the Docker would be a good idea...

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Sat May 02, 2020 9:35 pm

MikeLagit wrote:
Mon Apr 27, 2020 6:16 am
Very cool and awesome response! I didn't have the time or patience after messing around with it initially and not getting anywhere, but if you get it going I'd be very interested in your settings to make it work! Portability in docker is amazing. Please report back if you have some success. If I get some time I may fiddle with it again. Best of luck.
I got everything working using the instructions I posted a few message up: viewtopic.php?f=354&t=125041&p=750461#p750426

Tim

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Sat May 02, 2020 9:40 pm

ranranran wrote:
Wed Apr 29, 2020 11:37 pm
Hi all,

This seems the appropriate thread to post, so here goes:

I have been running the native Plex Server package and have uploaded transcoded mkv movies (via MakeMKV/Handbrake) to a folder on my QNAP for viewing on my Roku (which I take with me when traveling). However, my impression from reading forums and such is that putting the Plex Server in a Docker container is somewhat more secure than running the native app as it separates Plex-mediated access to your NAS from the rest of your NAS where I have personal backup files. Is this correct?

So, I installed Container Station, searched for 'Plex' and then installed the Official Plex Media Server Docker Repo "plexinc/pms-docker".

Now I'm stuck.
1) How do I move all my multimedia files from the native NAS folder to the container so that the Docker Plex Server can access them and they are now isolated from the NAS? I guess I'm thinking of this like a VM where I can move files into it and treat the VM as an isolated "sandboxed" system from my main system.
2) How do I de-link the native Plex Server from my Plex account and associate the Docker Plex Server?

thanks in advance to all that respond. I read teckel's posts, but don't see why I can't just use the official Plex Docker.... ?
I outlined exactly what I did to get the Plex docker working. I used linuxserver/plex as it seemed to have more users and has been around longer. I detailed what I did a few messages up:

viewtopic.php?f=354&t=125041&p=750461#p750426

Also, you don't put your media inside the docker. You specify where your media is on your system and docker maps to it. In my instructions, you can see this with the "-v" commands. For example:

Code: Select all

-v /share/Multimedia/Videos:/data/multimedia/videos:rw \
This maps a virtual docker path: "/data/multimedia/videos" to the NAS path were the videos are actually located: "/share/Multimedia/Videos". You would need to change the "-v" commands to fit your unique file system.

Tim

MikeLagit
Easy as a breeze
Posts: 332
Joined: Fri Mar 22, 2013 11:40 pm

Re: Run PLEX via container station

Post by MikeLagit » Sun May 03, 2020 12:05 am

That's awesome. Any ideas how to move the database I already have into that docker now? I suspect the easiest is to just take the entire library, but there's an incredible number of files there, especially in cached thumbnails, and I don't want to take anything that's not needed for the move. Anyone with experience moving a library in this manner?


Also it would be good to know the bare minimum of what I should have my crash plan backups saving from plex in case of device failure. With that tool I select the directories or create a REGEX to exclude. I assume the answers to both these questions are exactly the same.



Sent from my SM-G973U1 using Tapatalk

Model: TVS-872XT 16GB
(HDD): [RAID-5] 6 x 8TB Seagate Ironwolf

Model: TS-877-1700 16GB
(HDD): [RAID-5] 4 x 8TB Seagate Ironwolf

Model:TS-569L 3GB
(HDD): [RAID-5] 4 x 3TB WD Red

navier
Starting out
Posts: 24
Joined: Sat Mar 18, 2017 11:56 pm

Re: Run PLEX via container station

Post by navier » Sun May 03, 2020 9:16 pm

MikeLagit wrote:
Sun May 03, 2020 12:05 am
That's awesome. Any ideas how to move the database I already have into that docker now? I suspect the easiest is to just take the entire library, but there's an incredible number of files there, especially in cached thumbnails, and I don't want to take anything that's not needed for the move. Anyone with experience moving a library in this manner?
There is an article about this very subject from Plex itself. Take a look at it!

https://support.plex.tv/articles/201370 ... er-system/

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Mon May 04, 2020 12:05 am

navier wrote:
Sun May 03, 2020 9:16 pm
MikeLagit wrote:
Sun May 03, 2020 12:05 am
That's awesome. Any ideas how to move the database I already have into that docker now? I suspect the easiest is to just take the entire library, but there's an incredible number of files there, especially in cached thumbnails, and I don't want to take anything that's not needed for the move. Anyone with experience moving a library in this manner?
There is an article about this very subject from Plex itself. Take a look at it!

https://support.plex.tv/articles/201370 ... er-system/
Heh, I tried using that technique for a few hours and all I got was corruption which caused Plex to crash when being launched. What I did instead was simply install the exact same docker Plex version I was running on QNAP, grabbed the entire database (it's SQLite so it's just a couple files) and moved it to the Plex docker. Then, I upgraded the docker Plex. Super simple.

In the following folder:

Library > Application Support > Plex Media Server > Plug-in Support

There's a few sub-folders (Caches, Data, Databases, Metadata Combination, Preferences) and I just copied that entire directory from QPKG to the Plex docker (with both Plex server's shut down). Upgraded and I was good to go.

Tim

navier
Starting out
Posts: 24
Joined: Sat Mar 18, 2017 11:56 pm

Re: Run PLEX via container station

Post by navier » Mon May 04, 2020 12:08 am

Really quality content here. Thank you! :)

User avatar
teckel
Know my way around
Posts: 194
Joined: Thu Feb 05, 2015 2:57 am
Contact:

Re: Run PLEX via container station

Post by teckel » Fri May 08, 2020 5:36 am

teckel wrote:
Mon Apr 27, 2020 5:38 am
MikeLagit wrote:
Mon Apr 27, 2020 12:55 am
What is your reason for using docker vs the qpkg? Just for security?


Sent from my SM-G973U1 using Tapatalk
Several reasons...

Mainly, I can't upgrade past Plex v1.14 without updating my QNAP but doing that breaks a few things that I use 24/7 (Transmission and VPN). With Docker, I can run the latest version of Plex.

Other reasons include:

1) Running the Plex database on an SSD drive instead of spinning drives, which makes it more quiet as it's in my media room and probably cancels out any slowdown from running it as a container instead of native.
2) Portability: At any time I can export the container and quickly install it on any other system (like a NAS upgrade for example).
3) Backups
4) Automatic Plex updates
5) Security

There's probably other reasons too. The only real down-side is a slight speed hit. But it's not noticeable and running the database and all the thumbnails on the SSD probably offset that anyway.

I'm also attempting to switch everything over to Docker containers. This makes services agnostic to the hardware/platform. For example, next I'll be creating a Transmission Docker and moving away from the QNAP qpkg. Next, I'll do the same with surveillance (WiFi cameras right now being done with Surveillance Station qpkg). Once completed, I can easily upgrade the OS of the QNAP, switch to another NAS vendor or build my own server and simply export/import each Docker container from one platform to the other without spending a lifetime setting it all up again.

Basically, going forward I believe using containers for everything is much more forward-thinking than native applications specific to each platform. I'm running an i7 TVS-471 with 16GB RAM, so I'm not desperate for new hardware right now. But in a year I'll probably build my own NAS server where I can throw in a fast GPU to do all the transcoding. I can do 4K transcoding now, but things are always getting bigger and better and require more hardware. This is just one step towards where I'll need to be in a year or so.

Hope that helps!

Post Reply

Return to “Container Station”