How to run Plex Media Server as a Windows Service

I previously wrote a blog about setting up Plex Media Server as a service in Windows. However, since then I have come across a new 3rd party service manager that is, in my opinion, easier to setup and use.

[See bottom of post for an update]

You first need to download the NSSM (Non-Sucking Service Manager) exe from here. The file will be a zip file.  Extract this zip file to a folder on your desktop.

Inside the extracted folder, you will see a win32 and win64 folder. If you are using Windows 32-bit then you want the nssm.exe file from the win32 folder. If you are using Windows 64-bit, you will need the nssm.exe file from the win64 folder. Copy the correct nssm.exe file for your Windows OS to C:\Windows\system32

Now, run a command prompt as Administrator. The easiest way to do this is click on start and type cmd. When you see Command Prompt appear in the search results, press CTRL + SHIFT + ENTER or right click on Command Prompt and select “Run as Administrator”.

Inside of the Administrator Command Prompt, eneter the command: nssm install

This will launch the NSSM Service Installer.  You now simply need to fill out the needed fields as follows:

  1. On the Application tab, enter:
    • For Windows 32-bit:
      • Path: C:\Program Files\Plex\Plex Media Server\Plex Media Server.exe
      • Startup Directory: C:\Program Files\Plex\Plex Media Server
    • For Windows 64-bit:
      • Path: C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe
      • Startup Directory: C:\Program Files (x86)\Plex\Plex Media Server
  2. On the Details tab, enter:
    • Display Name: Plex Media Server (or whatever you would like the service to display as)
    • Startup Type: Automatic
  3. On the Logon tab, enter:
    • Choose “This account” radio button.
    • Enter the username under which Plex should run. If you are in a domain, enter your username as: DOMAIN\Username. If you are on a standalone workstation (most likely) then enter your username as: .\Username.
    • Enter your password.
  4. In the Service Name box, enter the desired service name.  I used “PMS” for a short name with the long name as the display name.
  5. Click on Install Service.
  6. If you don’t get any errors, then you should now be able to star the Plex Media Server like a normal service.

Be sure that you have disabled the Plex Media Server startup entry so that you don’t end up with two PMS instances when you log onto the PC.  Keep in mind that when an application is run as a service like this, there will be no interaction with the user desktop.  This means, if you want to install updates, you will have to stop the service and run the applicaiton manually to receive the update prompt.  Alternatively, you can stop the service and manually download the latest setup file and run it to upgrade Plex.

If you receive a login error or Access Denied when trying to start the service, then post a comment on here and I’ll provide additional instruction.

 

UPDATE:

The above method still works just fine, even in Windows 10.  However, I ended up switching to the method described here: https://forums.plex.tv/discussion/93994/pms-as-a-service using the Plex service wrapper.  In addition, I also setup a Plex auto-update service as described here: http://technicallyeasy.net/update-plex-automatically-running-plex-service/

I’m not going to provide another tutorial for these setups since they are outlined pretty well on the respective links.

Hopefully one of these methods will work for you.  Good luck!

28 thoughts on “How to run Plex Media Server as a Windows Service

  1. Thank you for the excellent blog post! This saved me $50 from buying another service helper. I wasn’t even aware of NSSM. Followed your steps and now Plex runs great as a service.

    1. Great! I accidentally ran across nssm while trying to get Deluge torrent manager daemon running as a service. I’m glad this worked for you as well.

  2. Hi- thanks for this post. I followed your directions to install Plex as a service, but I’m unable to start the service and get an error that says “Windows could not start the Plex Media Server on local computer” and then directs me to the system log which I know nothing about. Anything you could help with?

  3. Hi!
    i am under Windows 10 64-bits.
    When running Plex Media Server, it shows 32-bits.

    I unchecked the PMS “Launch at startup”
    At first, I installed nssm 64-bits and installed the PMS as a service successfully.
    On my devices, I can see my PMS and my library.
    PROBLEM: When I click play to a song, it stays at 0:00 and never play.

    I uninstalled nssm 64-bits to try install nssm 32-bits, since my PMS seems to run as 32-bits, even though it is in the Program files (x86) folder.
    Same problem.

    If i kill the PMS process and start the PMS manually, I can click on play and everything works fine.

    But I want to run PMS as a service to make it running even if I am not logged in the computer.

    Any idea what could be the problem?

    Thanks

    1. There is most likely a permission issue happening here. When running as a service it may be running in a different context than your user account or something. Did you set the username and password to run the service as to your username and password for Windows? Do videos play and it’s just music that is having the issue? I actually found a new easier way to run an app as a service a d will post directions soon.

      1. Both are not playing (Video and music).

        I set the username and password to run the service.. actually, there is only one username and password for my computer. Any idea?

        What is the easier way you found?

        Thanks alot.

        Karl

  4. You may want to use the command line argument `-noninteractive`with the Plexmediaserver.exe to suppress errors in the log files about not being able to communicate with the tray bar applet.

  5. Thanks for the post. However now plex doesn’t see my media files. I’m assuming it has to do with my media is on a NAS that is a mapped drive. do you know how to fix this before I spend a bunch of time trying to figure it out?

    1. Mapped drives are available only to the user that they are mapped for. Services by default will usually run as the SYSTEM account which has no access to Network resources or mapped drives for other users. Be sure you set the user account to run the service as. I also personally use the full UNC path (ie. \\SERVER\Share) versus mapped drives. It doesn’t hurt one way or the other, but it seems there are more points of failure with mapped drives such as the mapped drive getting disconnected and not reconnecting or Windows refusing to remap and giving the error of multiple connections not allowed. Also, the UNC path is always available (assuming permissions allow access and the network devicetis available) .

    2. As I was typing a reply to someone else it occurred to me that you will want to use the full UNC path when using Plex as a service. Mapped drives only get mapped when you log into the PC. Therefore, if the service starts and your account is not logged in, the mapped drives will not be present and Plex will not be able to access your files. Use \\SeverName\Path for each of your libraries instead of the mapped drive. Also be sure that plex is running as your user account. You can verify by looking in Task Manager. PlexMediaServer.exe should be listed as running as your username.

  6. Use the PMS Service, it’s free and open source on GitHub. Nssm is generic solution and it’s really great, I use it too for other applications, but where there is a specific solution like PMS Service I prefer the last one.

  7. I followed everything step by step and I am able to get Plex to run as a service, however all my media then become unavailable. All of my media is on a NAS while my Plex server is on a IntelNuc with the NAS as mapped drives.

    Any suggestions?

    1. Make sure the service is set to run as your Windows user account. I also typically recommend using the full UNC path instead of mapped drives.

    2. As I was typing my previous comment I realized that when running as a service you actually will want to use the full UNC path for your library paths. Mapped drives don’t exist outside of your logged on user profile. Since the purpose of running Plex as a service is to be able to have it run without logging in first, mapped drives will not exist when Plex starts without logging into Windows. Also, be sure you have set your service to run as your user account, otherwise the application will run in a different user context and may not have permissions to access the NAS.

  8. Excellent article, and seems to be working like a charm. I’m not entirely sure why Plex doesn’t natively run as a service to begin with.

    Many thanks!

  9. on windows 10 64bit, i get the error “Couldnt set startup parameters for the service! Deleting the service…” I do have the 64 bit version installed.

  10. I found that the easiest and built-in way is to use task scheduler. Point it to trigger “Plex Media Server.exe” in the plex program folder at computer startup and then make sure to select run whether or not the user is not logged on. That does the trick for me. you’re welcome! :’-)

  11. Very straightforward and worked without a problem first time. Installed on a SBS2011 running in a VMware partition.

    Thank you

    1. No, I appreciate the share! Glad you found it useful. While my method in this post works just fine, I actually ended up switching to the more official (yet not official) method of using the PMS service wrapper: https://forums.plex.tv/discussion/93994/pms-as-a-service. What I like about this is that it actually loads a service manager in the taskbar similar to how the normal Plex application works that you can use to start/stop the service or launch the web interface. I can’t remember why I switched excatly, but I think it was because I had trouble getting an auto-update service (http://technicallyeasy.net/update-plex-automatically-running-plex-service/) working otherwise. I wanted to have auto-updates that could run in off hours without me having to check for and perform updates when we were using it. This whole system has been working very well for some time now.

      Thanks for your kind words and again for the share!

  12. Plex is a fickle mistress, I have seen programs like MSI afterburner interfere with PMS starting up. I have had to go into regedit and delete the registry key for PMS, then reinstall it.

  13. Trying… https://github.com/cjmurph/PmsService
    Stuck at… “Please specify service credentials.” I’ve tried a few dozen things here… For “username” I’ve put in my email address (that I use to log into plex), my user name, my “friendly name” with and without .\UserName or ComputerName\UserName. Test credentials always fails. Feeling pretty dumb… I have no trouble using Plex generally…

Leave a Reply