How to Run Plex as a Windows Service

My Plex server is currently running on a Windows 10 workstation that I keep under my desk. I run the machine headless, which means there is no monitor attached to it, and I also don't have a user logged into the machine unless I need to perform some maintenance.

The server updates and reboots automatically, and after each update, Plex Media Server automatically restarts so Plex is available as long as the system is running.

How to Run Plex Media Server as a Windows Service

After installing Plex on Windows, Plex is launched as a process by the user that installed Plex. The issue with this is that the user will need to log in for Plex to run.

To accomplish what I have described above requires Plex to run as a service in Windows. By default, Plex only runs when the user that installed Plex is logged into the machine, so I had to change this functionality in order to have Plex run as a server.

If you would like to run Plex Media Server as a service on a Windows machine, you will need to do two things:

  1. Stop Plex from running when a user is logged into the machine. I suggest you create a standard user account for Plex and then move the Plex data to that account.
  2. Install the PMS Service application to enable Plex to run as a service.

The first point is to delete any registry key for the user account associated with Plex on your system. The page explains where to find and delete the registry key. The second part of that point means you should create a user account on the system that isn't an administrator account. This is the account that will run the Plex service and will contain all the settings for Plex.

The second point involves installing a third-party, open-source, service manager specifically designed for Plex. The next section will discuss how to install and set up the service on Windows.

Setting up the Plex service

To setup Plex to run as a service, use the following steps:

  1. Download the latest release of PmsService, which is the MSI file.
  2. Double-click the downloaded MSI file to begin the installation.
  3. Click the Next button on the first window to continue the installation.
    The PmsService installation start window
    PmsService installation start window
  4. The next window requires you to enter the user account and password for the user that will be running the service. If you will be using a standard user account (highly recommended) enter the user ID and password in the text boxes provided. When done, click the Test Credentials button to ensure everything was entered correctly. When completed, click the Next button to continue.
    The PmsService installation user credentials window
    PmsService installation user credentials window
  5. The next window is the final one. Click the Install button to install the PMSService application. Enter the administrative credentials if you are prompted to do so.
    The PmsService installation beginning installation window
    PmsService installation beginning installation window
  6. Once the installation is completed, click the Finish button on the final window to close the installation wizard.
    The PmsService installation finished window
    PmsService installation finished window

At this point the Plex service is running in the background with the user account you specified during the installation. You can validate that it is running by viewing the Windows services and scrolling through the list until you find the PlexService service.

If you need to access the Plex data directory, such as to back up your Plex server, you would first need to log in as the user that is running Plex and then copy the data directory or schedule a job to make automatic backups.

Previously, I wasn't able to use the GPU for transcoding when Plex was running as a service. I recently discovered that my Plex instance was able to use hardware transcoding (a Plex Pass benefit). My server is a Windows 10 machine, so the ability of a service to use the GPU may have been changed in a recent Windows update.

Using remote desktop, however, can prevent your Plex Windows server from using hardware transcoding. If you encounter this issue, there are some group policy settings you can change to allow hardware transcoding to work while using remote desktop in Windows.

If you find that your server isn't able to do hardware transcoding then a solution to this problem is to have your Plex server avoid transcoding entirely and direct play all movies instead.

Now that everything is set up properly, you no longer need to log into your Plex server to have Plex launched as it will automatically launch once Windows is loaded.

Updating Plex Media Server when running as a service

One issue when running Plex Media Server as a service is that it cannot be updated using the Web application without first stopping the service. Basically, the following steps would need to be performed to update Plex:

  1. Stopping the PlexService service.
  2. Run the Plex Media Server update.
  3. Restart the PlexService service.

There is a much easier way that can automate the Plex update process when Plex is running as a Windows service. You can follow the guide here: Updating Plex When Plex is Running as a Windows Service.

Subscribe
Display