r/Piracy • • Mar 21 '21
Guide The Complete Guide to Building Your Own Personal Streaming Service Powered by Docker and Plex
Introduction
Plex Media Server is an excellent application, with compatible apps on almost every device with a screen. However, it's only as capable as the files you give it, and it's only as maintainable as the infrastructure you use to build it. This guide will cover installation and configuration on a flexible service platform known as Docker.
Docker is relatively operating system agnostic, but this guide will feature Linux commands and paths so it will also cover installing Linux.
Operating System
If you're an experienced Linux user, you can skip this step as you likely either already know how to install Ubuntu Server or you have another Linux distribution preference.
Download Ubuntu Server from https://ubuntu.com/download/server. Use unetbootin to push the ISO onto a USB drive (just copying the contents will not work) or use a CD burning tool to burn the ISO onto a CD.
On a new machine, all that should be required is to insert the USB drive and boot. If updating over an existing operating system, find your boot menu (or boot options, as it's sometimes called) and select the USB drive as the boot device.
Read the next part fully before proceeding with the install.
Take note that the installation can destroy data if you're installing on a system in use. I recommend disconnecting your media drives and leaving only the drive that you intend to let Ubuntu use. If you're dual booting (keeping windows on the same machine), this guide does not apply and you should search for a guide particularly for "dual booting".
Follow the prompts to install and configure your Ubuntu Server, but ensure you do not install docker during the setup. Ubuntu Snap uses an often outdated version of docker that we want to avoid.
Also make sure "Install OpenSSH server" is checked or you will not be able to access the machine remotely.
When the install has finished, reconnect your drives and boot up.
Connect to the machine remotely from an existing Windows 10 (via Command Prompt), Mac (via Terminal) or Linux computer (via Terminal) with
ssh your-username@serverIPwhere your-username is the username chosen, and serverIP can be found with the command ip addr show (usually the one prefixed with 192.168.
Using Symbolic Links to Keep Media on the Same Drive (option 1)
While not recommended for portability reasons, if you are using only one drive for your Plex server, just run the following commands to create a "symbolic link" to continue with the tutorial:
mkdir /mnt/data
mkdir ~/plexmedia
sudo ln -s $HOME/plexmedia /mnt/data/Auto-Mounting a different Drive(s) (option 2)
Once you've installed and are at a console (preferably via ssh so you can copy+paste the rest of the commands), ask the disk format utility what the available filesystems are with the command:
fdisk -lYou should see a list of entries at the bottom of the command, all beginning with /dev. If this is a new drive, please read the formatting a new drive for Linux section in the Appendix.
For each drive you wish to auto-mount, you must edit the file /etc/fstab by using the command sudo nano /etc/fstab and add a line entry at the bottom like the following:
/dev/sdb1 /mnt/data ntfs-3g uid=1000,gid=1000,dmask=027,fmask=137 0 0The 1st column should be the path of the drive shown in fdisk -l, the 2nd column should be the destination for the mount (you must also create this destination using sudo mkdir /mnt/data), the 3rd column is the type of filesystem contained in the partition (ntfs-3g for Windows-format drives, ext4 for Linux-format) the 4th column is options (which you should copy unless you want different permissions), and the 5th and 6th columns are not used and therefore filled with 0s.
For space saving in a later step, it is imperative that you have your downloads folder and media folder on the same drive. I promise you it will save both space and disk operations.
Tip: To edit the fstab file on the command line, you can use either sudo nano /etc/fstab or sudo vim /etc/fstab. Both are what is called a "plaintext editor", but nano is easier and generally recommended for beginners.
Tip: Whenever you prefix a command with sudo, it runs as a "root user" or the administrator for the system. sudo actually means substitute user do and "substitutes" the root account for the rest of the command. Some files can only be changed by the root user, but be careful when running as sudo!
Once you have added all entries, verify that everything works with the following "mount all" command:
sudo mount -aThis guide will assume you mount at /mnt/data and that your drive contains /mnt/data/downloads, /mnt/data/media/tv, and /mnt/data/media/movies as subdirectories.
Installing Docker and Compose
Once you've installed, rebooted, and logged in you should be left with a fresh install of Linux. We're going to keep it that way by only installing two things: docker and docker-compose.
Docker
Docker uses their own repository that contains up-to-date version of docker. To add it to your Ubuntu system, use the following commands.
Get the prerequisite packages for adding a repository:
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-releaseAdd the keyring that authenticates the repository:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpgAdd the repository itself:
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/nullInstall the package from the new repository:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.ioLastly, add your current user to the docker group so you don't have to be root every time you want to interface with docker
sudo usermod -aG docker $(whoami)You'll need to sign out and back in.
Tip: You can either type exit or use Control-D to log out.
Compose
Compose is simpler than docker install, with only two commands required:
sudo curl -L "https://github.com/docker/compose/releases/download/1.28.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-composeBuilding the Compose File
Docker-compose uses a yml (yet another markup language) file to create and maintain docker instances for you.
All compose files contain a version string and a services object. The version string for this guide is 3.0, so the file will start out looking like
version: "3.0"
services:Save the file as docker-compose.yml (using nano docker-compose.yml or vim docker-compose.yml) in a new directory called plex in your home folder.
Tip: You can create folders using mkdir your-new-folder-name, browse into them using cd folder-to-enter, and exit to the parent folder using cd ..
Tip: Your home folder is located in /home/your-username and you can switch to it at any time using cd ~. All commands except those run with sudo will recognize ~ as your home directory.
Jackett
Jackett is a all-in-one torrent query engine, and more importantly, it is searchable by the other automated components of our docker stack.
An example entry for the compose file is:
jackett:
image: linuxserver/jackett
container_name: jackett
environment:
- PUID=1000
- PGID=1000
- TZ=Americas/New_York
volumes:
- ./config/jackett:/config
ports:
- 9117:9117
restart: unless-stoppedEnsure it is indented under services
Transmission-OpenVPN
In order for our traffic to remain private and secure, we will use a downloader enabled by an OpenVPN provider of your choice. I use TorGuard, but you can use any provider in the supported providers list.
An example entry for the compose file is:
transmission:
image: haugene/transmission-openvpn
container_name: transmission
volumes:
- /mnt/data:/mnt/data
environment:
- PUID=1000
- PGID=1000
- CREATE_TUN_DEVICE=true
- OPENVPN_PROVIDER=PIA
- OPENVPN_CONFIG=ca_toronto
- OPENVPN_USERNAME=username
- OPENVPN_PASSWORD=password
- WEBPROXY_ENABLED=false
- TRANSMISSION_DOWNLOAD_DIR=/mnt/data/downloads
- TRANSMISSION_IDLE_SEEDING_LIMIT_ENABLED=true
- TRANSMISSION_SEED_QUEUE_ENABLED=true
- TRANSMISSION_INCOMPLETE_DIR_ENABLED=false
- LOCAL_NETWORK=192.168.0.0/16
cap_add:
- NET_ADMIN
logging:
driver: json-file
options:
max-size: 10m
ports:
- "9091:9091"
restart: unless-stoppedUpdate the following:
PIAto your providerus_eastto the VPN server you use with your provider. A list of servers grouped by provider is available here. It is recommended that you use a provider and server with port-forward capability.usernameto the username you use with your providerpasswordto the password you use with your provider192.168.0.0/16to your local network segment (if you access your router at http://192.168.1.1, the existing information is correct).
Additionally, the PUID and PGID variables should mirror the pid and gid you set earlier in the /etc/fstab portion of the guide. If you're following this guide exactly, they do not need to be changed.
Sonarr
Sonarr is a TV show scheduling and searching download program. It will take a list of shows you enjoy, search via Jackett, and add them to the transmission downloads queue.
An example entry for the compose file is:
sonarr:
image: linuxserver/sonarr
container_name: sonarr
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
volumes:
- ./config/sonarr:/config
- /mnt/data:/mnt/data
ports:
- 8989:8989
depends_on:
- jackett
- transmission
restart: unless-stoppedAs in above, PUID and PGID must match the uid and gid of the drive mount.
Radarr
Radarr is similar to sonarr, but instead of TV shows, it is built for movies.
An example entry for the compose file is:
radarr:
image: linuxserver/radarr
container_name: radarr
hostname: radarr
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
volumes:
- ./config/radarr:/config
- /mnt/data:/mnt/data
ports:
- 7878:7878
depends_on:
- jackett
- transmission
restart: unless-stoppedAs in above, PUID and PGID must match the uid and gid of the drive mount.
Plex
The Plex instance would ideally live on another server, but it's not required and adds complexity with file sharing systems.
Plex has an official docker image, but it does a poor job of managing permissions (which I've hoped you realized are important by now). Instead, we will use the linuxserver/plex image, which is maintained by the friendly folks at linuxserver.io.
The only caveat to this section of the guide is hardware acceleration, which is why for sake of simplicity I will provide three entries: one for CPU transcoding only, one for Intel GPU-based transcoding, and one for NVIDIA GPU-based transcoding.
For all containers (once again), PUID and GUID should match your fstab settings for pid and gid.
CPU-only Transcoding
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
volumes:
- /mnt/data/media:/media
- ./config/plex:/config
environment:
- PUID=1000
- PGID=1000
- version=docker
ports:
- 32400:32400
restart: unless-stoppedIntel GPU Transcoding
In order for Intel GPU transcoding to work, additionally install the intel-gpu-tools package, which will include both a command for monitoring our GPU's usage, and the underlying driver that makes it possible to use the GPU as a standalone device.
Install it with
sudo apt-get install intel-gpu-toolsAfterwards, add the entry:
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
volumes:
- /mnt/data/media:/media
- ./config/plex:/config
devices:
- "/dev/dri:/dev/dri"
environment:
- PUID=1000
- PGID=1000
- version=docker
ports:
- 32400:32400
restart: unless-stoppedNVIDIA GPU Transcoding
NVIDIA is the most complicated process of the bunch, but is still doable in docker. First, download the Linux drivers for your GPU from the official NVIDIA drivers page. After clicking search and the first download button, when you get to the last page that contains the text
This download includes the NVIDIA graphics driver
right-click the "DOWNLOAD" button and copy the link. Then, in your Linux server machine, run the following commands (copy one line at a time):
cd /tmp
wget -O driver.run [paste your link here, but don't inlcude the brackets!]
chmod +x driver.run
sudo ./driver.runThis will bring up a pseudo-GUI. Follow the instructions and reboot if asked. To verify that your NVIDIA GPU has registered, run the command
sudo nvidia-smiIt should output information about your GPU and current utilization. If it tells you it cannot detect an NVIDIA gpu, reinstall the drivers or try an earlier version.
Once the driver has been registered, the NVIDIA docker repository can be added with the following command (copy the whole thing)
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add - \
&& curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.listAnd installed with this next command (copy the whole thing)
sudo apt-get update \
&& sudo apt-get install nvidia-docker2Finally, we can add the following to our docker-compose.yml file (you may need to return to your earlier directory using the command cd ~/plex):
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
volumes:
- /mnt/data/media:/media
- ./config/plex:/config
environment:
- PUID=1000
- PGID=1000
- version=docker
- NVIDIA_VISIBLE_DEVICES=all
runtime: nvidia
ports:
- 32400:32400
restart: unless-stoppedRunning and configuring the docker stack
Once the file has been built, we can start everything with one command while in the same folder as our docker-compose.yml file:
docker-compose up -dThe -d tells compose to run as a daemon, where logs are not printed to the console. If debugging, I suggest you remove the -d flag and run containers one at a time, e.g.
docker-compose up transmission-openvpnJackett
Jackett is only as good as the trackers you have added to it. Navigate to http://serverIP:9117 where serverIP is the IP address or local hostname of the Linux server.
Add a few indexers using the "add indexer" button. It may feel like a good idea to add a lot, but that increases search times for every single search. At minimum, I consider the following essential:
- 1337x
- EZTV
- ETTV
- RARBG
You can add YTS as well if you're OK with lower bitrate files, but I personally avoid them.
Congrats! You now have a multi-tracker search engine at your fingertips, or more importantly, the fingertips of Sonarr and Radarr. Keep this window open as we move to the next configuration step.
Radarr
Navigate to http://serverIP:7878 in order to access the Radarr console. We're going to change a few settings, starting with "Download Clients."
Under "Download Clients", press the add symbol and select Transmission from the bottom left. Name it "transmission", set the host as "transmission" and everything else can be left alone. Press test, wait for it to show a green checkmark, and then save.
Next, go to Indexers. Enable "Show Advanced" at the top menu bar under search. For each of the indexers you added to Jackett, do the following
- Press the add symbol
- Select Torznab
- Go back to the Jackett window and click "copy Torznab Feed" for your index
- Paste in the URL box, but change
http://serverIP:9117tohttp://jackett:9117. The docker containers address each other by their container name, not by your server's IP. - Copy the API key from Jackett (in the top right)
If you see a warning like
This indexer does not support any of the selected categories! (You may need to turn on advanced settings to see them)
You'll need to go back into Jackett, hit the wrench for the indexer causing the issue, and search for the category of "Movies." There are sometimes several. Copy each category you wish to search (for example, don't include Movies/x265/4k if you don't intend to watch 4K movies) and paste them, separated by commas, into the "Categories" box in Radarr.
Once done, it's time to add our first movie and define the destination paths for our downloads.
Search up a movie (preferably one that's recent and has seeders) in the top bar and select the correct movie. When the popup appears, click under "Root Folder" and select "Add a new path". Fill in the typing bar with /mnt/data/media/movies/ and press "OK". Select the quality profile desired (otherwise, it will select the most seeded) and check "Start search for missing movie".
View your transmission progress at http://serverIP:9091. The download should be added and everything should begin working. When the download finishes, the file will be "hard linked" to the /mnt/data/media/movies directory in a new organized folder. This enables you to seed your entire collection while also maintaining an organized file structure. Deleting from the /mnt/data/downloads directory will not save you any space, because the two files point to the same 1's and 0's on your hard disk. Similarly, when you want to delete a movie from your collection, make sure it is also deleted from /mnt/data/downloads.
Finally, we're going to authentication-lock Radarr by going to Settings -> General and selecting "Basic". Choose a username and password, but be aware that Radarr does not transmit the password securely (meaning you should pick a new password). This is optional but highly recommended.
Sonarr
Radarr is based on Sonarr and the same steps above should be followed, but this time at http://serverIP:8989.
The only other difference is that you should use the /mnt/data/media/tv directory as your "Root Folder" in order to keep the two libraries distinct for Plex.
If you opted for authentication on Radarr, you should do so on Sonarr with the same username and password. Otherwise, some web browsers will get confused.
Plex
This section is easiest done once you have at least one movie and at least one TV episode added. This can either be from Radarr/Sonarr or copied from an existing collection.
In order to set up Plex, the connection origin must appear from the same device that is hosting Plex. That means we cannot use http://serverIP:32400 just yet.
Exit out of your ssh connection and create a new connection, this time with the -L flag as follows:
ssh -L32400:localhost:32400 your-username@serverIPThis creates a "tunnel" from your device into the server that will allow you to configure Plex.
Now, navigate to http://localhost:32400/web to begin the setup.
Name your server something memorable (should be familiar to those who already use Plex), and uncheck "Allow me to access my media outside my home". Plex uses UPnP which only sometimes works on your router, but can cause serious security vulnerabilities.
When adding the libraries, create a Movies library using /media/movies as the path, and create a TV library using /media/tv as the path.
Fiddling with options
If not using hardware transcoding, this step can be skipped. Click the tools icon in the top right of Plex, choose the server from the dropdown menu in the middle of the left column, and under "Settings" click on "Transcoder". Check "Use hardware acceleration when available."
Future Goals
Well, you're done! You now have an all-in-one streaming service that will automatically grab new episodes of TV, chosen movies, and beam them using a nice UI to your various devices. It's a good idea to check out the Appendix for information on how to update your container, and how to secure your server with a firewall.
Future goals for this guide include:
Request Automation
- Discord via Requestrr
- Ombi
- HTTPS support using LetsEncrypt (free certificates)
- Access over the Internet
Let me know what's missing and what you're interested in seeing next!
Appendix
Partitioning and Formatting a New Drive for Linux
When a hard drive or SSD comes new out of the box, it does not yet have a file system on it (USB drives often being an exception). In Linux, formatting a drive is quite easy.
Find your drive by using sudo fdisk -l. Drives that are already formatted and partitioned will have numbers postfixed to them, e.g. /dev/sda1. When you see a drive with no number attached, it is not yet partitioned or formatted. Type the command sudo fdisk -l /dev/sdb if you are partitioning the second "b" drive in the system, and confirm that the "Disk model" matches the drive you expect to partition.
When ready to partition, use the command sudo fdisk /dev/sdb (replacing sdb with the drive you wish to partition). fdisk only writes the changes when you use the w command, so if you believe you have made a mistake, type q to quit and start over.
Use the n command to create a new partition, then continue pressing your enter key to fill in defaults until you return to the Command (m for help) prompt. Use p to print out the new partition layout (should be just one partition starting at 2048 and with the size you expect). If the changes are correct, type w to write the changes and quit.
Next, format the partition with sudo mkfs.ext4 /dev/sdb1 (replacing sdb1 with the partition you just created). If you are told there is already a partition signature, quit using Control-C and make sure you have entered the correct drive.
Congratulations, you have partitioned and formatted a drive in Linux. Return to the main guide for instructions on how to auto-mount the drive.
Updating the Containers
Updates are super easy with Docker. Navigate to your ~/plex directory using cd ~/plex and use the commands docker-compose pull and docker-compose up -d. Just like that, you're up to date!
Firewall
Firewalls are always a good idea, even on an internal network. Ubuntu comes built in with "ufw" or "universal firewall". The following commands will allow you to continue accessing your server, but block any nasty connections you don't intend to have happen (copy the whole thing).
sudo ufw allow 22/tcp \
&& sudo ufw allow 7878/tcp \
&& sudo ufw allow 8989/tcp \
&& sudo ufw allow 9091/tcp \
&& sudo ufw allow 32400/tcp \
&& sudo ufw allow 32400/udp \
&& sudo ufw enablePress y to confirm the changes and the firewall will be online.
Monitoring GPU Usage
The following commands will show your GPU clock speed and usage. Both require the respective drivers to be installed, which has been done if you followed the guide.
- Intel:
sudo intel_gpu_top - NVIDIA:
sudo nvidia-smi -l 1
Port-Forward Capable VPN Providers
Below is a partial list of port-fowarding capable VPN providers and regions. It is by no means exhaustive and is only the providers I have personally tested. If you know a provider and region that support port forwarding within the transmission-openvpn container, let me know!
PrivateInternetAccess (PIA)
- Supported only in a handful of regions, but all work automatically
As of testing, those regions are
- CA Toronto
- CA Montreal
- Netherlands
- Switzerland
- Sweden
- France
- Germany
- Romania
- Israel
TorGuard
- Supported on every region, but only as a preconfigured option
- Once you have chosen a server IP address and port, modify the compose entry by adding these two options to your
environmententry undertransmission: -OPENVPN_OPTS=--remote theipgoeshere 1912filled in with the IP address chosen-TRANSMISSION_PEER_PORT=theportgoesherefilled in with the port chosen-TRANSMISSION_PORT_FORWARDING_ENABLED=truewith no modification
537
u/[deleted] Mar 21 '21
A few notes:
34
u/_Epir_ Mar 21 '21
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/
38
u/12_nick_12 Mar 21 '21
I would recommend JellyFin TBH since Plex has the ~100 friend limit.
36
u/[deleted] Mar 21 '21
Jellyfin better
3
u/Armitage2k Mar 22 '21
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?
5
u/blaaackbear Mar 21 '21
does the machine have to running 24/7?
903
u/Godpadre Mar 21 '21
Fml
2
u/pootislordftw Seeder Mar 21 '21
Why is a port forwarding vpn desirable again? I never quiet understood that
219
u/exegg Mar 21 '21
That's a lot of work. Saving this, thank you.
44
u/aspindler Mar 21 '21
What's the advantage of using this instead of just Plex for Windows?
3
u/ReusedBoofWater Mar 21 '21
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?
70
u/Cyno01 Yarrr! Mar 21 '21
"rEaD tHe mEgAtHrEad, tHiS iS aLl iN tHe wIkI¡"
But no, +1, good guide.
15
u/canyonero__ Mar 21 '21
Thank you for this. Incredible write up!
15
u/elislider Mar 21 '21
I also highly recommend using Portainer. It makes container learning and management so much easier and faster.
6
u/custardy_cream Mar 21 '21
Wow what a write-up. Will take a look tomorrow. I'd definitely use jellyfin over Plex though
20
u/darknmy Mar 21 '21
Eli5 why do I need this?
2
u/[deleted] Mar 21 '21
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?
5
u/medo459medo Mar 21 '21
thanks, legend. saved for later
5
u/[deleted] Mar 21 '21
god tier write up. saved for future use 👍mods, can we get this pinned/added to wiki?
4
u/Sam_1803 Mar 21 '21
Thanks for sharing!
4
u/Amongwolves2125 Mar 21 '21
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.
1
u/HardlyW0rkingHard Mar 22 '21
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
u/VNGamerKrunker Mar 22 '21
Does this work in Asian countries?
1
u/beer_in_my_face Mar 22 '21
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
u/eastlake1212 Mar 22 '21
Will this automatically change file names as well?
1
u/zidaneski Mar 22 '21
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
u/Luvenis Mar 22 '21
Right now I have a desktop with windows 10 running plex natively. WHen I need to configure new stuff I'll just use teamviewer to remote into it.
But if I follow this guide would I see any power savings at all?
1
u/CombatWombat1212 Mar 22 '21
Why should I do this over making a simple Plex server on my Windows PC?
Cause honestly... You've written a LOT of words and steps here
1
u/Mark_Knight Mar 22 '21
any tldr to why this is all necessary? when i set up plex i literally just installed the server on my pc, added my media, and i was good to go. is this more for remote viewing? because i mainly just use it on my home network
1
u/kamunia Mar 22 '21
Amazing thanks! I want to build one, what specs do you recommend for a server like this?
1
u/Disposable_Fingers Mar 22 '21
Torguard is based in nuremberg, Germany is part of 15 eyes. Does that concern you at all?
1
u/MegaBNinja Mar 23 '21
So how would this work on Windows? Would you just install all of these programs on a fresh install?
1
u/redenno Leecher Mar 24 '21
what are the total expenses here? apart from the vpn?
1
u/brbee Mar 28 '21 edited Mar 28 '21
How? For instance for me it downloads everything first to my c drives download folder and copies and pastes it inside my d drive where i keep all my plex stuff. If I delete what i downloaded from my c drive it affects the space i had previously there. I even checked using windirstat and I don't have any hidden files relating to plex inside my c drive
Is there something wrong with my sonarr/radarr setup?
I delete those files from my C drive because they do nothing and take up space while my d drive holds everything to my plex server
1
u/[deleted] Apr 05 '21
I am an absolute noob at this, but how would I make it if I wanted to use his setup but keep my media on a nas?
I got a NETGEAR nas a few months ago, it is too lacking for actual streaming and PLEX but I got a few Tb worth of storage space on there.
Essentially I would download the files to the linux server, and upload them to the NAS, and use the Linux tower to serve as the media server while having mount points for the NAS, if that makes sense.
1
u/Orthodox-Waffle Apr 24 '21
So i've got this all up and running but now i have no idea how to access my transmission web interface...
Also thank you so much having the vpn is so nice, no more scary comcast emails.
1
u/[deleted] May 31 '21
Stuck at mounting drives. I have my external drive partitioned and formatted, confirmed that it is ext4, and when running sudo -a, I recieve.
And here is the result of sudo fdisk -l
9
u/[deleted] Mar 21 '21
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
3
u/[deleted] Mar 21 '21
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
u/Havoced Mar 21 '21
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
3
u/Stryf3 Mar 21 '21
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?
3
u/[deleted] Mar 21 '21
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
3
u/jfp555 Mar 21 '21
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?
3
u/[deleted] Mar 22 '21
If you guys have issues with unetbootin, use balena etcher it's better.
2
u/Jorge_Palindrome Mar 21 '21
Thanks!
2
u/aaronryder773 ☠️ ᴅᴇᴀᴅ ᴍᴇɴ ᴛᴇʟʟ ɴᴏ ᴛᴀʟᴇꜱ Mar 21 '21
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
u/Rithic Yarrr! Mar 21 '21
When the guide has a lot of things to read, I switch to becoming a visual learner.
2
u/[deleted] Mar 21 '21
Mullvad VPN also claims to support port forwarding.
2
u/maximus77899 Mar 22 '21
Hm
2
u/LexxiiConn Mar 22 '21
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.
2
u/[deleted] Mar 22 '21
Does a computer need to be on 24/7 for it to work
3
u/[deleted] Mar 21 '21
Overseerr is better than Ombi imo.
2
u/rawimageReddit Mar 21 '21
Just buy a seedbox that has the capability to work with Plex.
1
u/shnukoms Mar 21 '21
Great work! Will try it out, thanks
1
u/Tenzu9 Mar 21 '21
Great guide, thank you for this. Saved.
1
u/shogun101 Mar 21 '21
Many thanks for taking the time and putting in the effort to make this guide!
I’ll definitely give it a go... Cheers!
1
u/zemssa Mar 21 '21
Thanks a lot mate!
1
u/RealMikeHawk Mar 21 '21
This is awesome! Would love a rclone/gdrive/mergerfs implementation section as well!
1
u/redblood252 Mar 21 '21
Anyone got a helm for this ? (Kubernetes)
1
u/magicalzidane Mar 21 '21
You're the champ OP! Have my poor man's gold! 🏅
1
u/Suwanneman Mar 21 '21
God I wish I had this a year ago. Do you think a future iteration might also include instructions on Usenet / sabnzb?
1
u/ToasterDust Mar 21 '21
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
u/IJKR6PY Mar 21 '21
Really great and detailed guide, thanks for sharing. Haven't used Sonarr on my server, might take a look.
1
u/theuniverseisboring Mar 21 '21
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
u/Mr_Incredible_PhD Mar 21 '21
Fantastic job here! The only thing I'd change would be Jellyfin but other than that awesome!
1
u/rursache Piracy is bad, mkay? Mar 21 '21
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
u/GorillaWarfare_ Mar 21 '21
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
u/maximus77899 Mar 22 '21
Hm
1
u/vidoeiro Mar 22 '21
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
u/shreveportfixit Mar 22 '21
Commenting to save. Thanks!
1
u/xxxModxxx Mar 22 '21
Thanks for making this.
1
u/AWildGodAppeared Mar 22 '21
This is a beautiful guide. Should be pinned :p Definitely saved for reference if I ever go and get my own dedicated server.
1
u/LGAMER3412 🏴☠️ ʟᴀɴᴅʟᴜʙʙᴇʀ Mar 22 '21
This is gold
1
u/HerbalDreamin1 Mar 22 '21
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
u/kratoz29 Torrents Mar 22 '21
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
u/distortionwarrior Mar 22 '21
Nice! I'm going to read this later when I have time!
1
u/GSRoTu Mar 22 '21
You could also use a synology for easy install
1
u/ScipioTheBored Mar 22 '21
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
u/jspikeball123 Mar 22 '21
This seems like a lot more work than just using unraid
1
u/EaterComputer Mar 22 '21
I just used DockSTARTer and it did most of the work for me
1
u/[deleted] Mar 22 '21
Thanks for this, bookmarked for this weekend to give it a good try setting up!
1
u/[deleted] Mar 22 '21
Jellyfin android app is free and all of it is open source. I moved on from plex.
1
u/vvictormanuel Mar 22 '21
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
u/Ddog78 Mar 22 '21
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
u/yusoffb01 Mar 22 '21
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
u/PossibleAd4837 Mar 22 '21
Do I download the Ubuntu server to my USB flash drive or to the computer and can you do a video please with the steps
1
u/JBFortune Mar 22 '21
This looks like a lot of fun. Before I try it though....
I currently have Plex running on a small windows based server I have. To be honest, it works without issues. What advantages would this have over that?
Thanks
1
u/rohithkumarsp Mar 22 '21
I like your words funny man.jpg
1
u/bad_scientista Mar 22 '21
How to do it in Windows?
1
u/DrCokeMaster Mar 22 '21
Although I already have mine setup, this is an awesome informative post for newcomers. Thank you for giving back to the community
1
u/Boogertwilliams Mar 22 '21
Is it possible to enable hardware transcoding without plex pass? On their site is says: "Hardware-accelerated streaming is a premium feature and requires an active Plex Pass subscription"
Or is there a crack?
1
u/Bakerboy448 Mar 23 '21 edited Mar 23 '21
This is ... honestly the best guide I've seen.. and coming from the *Arrs, we've seen a lot of bad guides.
a few points of feedback:
/mnt/data/media:/mnt/data/mediaand/mnt/data/downloads:/mnt/data/downloadsrespectivelyOtherwise, an excellent write up; I'd also suggest linking trash's guide and the docker guide as well
you can also link the radarr quickstart guide :) https://wiki.servarr.com/Radarr_Quick_Start_Guide
we're hoping to get one built for sonarr...soon(tm)
1
u/AdityaAr11 Apr 03 '21
I for now don't understand it, but thank you so much for your effort. I'll try it later because I love doing these things.
1
u/NathanielBHart Apr 15 '21 edited Apr 15 '21
Would love an addition that adds outside access so I can use my server when travelling other than that, great review
Edit: so I figured out the trick to outside access on the same PC as your VPN. It requires a VPN capable of split tunneling which my provider (Nord) does. To make it work, set up split tunneling to allow Plex media server and any other related tasks that have to do with PMS to the whitelist and they will be allowed through so that you can continue port forwarding as usual. All other programs not allowed through will be going through the VPN so torrenting services can continue to operate.
Also can set up a kill switch to disable internet if the VPN connection drops.
1
u/3stepBreader May 02 '21
How did I just find this? Great write up! I wish you could write this off on your taxes as a charitable contribution lol.
Is there still plans to add a rpi section? I’m planning on doing this with a pi3 to Plex on my tv( lg cx) and I believe my lg cx can handle the transcoding. So I should be able to watch 4K?
Also what about kill switches on vpn’s? I got PIA, what happens if the vpn connection is lost, does it automatically stop seeding/downloading?
Thanks again.
1
u/joshpry May 24 '21
Amazing 👏🙀😮😲😯👏
1
u/[deleted] Jun 05 '21
When running the command to install docker I'm met with this error
E: Package 'docker-ce' has no installation candidateE: Unable to locate package docker-ce-cliE: Unable to locate package containerd.ioE: Couldn't find any package by glob 'containerd.io'E: Couldn't find any package by regex 'containerd.io'1
u/[deleted] Jun 11 '21
I'd love to use this guide on an old Windows PC I've been wanting to convert into a media server with torrents, but I have a question. I'm relatively new to torrenting and I've just been using Transmission on my laptop. For a vpn, I really didn't want to pay, so I just kept using the free trial of Malwarebytes every week. It takes 5 minutes to set up a disposable email to get another license key, since Malwarebytes doesn't require a credit card. Malwarebytes doesn't support OpenVPN, so does anyone know of a service that does where I can do the same thing for it? Is it even possible to update the vpn details in the docker transmission yml file every week? Great guide, thanks for the effort in helping us.
1
u/CommonSenseUsed Jun 16 '21
Could I run this in wsl2 on windows?
1
u/Dbar412 Jul 26 '21
I'm new to plex and the like. What's the benefit of doing it this way as opposed to just installing the server on windows?
1
u/CiscoQL Oct 18 '21
I feel like this would have been better done if you wrote a shell script that does all this instead of writing how to do it yourself.
1
u/[deleted] Dec 16 '21
my maaannn !!! Abit mad about the time spend but its okay because off all that time saved
1
u/AutoModerator Feb 07 '24
Yarr! ➜ u/WhereIsYourMind, things to know about "RARBG":
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.