Jay Taylor's notes

back to listing index

The Complete Guide to Building Your Own Personal Streaming Service Powered by Docker and Plex : Piracy

[web search]
Original source (www.reddit.com)
Tags: tutorial torrent docker streaming plex www.reddit.com
Clipped on: 2021-07-06

4.7k

The Complete Guide to Building Your Own Personal Streaming Service Powered by Docker and Plex

4.7k
Image (Asset 1/10) alt=
level 1
level 2

hundreds of incomplete, intelligible tutorials and videos

Yeah, that pretty much sums up my experience with anything linux, lol.

6
level 2
· 3m
Piracy is bad, mkay?

See it like this: You learned a bit on the way and got some information you can only aquire by searching yourself...

But I feel you. Started with a RaspberryPi 4 and docker and now have all my services (radarr, sonarr, jackett, resilio and jellyfin) up and running

4
level 2
[deleted]
· 3m

You're far better off learning and doing the way you did instead of having it handed it to you.

I'm sure you've already identified some things you would like to improve on your setup by reading this guide, but nothing really beats getting down in the digital ditch and doing the hard work on your own from time to time.

4
level 2

Big OOOOF

1
level 1
level 2

I think this is important, I remember seeing a thread in this sub asking what Plex was and how it all worked.

I think you did a great job with your level of detail, next up should be a docker implementation of all of this. Makes it a lot easier to manage and install.

4
level 2
· 3m

I urge you to test ufw with docker as in all my testing up to last year, docker would create a rule on iptables and by pass any configuration you did with ufw. I even found a script a guy created in order to properly make docker work with ufw.

3
level 2

Typo on this line image: linuxserver/plex , you misspelled it, took me for ever to find why I didn't have enough docker "permissions" to pull the repo

3
level 2
· 3m
Yarrr!

Try rdt client if you want to download much faster without having to worry about a VPN. You just need a real debrid account.

2
level 2

Mate, your work is treasure, we aren't appreciate it.

2
level 2

This is a great guide. I just built my own NAS with unraid. I can use this as a guide.

2
level 2

Thank you dude. Might hook my raspberry running pi hole up with a hard drive and try to get Plex working. Seems like a fun project. I definetly saved this post and the pastebin markup.

2
level 1
· 3m

That's a lot of work. Saving this, thank you.

211
level 2
· 3m

As someone who has built a similar streaming service I will say it is a lot more work not having amazing documentation like this. Kudos, OP.

54
level 2

Damn, I just installed all these programs on my windows pc and everything just works. Been that way for months.

9
level 2

If you don’t want to put in as much effort I’d just use dockSTARTer as it’ll configure all of it for you. No need to mess with compose files. Still requires some effort but it’s definitely easier.

3
level 2

Likewise!

1
level 1
Comment removed by moderator · 3m
level 1

What's the advantage of using this instead of just Plex for Windows?

41
level 2

Been running it on Windows for the past 4 years without any issues.

35
level 2

I was thinking about the same. I have all these things running, plex, sonarr, radarr, jackett etc. On windows. Setup was around 30min because I was fiddling with video qualities in radarr. If you leave it to default you can setup all in 10min with next-next-next.

9
level 2

Aside from the fact that Linux is free? I'd say none lol

9
level 2
Comment deleted by user · 3m
level 2

Easier to just install linux than to pirate W10 imo

1
level 2
· 3m
Piracy is bad, mkay?

If you combine everything: Have it all in one network on one device. Easier to manage. Docker is also better than virtualization for such small services.

If you only run Plex on a Windows-PC (server) there are no advantages.
Only advantage to this: If you don't like/want Linux

1
level 2

Not running windows.

That’s about it. With WSL2.0 you can even get all the advantages of docker within windows. If you’re planning to run it on dedicated hardware you can save a lot of resources by not running windows. If you want a machine to just act like a server Linux is often faster.

1
level 2

Personally, I found the most cost and energy efficient "always on" media server to be a Raspberry Pi 4. Couldn't find a similar device made for windows.

1
level 1

Great guide, thank you. I set mine up about a month ago on my Synology NAS and it's all working beautifully.

I hope you don't mind me also recommending these guides for newcomers, as they helped me immensely in terms of using the correct file structures and Synology-specific examples:

https://wiki.servarr.com/Docker_Guide

https://trash-guides.info/Misc/how-to-set-up-hardlinks-and-atomic-moves/

31
level 2
· 3m · edited 3m

Let me also plug a guide I wrote that covers many of the same topics from the perspective of (Synology) NAS owners:

https://www.oliviertravers.com/synology-apps-containers-media-self-hosted/

6
level 2

I actually had an issue while writing this about hardlinks where that explanation would have been useful! I eventually figured it out in a purely docker context, but it's actually great that someone has broken it down into pieces specific to the arr suite.

6
level 1

Thanks for this! I recently switched from a bunch of file servers + kodi to plex, and then started thinking about giving sonarr/radarr a spin. Now might be the time.

Quick question: why docker instead of bare metal via your package manager? Seems like the latter would be easier to set up and maintain when you're only setting up one system, but that's probably just my ignorance of docker.

18
level 2

Sonarr is probably the best piece of software you can use along with Plex. I have it running with Plex on my family computer and it manages the whole thing perfectly.

4
level 2

My question woulde be, why docker if there's all those symbolic links and plenty of stuff I got to setup manually?

I once got a script that I could run on a kimsufi and it set it all up for me. I don't see the advantage of using docker here if I'll be setting up things outside of it anyways

5
level 2
· 3m
Piracy is bad, mkay?

You can think of docker like a lightwight virtualization (like esxi or virtualbox). The advantage: Containers are like little isolated programs running within the docker engine. They can't reach out except if you allow it. Like folder binds.
Container sees this:
• /media
Your bind on the host could be:
• /user/appoxo/media/movies

Your container can only see a /media folder but it redirects it to your actual media folder.

3
level 1

Thank you for this. Incredible write up!

16
level 1
· 3m
Yarrr!

"rEaD tHe mEgAtHrEad, tHiS iS aLl iN tHe wIkI¡"

But no, +1, good guide.

68
level 1

Wow what a write-up. Will take a look tomorrow. I'd definitely use jellyfin over Plex though

7
level 1

I also highly recommend using Portainer. It makes container learning and management so much easier and faster.

15
level 2

Came just to see if I could piggy back off of any comments for Portainer. It really makes all of these much easier to manage.

6
level 2
· 3m
Piracy is bad, mkay?

Especially if used together with OMV5 (very easy to update portainer this way)

2
level 1

thanks, legend. saved for later

4
level 1

god tier write up. saved for future use mods, can we get this pinned/added to wiki?

4
level 1

I would recommend JellyFin TBH since Plex has the ~100 friend limit.

34
level 2

Second this, no reason to pay Plex for basic features.

Luckily the above guide shouldn't be hard to adopt. Most of the steps are the same, with just some googling of jellyfin-equivalent steps

Only downside is Jellyfin has a garbage roku app at the moment :(

8
level 2

Plex also has a history of deleting people before they hit that limit. Jellyfin and Emby really cater to the "entrepreneurial" individuals, which I don't personally support. Older media should be free, no matter who's hosting it.

11
level 2
· 3m
Piracy is bad, mkay?

And it's free and potentially more customizable

1
level 1

Thanks for sharing!

2
level 1

Thank you for this. This is awesome. I apologize for this noob question as I'm very new to Linux, but is it possible to use my existing external hard drives with out formatting them? I have plex server on my PC, but want to move it to my Raspberry PI 4 so I can always have it running.

4
level 2
· 3m
Piracy is bad, mkay?

Depends...Afaik Linux can use NTFS but (so I read) it has more overhead than using ext4.
If you have questions about it running on docker with a raspberry pi I could try to help you :)

If you just want to try it out: Make a backup of your files and just plug in into your pi and mount it.
Warning: If you have external drives without it's own power supply it wont end good. The Pi will run unstable with 2 external drives.

3
level 2

I just did the RPI4 setup (with a new multi drive bay). It's a good move and great having the server always on. Just FYI, it has problems transcoding some 1080p videos fast enough, but you can have Plex optimize the files to get around this. It's well worth it for always on.

1
level 1

Eli5 why do I need this?

18
level 2
· 3m
Torrents

essentially a local netflix, that updates the content automatically that you specified before.

e.g. new episode of american dad drops, your server downloads it, it appears in your plex dashboard

27
level 1

This is truly the best post I’ve ever seen in a subreddit, I mean seriously...just wow. You’re awesome dude. I wish I could give awards or something.

3
level 1

If you guys have issues with unetbootin, use balena etcher it's better.

3
level 1

Just curious, why use Ubuntu/Linux when it seems like a whole lot of unnecessary hassle? I mean all of this seems sorta unnecessary when I've got the same thing running fine on a windows computer with just Plex and Sonarr/Radarr

9
level 2
· 3m

Why do you think it's a lot of unnecessary hassle?

A lot of people run setups like this on seperate computers, virtualized machines, or raspberry pi's(wich don't support windows as far as I'm aware).

Linux is also free, doesn't spy on you, low-resource friendly and very stable.

Of course if you don't know any linux then it might be intimidating. But for someone that knows some linux it makes much more sense to set something like this up on a linux server. In my opinion it's also so much better working with a terminal then a GUI(god i hate windows server).

Why would you use windows for something like this? The only real reasons is because thats what you know how to do, or you dont have a pc you can install linux on. Which is totally valid reasons btw.

But I have a spare server and I spin up a VM, install linux and my media server and just leave it there for weeks/months without having to manage it.

There's also many great advantages of running services like this through docker. It's really easy to pull and run a image. Write a short docker-compose and save configurations and user data with persistant storage. The rest of the container you can throw away when it breaks. It's also easy to update(just pull the new image) or roll back to a previous image, which I personally have had to done a few times.

There's many great advantages to use linux for something like this and many other things. Almost all servers in the real world run linux for a reason.

But don't get me wrong, Windows is fine as well, personally I just wouldn't pick it for something like this for all the reasons mentioned above and probably more. I'm not a Microsoft hater, I use Windows 10 for my personal computer and lots of Microsoft cloud products privately and for work(IT).

4
level 1

Jellyfin better

35
level 2
· 3m · edited 3m

And doesn't require paid subscription in order to use your own hardware for accelerating transcoding!

15
level 2

It's definately better in that it's open source and free, but Plex is just nicer. Plex made it easy to add friends and family to the ship's crew (arr).

33
level 2

Hard agree and yet I still use Plex and paid for a lifetime Plex pass.

Jellyfin has a lot going for it but it is not as mature as the Plex ecosystem and Plex already drives away some non-technical users.

2
level 1

does the machine have to running 24/7?

3
level 2

Ideally, yes. Radarr/Sonarr scrape sites via Jackett in two ways: one is getting an updated list of everything in the category (low server impact), the other is by searching the indexers for something specific (high server impact). By leaving the machine on, you can both help the indexer (that you're no longer supporting through ads) and you can seed more which helps the entire community.

You don't have to convert your whole system either. 90% of these steps can be reused on a Raspberry Pi 4B for $55 for the 4GB model (min recommended RAM) and a USB hard drive. Would that interest anybody? I could add a rPi section to the appendix.

19
level 2

It has to be running for the services to work.

6
level 1

I am planning to build a budget server in a few months, and this is perfect for that. Thank you!

2
level 1

Thanks!

2
level 1

Great write-up! You can obviously use Plex alternatives for multiples logins and whatnot if you don't want to pay.

....And instead of buying a vpn for port forwarding and ssh. I would suggest using an actual vpn(since the definition of vpn is used differently for something like PIA or NordVPN, etc.) I would suggest to use ZeroTier instead its free and you can connect up to 50 devices on a single network(pay for more devices), the network itself is very secure. You can manage all your devices from your account as well.

2
level 2

Could you elaborate on how you would set this up with ZeroTier?

1
level 1
· 3m
Yarrr!

When the guide has a lot of things to read, I switch to becoming a visual learner.

2
level 1

I recently had to rebuild my Plex server and ended up sticking with Windows because I'm comfortable and could get it back up faster. However I intend on building a new Linux server and this guide will come in handy for sure!

I would also suggest using Tautulli for tracking watch history, media, etc. It also comes with a very user friendly mobile app.

I also use Ombi because it has a nice interface and allows my parents to request new TV shows and movies without needing to text me (My dad still does because he says it's easier).

There is also an app for Android called nzbGet360 that allows me to manage my torrents, nzb, Sonarr and Radarr all within a single app.

Some quality of life additions to look at would be:

Tdarr which allows you to convert your media into whatever you need. I'm currently in the process of converting everything to h265 to maximize storage space.

Bazarr which scrapes your media and finds subtitles for them through a whole bunch of different configurable websites.

Source: Have been hosting my own Plex server for many, many years. I also stick with Plex because it is the most widely accessible program and has a familiar feel to the usual streaming services

2
level 1

This is a very detailed guide. Thank you!

I have a sincere question. I currently use Firecore's Infuse on my Apple TV and a networked drive attached to my router. What advantages would I get by building a plex server instead?

2
level 1
· 3m
Seeder

Why is a port forwarding vpn desirable again? I never quiet understood that

2
level 2

It’s used for seeding, which may feel unnecessary but it’s critical the peering network to function. And because you’re behind a VPN, there’s no risk to you for enabling it. I heavily suggest it only because there are so many leechers.

2
level 1

This is fantastic. It’s also worth noting that for individuals who’ve never dabbled in Linux or command line before there are hosted services you can buy that have “one-click” installers for Plex, Sonarr, Radarr and more.

r/seedboxes

2
level 1

Thank you so much for doing this. Looking forward to setting this up during a slow week. By the way, just one question...wouldn't it be a bit more useful to use AMD gpus instead of nvidia?

2
level 1

Mullvad VPN also claims to support port forwarding.

2
level 2

They do, you specify the key (device) you want to use and it'll give you a random port for the given server.

3
level 1

Hm

2
level 1

But even when hosting your own server with PLEX, when I upload my video files they will get scanned into the library and eventually be shared with Plex, no? so what are my chances that my account would get suspended / banned due to copyrighted material?


I know of several cases where people uploaded such files Plex's cloud solution which resulted in their accounts getting cancelled due to copyright infringement. They only way I can see to circumvent this is to set up my own fileserver, upload all the videos and then use SFTP with KODI to sync up my library. Any better ideas than this?

2
level 2

Plex cloud was actually canceled, so your media will sit on your drive and go nowhere else. As far as I know, Plex Inc does not care what content you have stored locally. This could all change with one lawsuit, but I’m willing to bet Plex knows their true business model.

2
level 1

This guide was quite literally EXACTLY what I needed! The only unfortunate part is I use an AMD GPU. Think you could add AMD GPU support to future versions of the guide?

3
level 2

AMD support on Plex is a little hacky at the moment. While AMD has a custom software interface for fast encoding/decoding, most software (including ffmpeg, which both Plex and Emby use) instead defaults to vaapi.

Instead, I’d recommend using Emby for all AMD acceleration.

I don’t have a recent AMD GPU to test unfortunately, and now is not an easy time to get one. I’ll see if I can wrangle an older card from my friend group.

6
level 1
[deleted]
· 3m

Thank you for this write up. I’ve saved this. I currently have an older host that’s running on Ubuntu. When it’s time to replace it, what are the advantages of running it on docker?

2
level 2

Mostly maintainability. Swapping in and out services or updating containers is a cinch compared to having to go through a package manager and clean up the crud yourself.

It takes about 30 seconds including download time to update every service you see in this guide, compared to having to individual grab binaries or get a release from GitHub.

It also makes it a cinch to add other services to the same host that otherwise might live at odds, like the UniFi controller or even separate instances of Radarr/Sonarr (which is unfortunately the best way I’ve found if you want to get both 1080p and 4K releases).

2
level 1
· 3m
Yarrr!

Overseerr is better than Ombi imo.

2
level 2

But it is still alpha.

1
level 1
Comment removed by moderator · 3m
level 1

Just buy a seedbox that has the capability to work with Plex.

1
level 1
level 1

why a headless server? why docker?

1
level 2

Lighter resource utilization with Linux server. Dedicate more of the horsepower to the apps and not the OS. Faster rebooting.

Docker compartmentilizes the apps so they don't break each other or the operating system. Easier to upgrade and maintain.

4
level 1

Great work! Will try it out, thanks

1
level 1

Great guide, thank you for this. Saved.

1
level 1

Many thanks for taking the time and putting in the effort to make this guide!

I’ll definitely give it a go... Cheers!

1
level 1

Thanks a lot mate!

1
level 1

This is awesome! Would love a rclone/gdrive/mergerfs implementation section as well!

1
level 1

Anyone got a helm for this ? (Kubernetes)

1
level 1

I wouldn't doubt for a second that this is THE post to give my free award. Kudos.


I do have one question though, and this is mostly for convenience reasons as my desktop is the most powerful computer that can surely handle a server task; is it possible to use only Windows? If so, how?

I'm sure I can get my hands on a lower end PC and have it running in the background, but if it'd be great if I could avoid doing so.

1
level 1

Is transmission the recommended torrent for this setup with vpn? Can I use qbittorent?

1
level 1

You're the champ OP! Have my poor man's gold!

1
level 1

God I wish I had this a year ago. Do you think a future iteration might also include instructions on Usenet / sabnzb?

1
level 1

Thank you so much I've been fighting with linux and docker for months now(trying to run it all on an old pc) and this is the most concise write-up for linux server ever dear lord thank you so much

1
level 1

Really great and detailed guide, thanks for sharing. Haven't used Sonarr on my server, might take a look.

1
level 1

I could have done it all myself, but this is such a complete setup, this is almost art...

If I had to suggest a VPN service though, I'd say use Wireguard. It's a faster, newer and easier protocol to set up and use, it allows you to connect from anywhere to your home.

1
level 1

Fantastic job here! The only thing I'd change would be Jellyfin but other than that awesome!

1
level 1

This is a great guide, and I might follow it as I've always felt like I "should" set it up this way.

One thing I don't see answered that maybe you or someone else can for me is "but why?"

What makes this way so much better/worth it than just doing it in windows with 5% of the complexity?

1
level 2

but why

Automation! It's much easier in the future once you lay the groundwork now. I don't even look at trackers anymore, the latest episodes just appear in my library.

It really depends how much you watch and how easy you want to make it for your friends and family that you hopefully share with.

1
level 1
· 3m
Piracy is bad, mkay?

if you have a good client, smb is enough. just link your hdd to a raspberry pi, setup smb and enjoy. get sonarr/radarr and qbittorrent if you want to automate downloads.

if you’re in the Apple ecosystem, use infuse as the client, it’s the best (makes everything look like netflix). on Windows/linux/android vlc will do it but it looks like shit ‍♂️

1
level 1

Great post. I’m looking forward to what you write about Let’s Encrypt. I’ve been trying to figure out how to add Traefik2 to my set up for about a month now.

1
level 1

Hm

1
level 1

What is the advantage of using docker and not directly install it on Linux? I have no problem installing things on Linux and doing configurations, but never used docker for anything.

Also I use jellyfin, it's not as mature as Plex but it's completely opensource and free (for all platforms)

1
level 2

Shareable, not limited to a single distros packages, and easily reproducible.

1
level 1

This is what this sub needs. Thank you OP

1
level 1

Commenting to save. Thanks!

1
level 1

Thank you so much, I was just dreading all the research and crappy/outdated tutorials I was going to have to try to wade through. Great job.

1
level 1

Thanks for making this.

1
level 1

This is a beautiful guide. Should be pinned :p Definitely saved for reference if I ever go and get my own dedicated server.

1
level 1

This is gold

1
level 1

This is really cool, but it’s a lot for me. I achieve the same end result with windows, plex and a BitTorrent RSS feed.

1
level 1
· 3m
Torrents

I have a pretty much similar setup in my Synology DS218+ and it never lets me down getting content and having it ready for Plex (also powered by the NAS) somewhat I feel configuring a setup like this is a bit more cumbersome on Linux (even when my NAS has Linux lol) but yeah, there's a bit of joy doing this work (or maybe not a bit).

Definitely this is a dream setup which I don't think I'd ever dreamed about when I was a kid.

1
level 1

Nice! I'm going to read this later when I have time!

1
level 1

Why do people use linux for their servers? Sorry, maybe it's because I'm not that familiar with the OS, but I've got mine running on an old computer and I ave zero issues.

1
level 2

Linux is just very lightweight. Out of the box, it doesn't even output a video signal when running as a server and uses very little RAM. It also has exceptional software support with programs like Docker.

1
level 1

Does this work in Asian countries?

1
level 2

Asian countries seem to favor centralized piracy services over BitTorrent, so it's possible you will have slower speeds than in the US or EU, but all the technology will still work.

1
level 1

You could also use a synology for easy install

1
level 1

Question on plex, I tried setting up on the nas and it takes so long to load up the video files is that normal or perhaps a setting I'm missing?

To be fair it's two 10 tbs drives, the movies 10tb are all on a single folder, seasons are in separate folders of course

1
level 2

I'm willing to bet that the client is attempting to transcode the file, which is CPU intensive and probably more than the NAS can handle.

Check that "Disable video stream transcoding" is checked under Settings->Server->Transcoder.

1
level 1

Let's see. Most stuff is installed via docker containers, so you could as well use a Windows/Mac/BSD server instead of Linux.

Also, I'd recommend creating an Ansible playbook (far as docker images go, one can grab self-host seedbox build instead) to handle much of that stuff.

1
level 1

I just have a Synology NAS as a shared network drive and play the files with VLC. Works fine.

1
level 1

This seems like a lot more work than just using unraid

1
level 1

I just used DockSTARTer and it did most of the work for me

1
level 1

Thanks for this, bookmarked for this weekend to give it a good try setting up!

1
level 1
Comment deleted by user · 3m
level 1

Jellyfin android app is free and all of it is open source. I moved on from plex.

1
level 1

I just set up something very similar to this but with Xpenology (Synology OS for non-synology BYO hardware). Runs beautifully and as its on a repurposed thin client, it’s super quiet, small and power-efficient.

1
level 1

Commenting here so I can start working on this in the evening today. Thank you so much for this. Luckily I already have knowledge about ubuntu, docker so this should be doable.

1
level 1

if you have high upload speed, can consider using google photos. split long videos to be below 15min then upload by folders. there is a limit of 100GB a day. I have 20TB uploaded. easy to stream

1
level 1

Will this automatically change file names as well?

1
level 2

You can configure Sonarr/Radarr to change file names, but it’s actually advantageous to leave the file name as-is because it will enable you to find subtitles specific to your release group in Plex.

1
level 1

I'm interested on trying this, but I'm completely new to this and have zero idea but willing to learn.
My biggest question tho is, what PC spec should I build for this? Do I need a strong PC for this? Or I can use low-end PC for this?
Can anyone please recommend me a spec or if there's something I can buy already built for this kind of thing like Raspberry Pi.

1
level 2

RPi can run the whole stack but will suffer if you ever want to transcode to a lower bitrate or if you use a device without native support for the encoding of the file (some smart TVs, for example, will not be able to decode HEVC/h265).

If you do want to transcode, any Intel processor from 8th gen forward (including the cheaper i3) will have “Intel UHD graphics 630” built-in, and is the gold standard for up to 6 simultaneous transcodes in Plex.

I will be adding a Pi guide later today.

1