In this guide I’ll take you along how I setup my Plex Media Server on Proxmox VE. If you want to follow along make sure you already have a Proxmox node up and running for hosting the Plex Media Server. And a separate storage device (in my case a Synology) that supports NFS, that hosts your media files.
1: Installing the Plex LXC#
Thanks to an amazing community the installation of a Plex LXC is pretty straightforward. For the installation we can use the helper script found on the Proxmox VE Helper-Scripts website. Running their script will create a ready to use server with Plex Media Server already installed. And, if your Proxmox node hardware supports it, hardware acceleration already enabled. So, let’s go on ahead.
Go to your Proxmox webinterface and open the Shell on the node on which you want to install the Plex LXC. Paste the following code and press Enter.
bash -c "$(wget -qLO - https://github.com/community-scripts/ProxmoxVE/raw/main/ct/plex.sh)"
A wizard will start guiding you through the setup proces. It’s ok to go with the defaults, as this will create a LXC with 2GB RAM, 8GB storage and 2vCPU. But, depending on how big your personal media library is, it’s recommended to go for an advanced installation. This way, we can adjust those (and other) values to better match our needs. For disksize, do mind that this is without the actual media files as they are stored elsewhere. But, when using features like thumbnail and videopreviews in Plex, the metadata and cache can grow quite large. So, for my environment I made the following choices:
- Settings: Advanced Settings
- Distribution: Ubuntu
- Ubuntu Version: 22.04 Jammy
- Container Type: Unprivileged
- Password: (Create a password as this is needed for ssh access)
- Container ID: 110 (Your own preference or leave default)
- Hostname: plex
- Disk Size: 20GB (The default is 8GB, change depending on your needs)
- Allocate CPU Cores: 2
- Allocate RAM in MiB: 2024
- Bridge: vmbr0
- IP Address: 192.168.##.###/24 (Go for either DHCP or fixed)
- Set APT-Cacher IP: (Leave blank)
- Disable IPv6: Yes
- Set Interface MTU Size: (Leave blank)
- DNS Search Domain: (Leave blank)
- DNS Server IP: (Leave blank)
- MAC Address: (Leave blank)
- VLAN: (Leave blank)
- Advanced Tags: (Accept the defauls)
- SSH Access: Yes
- SSH Key: (Leave blank)
- Verbose Mode: No
With that done, it only leaves a final Yes to complete the wizard and within a few minutes you should see the following lines appear on the Shell:
🚀 Plex setup has been successfully initialized!
💡 Access it using the following URL:
🌐 http://192.168.##.###:32400/web
And with that we have a running Plex LXC.
2: Adding media through NFS#
Next up we need to make our media files available to Plex. As we’ve chosen an Unprivileged container this somewhat makes it a bit cumbersome. If you want to know the reasons for going with this container type, I would recommend reading the writeup on Linux Containers. In short, it makes for far better security, but it comes with the downside that mounting CIFS or NFS volumes within the LXC become a bit of work, as it isn’t really supported.
There are a number of ways to still make it work, so do search around the interwebs if the following method doesn’t do it for you. Because this one, also has a slight downside. But more about that later.
As I’m going for a setup with NFS, we first need to make sure that the Plex LXC can access that NFS share. Personally I’m using a Synology NAS to store all my media files. When using another storage medium the settings might be different. But the following worked for me. In short, make sure that you have an active NFS rule on the folder that you want to share with the following settings:
- Hostname or IP: 192.168.##.## (Use the IP of your Proxmox node, not the Plex LXC!)
- Privilege: Read/Write
- Squash: Map all users to admin
- Security: sys
- Enable asynchronous: Selected
- Allow users to access mounted subfolders: Selected
With that set, we can add the NFS share to our Proxmox environment. So, within the Proxmox webui go to Datacenter -> Storage and choose Add -> NFS. Fill in all the required fields:
- ID: synology-plex (The name for your mount point)
- Server: 192.168.##.### (This is the IP Address of your storage device)
- Export: /volume/Media (If everything was configured correctly, you should be able to select the share using a dropdown menu)
- Content: Disk image
Leave all the other settings default.
So, with everything filled in, click Add. And this should create a mount point called /mnt/pve/synology-plex if you used the same ID. The only thing left now is to make it available to our Plex LXC. So head back to the Shell of the Proxmox node the Plex LXC is running on, as we’re going to edit its configuration file. So type the following to open the configuration file in Nano. Replace 110 if you went with a different Container ID when you created the LXC in the first step.
cd /etc/pve/lxc
nano 110.conf
Add the following line below the memory line. Change the name of the mount point if you used something different.
mp0: /mnt/pve/synology-plex,mp=/mnt/synology-plex
Your configuration file should now look somewhat like the following:
arch: amd64
cores: 2
dev0: /dev/dri/card1,gid=44
dev1: /dev/dri/renderD128,gid=104
features: keyctl=1,nesting=1
hostname: plex
memory: 2048
mp0: /mnt/pve/synology-plex,mp=/mnt/synology-plex
net0: name=eth0,bridge=vmbr0,gw=192.168.##.###,hwaddr=AB:12:34:56:78:90,ip=192.168.##.###/24,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-110-disk-0,size=20G
swap: 512
tags: community-script;media
unprivileged: 1
Save the file with CTRL + O and exit Nano with CRTL + X. And all that is left is rebooting the Plex LXC. When it’s done rebooting head over to the wizard to setup Plex on http://192.168.##.###:32400/web. You should now see a folder called synology-plex or your chosen mount point name when browsing. Add it and start indexing.
Happy Plex’ing!