Running Plex Media Server as a 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.

The PmsService installation start window

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 contains all the settings for Plex.

The second point involves installing a third-party, opensource, service manager specifically designed for Plex. The next section will discuss how to install and setup 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
  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
  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 begin 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

At this point the Plex service is running in the background with the user account you specified during the install. 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 backup 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.

One thing to keep in mind is that when running Plex as a service, you won't be able to use the GPU for transcoding movie files. The reason is that Windows runs services in session 0, which can't access the GPU. A solution to this problem is to have your Plex server avoid transcoding entirely and direct play all movies instead.

Now that everything is setup 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.