How To: Run Plex Media Server as a Windows Service – OLD

I’ve written a new post with a new simpler method for setting up Plex Media Server as a service.  Click here for the updated post.

I recently began using Plex as a media service for my own local media. I like it because it allows you to stream your media anywhere that you can run the Plex app which is support on many different platforms including (but not limited to) Windows, Mac, Linux, Android and iOS. It also allows you to share your media library with others. All for free. There is a paid version that offers some advanced features, but the free version works swell.

I originally set the Plex Media Server up on my actual server where I also store all of my media. The downside to running this on my server is that Plex only starts and runs when the user that installed it is signed on. This means when I log off of my server, or when it reboots for any reason, the Plex service is no longer running until I log in again. This is a problem when trying to stream remotely, especially when others that don’t have access to my server as I do are trying to access my media. So I began looking for a way to run Plex as a service. This post is a how-to guide on how to do just that. This how-to begins assumes that you already have Plex up and running and will only instruct on how to setup Plex to run as service. You can get information on how to do that directly on Plex’s website, but it is relatively easy.

Before you continue, please take note of the following:

  • When you run the Plex Media Server as a service, you will not have a system tray icon indicating that Plex is running. You will only see Plex Media Server.exe in task manager. You will need to stop the service and launch the program normally to get the system tray icon.
  • You must have a password on your windows user account for the service to succesfully start as your own user account. You must run the service as your user account so that the Plex Media Server will work with your user profile’s data that you already have setup.
  • If you ever change your windows account password, you must update the service entry to use your new password, otherwise the service will fail to start.
  • If you are using a 32-bit OS, you will need to change “Program Files (x86)” to “Program Files” anywhere it is used in my steps below.

1. First, you need to download SrvStart. Click here to download a zip file containing what you will need. Once you have the zip file downloaded, you’ll need to open the zip file and extract srvstart.exe, srvstart.dll and logger.dll to C:\windows

2. Second, open notepad on your PC and copy and paste the following:

[PlexMediaServer]
startup=”C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe”
shutdown_method=winmessage

Now save the notepad file to your desktop as “SrvStart.ini”. Include the quotes so that notepad doesn’t append .txt to the end. The quotes will not be saved.

Now you need to move the new SrvStart.ini from your desktop to the root of C:\

3. Now, open up command prompt as administrator. Copy and paste the following into the command prompt window and press enter:

SC CREATE “Plex Media Server” DisplayName= “Plex Media Server” binPath= “srvstart.exe PlexMediaServer -c C:\SrvStart.ini” start= auto

4. At this point, you will have a service entry in your services list called “Plex Media Server” that can be start and stopped. By default, this service will run as the local SYSTEM account. We need to have this running as your local user account. I’m not 100% sure, but I’m pretty sure that you will need to have a password on your account to allow the service to start succesfully. If you do not have a password, go ahead and set one now. Also, keep in mind if you ever change your windows account password, you will have to follow these next steps again to update your logon password for the service. Also, before starting the service, be sure that you have exited the Plex Media Service so that it is no longer running on your PC.
4a. In the command prompt, type services.msc and press enter.
4b. Locate the Plex Media Server service and double click on it to open its properties window.
4c. Click on the Logon tab.
4d. Select the “This account” radio button.
4e. Enter your Windows username and password and click on Apply.
4f. Assuming you entered your username and password correctly, you will most likely receive a prompt that your account has been granted the logon as a service permission. This means that the service has been configured properly and your account is now allowed to run services.
4g. Go back to the General tab and ensure that the startup type is set to Automatic.
4h. Click on the Start button. If you do not receive any errors and the service now shows as started you have been succesful. To verify, open up Task Manager and look in the Processes or Details tab. You should see “Plex Media Server.exe” and “PlexDlnaServer.exe” running and your username should be listed in the Username column.

5. You will want to disable Plex from starting up on logon. In Windows 8, open task manager and go to the startup tab. Right click on Plex Media Server and select Disable. In older versions of Windows, use msconfig.exe and go to the Startup tab. Uncheck the Plex Media Server entry. This will keep Plex from trying to launch a second instance after the service has already started.

Now Plex will run as soon as your PC boots without having to log onto the computer exactly how a server service should operate.

17 thoughts on “How To: Run Plex Media Server as a Windows Service – OLD

  1. Thanks! Everything made sense and worked well, except the DLNA Server isn’t running. It doesn’t show up in services.msc. Is there a way to fix that? Any assistance would be appreciated.

  2. .ini startup path to use if your on 32 bit Windows:

    startup=”C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe”

  3. Im getting the below errors in a command prompt as well as thru the service. Im also running x64bit. May i trouble you for help ?

    Microsoft Windows [Version 6.1.7600]3
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\>srvstart.exe PlexMediaServer -c C:\SrvStart.ini
    SRVSTART: 2015/09/12 11:55:57 ERROR severity=0 thread=3292 source=D:\Home\Author\srvstart.v110\dll\ScmConnector.cpp line
    =556 text=failed to connect to SCM for service PlexMediaServer, error=1063
    SRVSTART: 2015/09/12 11:55:58 ERROR severity=0 thread=4940 source=D:\Home\Author\srvstart.v110\dll\CmdRunner.cpp line=29
    4 text=CmdRunner::CmdRunner(): unexpected SCM status 6
    SRVSTART: 2015/09/12 11:55:58 ERROR severity=0 thread=4940 source=D:\Home\Author\srvstart.v110\dll\CmdRunner.cpp line=29
    6 text=Exception 7 in Class ‘CmdRunner’ method ‘CmdRunner()’
    SRVSTART: 2015/09/12 11:55:58 ERROR severity=0 thread=4940 source=D:\Home\Author\srvstart.v110\exe\exe.cpp line=334 text
    =Exception 7 trapped in source file ‘D:\Home\Author\srvstart.v110\dll\CmdRunner.cpp’ line 296
    SRVSTART: 2015/09/12 11:55:58 ERROR severity=0 thread=4940 source=D:\Home\Author\srvstart.v110\exe\exe.cpp line=335 text
    =Class ‘CmdRunner’ method ‘CmdRunner’
    SRVSTART: 2015/09/12 11:55:58 ERROR severity=0 thread=4940 source=D:\Home\Author\srvstart.v110\exe\exe.cpp line=336 text
    =An internal error has occurred.
    SRVSTART: 2015/09/12 11:55:58 ERROR severity=0 thread=4940 source=D:\Home\Author\srvstart.v110\exe\exe.cpp line=449 text
    =SRVSTART is terminating with a FAILURE status
    ERROR: Exception 7 trapped in source file ‘D:\Home\Author\srvstart.v110\dll\CmdRunner.cpp’ line 296
    ERROR: Class ‘CmdRunner’ method ‘CmdRunner’
    An internal error has occurred.

    C:\>

  4. I’m getting “Error 2: The system cannot find the file specified.”. Have tried this twice, following the steps exactly.. Same outcome. Paths are 100% correct… Any ideas? I’m trying to run this as a service alongside plexconnect service so the system doesn’t need to be logged on at all.

  5. First, good write up.
    I followed the instructions to the letter. Accounts setup correctly. Running on Server 2012. Getting a 1067 error, process terminated unexpectedly when attempting to start the service. Anyone else get this error?

  6. Here’s an alternative to the service method to achieve the same goal:

    Instead of a service, have PMS start via the Task Scheduler at Windows start-up.

    You won’t need to download a 3rd party tool, you run the same application as it is intended to run and you can access the PMS via http://127.0.0.1:32400/web/index.html if you haven’t changed the port.

    Works great for me

    1. The only downside to this is not being able to set the task to restart if it stops for any reason with the automatic restart capability of services. Otherwise, this solution should work just fine. I’ve used task manager to run things like Dropbox at startup on a system that doesn’t actual have a logged in user typically.

  7. One thing to pay attention to, when copying the text from this post its possible for it not to work.
    the “” symbols are different then normal ones, so if you’re getting weird errors like it cannot find the file specified then remove the ” symbols and type them yourself.

  8. C:\Windows>sc create “PlexMediaServer” DisplayName= “PlexMediaServer” binPath= ”
    C:\windows\srvstart.exe PlexMediaServer -c c:\SrvStart.ini” start= auto

    The OP didn’t match the Service name with the display name with the binpath info…. you’re welcome!!

Leave a Reply