Proxmox | Plex as a VM
A fresh Plex install on Proxmox Ubuntu VM and migrating my existing settings and data.
I started by creating a new Ubuntu VM in Proxmox for the Plex to be installed.
Creating a new Ubuntu VM
Once you have Ubuntu installed according to your liking proceed to install Plex.
Install Plex
SSH to my new Ubuntu VM installation to get to the terminal.
From the Plex downloads page finding the correct download link and copying that
# In the Plex server terminal run wget and paste the download link
wget https://downloads.plex.tv/plex-media-server-new/1.26.2.5797-5bd057d2b/debian/plexmediaserver_1.26.2.5797-5bd057d2b_amd64.deb
# once the package is downloaded, install the deb package
sudo dpkg -i plexmediaserver_1.26.2.5797-5bd057d2b_amd64.deb
# check the status
systemctl status plexmediaserver
# press q to go back to terminal
# if it is not running, start it with
sudo systemctl start plexmediaserver
Enable Plex repository updates
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
if you need to install curl run these commands (1) update Ubuntu, (2) install curl, (3) verify the install, rerun the curl command above.
sudo apt update && sudo apt upgrade
sudo apt install curl
curl --version
Update Plex and Ubuntu
Run this command to update Ubuntu and Plex Server when needed
sudo apt update && sudo apt upgrade -y
Go to Plex
Test that the install works by opening the browser https://<your-ip>:32400/web
Mounting Shares
If your media is on network shares, like mine is on an NFS share, you want to mount that share or shares.
NFS shares
# first create directories for the mount(s)
sudo mkdir -p /<your-path>/nfs/media
# Optiona: install nfs if you do not have it yet
sudo apt update
sudo apt install nfs-common
# mount the share
sudo mount <your-share-ip>:/<share-path> /<your-path>/nfs/media
You also need to add the shares to fstab to mount the shares at boot.
# edit fstab
sudo nano /etc/fstab
# add to the bottom of the file
<your-share-ip>:/<share-path> /<your-path>/nfs/media nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
# press CTRL + x to save and close
Now if you reboot the share(s) should be mounted automatically on boot.
For some reason I experienced problems with unRAID NFS shares in Plex, so I mounted those using SMB/CIFS.
SMB/CIFS Shares
If you have SMB/CIFS shares
# first create directories for the mount(s)
sudo mkdir -p /<your-path>/smb/media
# Optional: install cifs-tools if you do not have it yet
sudp apt update
sudo apt install cifs-utils
# mount the share | I used <user> = guest
sudo mount -t cifs -o username=<user> //<your-share-ip>/<share-path> /<your-path>/smb/media
Edit fstab to mount the share(s) at boot
# edit fstab
sudo nano /etc/fstab
# add to the bottom of the file
//<your-share-ip>/<share-path> /<your-path>/smb/media cifs <user>,uid=1000,iocharset=utf8 0 0
# press CTRL + x to save and close
Now if you reboot the share(s) should be mounted automatically on boot.
Add library to Plex
To add the share(s) to Plex, you need to create a library and add the share, in that library as a folder. I have all my family photos and videos in two libraries, while the photo library is capable of playing the videos in most cases, it's sometimes easier to watch the videos separately.
And wait while the library scans the folder for files
Migrating from existing Ubuntu installation
If you have an existing installation you may want to migrate it. I have my previous installation also on an Ubuntu VM, and I wanted to migrate all of the old configurations.
This guide works when migrating from Ubuntu to Ubuntu.
Delete the new Plex Library
Prepare the metadata directory by deleting the contents of the Library, I will copy over the old Library.
sudo rm -rf /var/lib/plexmediaserver/Library
Stop Plex service
sudo systemctl stop plexmediaserver
# check status if you wish
systemctl status plexmediaserver
Rsync files from old Plex
Stay in the new install terminal and run rsync (with your root user)
sudo rsync -azvh <your-root-user>@<old server ip address>:/var/lib/plexmediaserver/ /var/lib/plexmediaserver/
Depending on the library size this may take a while ..
When the sync is complete, change the owner of the plexmediaserver directory to plex (this is required).
sudo chown -R plex:plex /var/lib/plexmediaserver/
Reboot the server
And open in your browser https://<your-ip>:32400/web
P.S. I really love the new Plex Pass Discover feature, allowing you to create a global watchlist and showing what on your list is available, and on which subscription services.