PMS as a service
This post will always contain the latest version of the Plex service wrapper.
This is not official or affiliated with Plex in any way and was originally made for personal use. Treat it as such and please don't bug the Plex devs about it. (bug them about Plex not running as a service natively by all means :P) feel free to post your questions here and I will do my best to help.
If you are having problems, the first question will be whether it runs ok when not being run as a service. Please ensure you can get Plex up and running fine on it's own.
Please read all of this post, there is lots of information covering the most common problems (Mapped drives, different user accounts etc)
The service application was created to enable Plex Media Server to operate as a service in windows.
It has been reported to work on the following OS's and requires .net framework 4 is installed:
- Windows Server 2003
- Windows Home Server V1
- Windows Server 2008 R2
- Windows Home Server 2011
- Windows Server 2012 R2
- Windows Server 2012 Essentials
- Windows XP
- Windows 7
- Windows 8
- Windows 8.1
- Windows 10
Latest version is 1.1.5. It is open source and up on the github if you want to build it yourself: https://github.com/cjmurph/PmsService
There is a built copy available under releases on the github here: https://github.com/cjmurph/PmsService/releases
To update Plex Media Server:
1. Stop the plex using the service task bar application
2. Run the plex installer to do the upgrade as usual.
3. When the installer is complete, start Plex using the service task bar application.
[WARNING] Read below if you intend to change the service account
If you change the service account type or the service user account from your current configuration, your application data (and therefore your library) will not be available when you start Plex.
If you want to run the service under a different account, Then you should first move your Plex application data folder to a common folder (Personally I have mine on a second drive of my server "D:\Plex").
If the application data is left under the previous account's folder, then the new account will not have permission to get to it.
Once you have the application data in a common place, after starting Plex with the new credentials, go to the web interface -> server settings -> general -> show advanced -> "The path where local application data is stored" and change this to the location you just moved your Plex application data to. Restart Plex and you should be good to go.
When asked for your credentials during install make sure you fully qualify the user name.
If you are on a domain, the username is entered as domain\username.
If you aren't on a domain, the domain is the computer itself so replace the domain name with the computer name eg. (mycomputersname\username OR .\username).
The install includes a tray application to start and stop Plex, view logs for the service and open the Plex web manager.
There is a large amount of extra information in this thread https://forums.plex.tv/topic/23711-running-pms-as-a-service-in-whs which is where this application was born from.
When Plex runs as a service, there is no user session created. Plex will run in a non-interactive session (session 0). This means that any drive mappings you have created will not be available.
If your media is located on a network device, Plex sections must be set up to look at a UNC path NOT a mapped drive.
Mapped drives -- EXPERIMENTAL
From version 1.1.3 this service supports user defined drive mappings. Configure the map in settings and it will be made available before PMS is started.
You should ensure the user account the service is run under has access to the network share.
This is experimental at the moment. if you have issues, please review your logs and report back here.
Applications you want to have running with Plex. An example is Plexconnect, the python script for using plex with an apple TV.
I've added this after a request from a user to wrap Plexconnect the same way I did Plex, I figured it would work OK in the same service. I don't use Plexconnect personally but I tested this new system with several other applications and they all ran up fine.
To add an auxiliary application, using the task bar icon, go to settings, you will get a new window. click the add button to add a new application, and the remove button to remove the currently selected one.
Name is a user friendly name for the application, file is the file to execute and arguments is any command line arguments you want to add. If you specify a URL, a menu item will be made available directly from the tray application to navigate to that address.
Save the settings and the next time the service is started the application you specified will start too. Check the logs (again through the task bar icon) to see how you got on.
I would suggest making sure that the application runs as expected in a normal user session BEFORE attempting to run it as an auxiliary application.
If you are installing Plex for the first time, I'd still recommend moving the application data folder, the user folder isn't the best spot.
If you like the software, buy me a beer