Best way to deploy Plex Setup.

You have asked the wrong question to the right man. Strap in. I have a similar setup and have tested many different configurations extensively. My final configuration is CentOS running software raid as host then CentOS running on a Virutalbox guest. This also allows me to virtualize Untangle (amazing firewall, I can get five 1080p no buffering direct streams off 13mpbs upload by just enabling their QOS and not changing anything). I also have another CentOS running on virtualbox that has a vpn running with sonarr and a torrent client. I have also blocked all packets at the firewall for that VM that are not over the VPN or DNS lookup for the VPN server to keep any IP address or DNS leaks from being a possibility.

I ended up going with this because I actually saw better performance with CentOS + virtualbox than ESXi. I also like the way I can just log into the main server and then change anything I need to on the VMs without installing any other weird software that may introduce security vulnerabilities (though Webmin on everything is still worth it). At the end of the day ESXi is just code and I find the Linux kernel to be just as fast as a host if you leave it the hell alone and have everything running on the virtual machines. I also find it easier to change physical machines with .vdi virtual disks.

I also did not go with Windows just due to security and long term stability. Even with bitlocker, your files are not completely secure and there are about a million ways your server could possibly be accessed while running if there is a security flaw in anything you install or an intentional backdoor in something or the operating system. Open source fixes this. May not be a huge deal but if you have anything that may technically be deemed illegal like a movie that you lost the original disc to, better safe than sorry; especially if Linux runs way better anyway and is way more stable.

I tested Windows Server, Ubuntu Server, Debian, Fedora, and Linux Mint just to see how it ran on everything and CentOS was the clear winner for me. If you do some research, it is a sick distro and what you will often find in large hosting farms and such. It really excels at what Plex does a lot of: random file accessing. Every time you scroll down the library, click on the info, start playing something, skip around in the movie; these are random reads. Also thumbnail previews are huge on this. If you have 5 people doing this at one time while your disc is also busy transcoding that sick new 4k movie, CentOS generally won't skip a beat.

This is also where virtualbox is great, the way the .vdi disk works is different from a hardware level. Its hard to explain but the virtual disk can actually speed up the random read times on the files. I have my main system running on a raid 10 until SSDs are cheaper and plex running in virtualbox CentOS with a vanilla host is SSD fast. Really impressive and I didn't expect it. I just add raid 1s after that on whatever cheap drives I find for things that are not accessed often.

I use CentOS as the host but you could use anything you want, any mainstream Linux will be good but CentOS is also the most secure in my opinion just by a little bit and I know its rock solid. Once I get something setup in it, I have never had to go back and fix things. Unraid is generally really good but does not offer full disk encryption afaik and it is really not meant to be ran virtualized. You could also use Ubuntu as your host/guest but it is really worth it to try CentOS imo. It is based off the commercial releases of RedHat so the commands for Debian/Ubuntu are slightly different but you can just look up the Fedora command and you will find anything you need. When I was trying to pick an OS to stick to, I tried Fedora because its what Linus Torvalds runs and have fallen in love with it for desktop and by extension CentOS for servers.

I keep all the media files on the host so I can easily add more hard drives and move files around however I want then use shared folder in virtualbox. This is technically over smb but I haven't had a problem with speed or access times at all and it is more secure than a typical smb setup. All of the security stuff may not matter to you but if a friend shares their plex login with someone else, you never know. If someone, say law enforcement, got ahold of the login and wanted to do something about it for whatever reason, they would have your IP address as soon as they login and your house address pretty quick. If some crackdown happened to Plex where law enforcement lawfully forced Plex to give control of their server over, they would have access to everyone's IP and complete library list as long as the servers are kept online. If Plex can see it from plex.tv then they can see it, thats just how that works, not that they store it or view this information other than to improve Plex. I also have no control over whats going down at Plex HQ in 10 years or whatever. Again this is all very unlikely but possible and more reason to keep up with security. You can also run your Plex server through a VPN but I don't do this because of the data overhead caused by encryption but I'm sure I will down the road. It at least helps me sleep better at night knowing all the code on my server has been looked over by a community of people like me and doesn't have a NSA backdoor that could easily exist in Microsoft's closed source code or more commonly a backdoor that was used while any crappy piece of windows software was in development to skip around in the program that they forgot to close up after that was found by your friendly neighborhood malicious hacker.

Anyway, have a hard drive die? No problem, hot swap one in, log into Webmin, and start rebuilding the array. Want to change your server hardware? No problem, move the .vdi for plex and your downloading VM to the fresh CentOS with virtualbox installed, export the machine settings if you want to (I just redo it real quick) and your done.

If you are going to try this, a couple tips: when setting up the CentOS host, use the LVM to create the partitions. It will allow you to select the hard drives you want the partition to expand across and then select the device type as raid and then raid your level. You need a boot, swap, and root or just "/" partition to operate. The boot partition will need to be like 200mb or so and unencrypted. In theory it should be fine having it unencrypted on any drive but it has screwed me a few times. Best solution I found is to have two flash drives plugged in and in the LVM partitioning, you can select both flash drives, boot partition, then raid 1. Boom, one dies and you can even hot swap the boot partition for the cost of any two flash drives you have lying around. By default, the boot loader will only install to one drive, even if you are running raid 10 like me so that one drive with the bootloader finally dies and you won't be having a fun day trying to get it to work again. I recommend encrypting the swap and it is the same thing as a windows swap file but will be encrypted even if you hard powered off the server and tried to index the files. Then create a "/" root partition for everything else leaving the size blank and it will fill in whats left.

Set it up perfectly once in a virtualbox Linux machine and you will never have to screw with it again. Not messing with Plex is the nice thing about Plex right? Best of luck from your local systems engineer, hiding in your drop ceiling, sniffing your packets, I know your deepest secrets and I keep them safe and secure in a 256-bit Luks encrypted linux :)

/r/PleX Thread