The Plex Media Server setup requires you to link your new server to your plex.tv account. This is done by initially accessing your server from "the same network" [1]. This can be a little "complicated" on a remote headless server if you have never heard of an "ssh tunnel" before.
The script in this git repo just uses the same mechanics that are used by the official Plex Docker image [2]. In fact, the script is just a refactored version of the Docker script.
- This guide assumes you're running Plex on a Synology NAS (otherwise, go to the original version of this script — this fork is just specifically for this case)
- This guide also assumes you can SSH into your Synology NAS, and perform
root
commands.
NOTE: This version of this repository has been specifically updated for Synology NAS running Plex in DSM 7.x. See the differences in the script here
- Make a backup of your
Preferences.xml
if you already have an existing setup. This is available at/volume1/PlexMediaServer/AppData/Plex Media Server/Preferences.xml
- Remove the
Preferences.xml
file for a fresh start. Doing this will NOT remove your Plex libraries, settings or any content. If it ever fails, that's what the backup is for. - Make the script executable:
chmod +x plex-claim-server.sh
- Get your Plex Claim Code (it's only valid some minutes): https://www.plex.tv/claim/
- Claim your server:
sudo ./plex-claim-server.sh "$YOUR_CLAIM_CODE"
- Restart your Plex Media Server, e.g., go to Package Center, locate Plex Media Server, Stop then Start.
Sidenote: I wasn't able to verify if it mattered, but also do a chmod 777 "/volume1/PlexMediaServer/AppData/Plex Media Server/Preferences.xml"
because the permissions were 700 when it was generated by this script.
Set the environment variable PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR
to tell the script about your non-default Plex setup.
[1] https://support.plex.tv/articles/200288586-installation/#toc-2