How do I configure Plex Media Server to run as a Windows Service?

This works for me on Windows 10 Pro 1909. Thanks!

This is the secure way to do it! Great write-up Dells2K! Confirmed it works on Server 2019 (Desktop Exp.)

this is exactly what i was looking for, thanks for the info.

Brill!!! This worked for me. Before this I was using autologon with a 1 minute screensaver lock. Thanks

Everyone is saying thanks, but I can’t figure out which post has the solution. Can anyone please help?

Right in the first response.

I’ve tried both methods (i.e. cjmurph’s PmsService service wrapper for Plex Media Server and Windows Task Scheduler) and my recommendation would be to use Task Scheduler.

It works perfectly and allows you to update PMS easily, without the hassle of disabling a wrapper first.

There are also fewer points of failure if you can avoid relying on a 3rd party solution.

You just have to set the scheduled task up properly. I think that’s where people get stuck sometimes.

  1. Open Task Scheduler
  2. Click on “Create Task
”

Then


image

image

image

image

image

image

image

After clicking OK, you will then be prompted to enter the credentials for the Windows user account that the process is to be run under.

The “User name” field will be pre-populated with your current Windows user account by default but you can always change this to something else.

image

I personally then like to disable Plex Media Server in the “Startup” tab of the Task Manager, to ensure I don’t end up with two processes trying to start at the same time (i.e. the background process triggered by Task Manager, then the application launched at logon).

You end up with a completely invisible background task that doesn’t even have an icon next to the clock as usually happens with PMS, although you will still see it in your “Background processes” list in Task Manager.

Once you’ve set it up, reboot and then log back in, then verify that you see “Plex Media Server (32-bit)” running in Task Manager:

image

A note on credentials:

Scheduled tasks rely on the Windows credentials associated with them always being correct, so be sure to go into Task Scheduler and give your Plex Media Server task your new password whenever you happen to change your Windows password.

7 Likes

Thanks for the instructions - that seems very straightforward and exactly how I’d expect it to function.

Unfortunately, I followed those steps exactly as pictured on a Win10 machine, and it doesn’t seem to work. PMS still doesn’t start on system start.

Is there possibly another setup skip that perhaps got missed?

Thanks!

It’s unlikely but I’ll update my instructions if necessary!

Did you figure out what was happening in your case?

Microsoft makes a tool that will allow you to add anything to the services. Pretty simple to implement. I have used this method on every operating system from Windows XP to present.

You will need two programs from the Windows NT Resource Kit (which you should be able to find using Google)

  1. Instrsrv.exe installs and removes system services from Windows NT
  2. Srvany.exe allows any Windows NT application to run as a service.

https://support.microsoft.com/en-us/help/137890/how-to-create-a-user-defined-service

1 Like

I’ve seen that tool before but haven’t used it yet!

In this situation, I’m guessing the result would be the same but it would be a more elegant solution than using Task Scheduler?

In a way, yes.
On the other hand, you won’t be able to use the hardware decoder

btw. nssm.exe is a better alternative to the above mentioned MS tools.

In a way, yes.
On the other hand, you won’t be able to use the hardware decoder

I’m not sure about any of this so I just need to get a clarification: I have a separate Windows 7 box that is my Plex Media server. Are you saying that by using Srvany to start the Plex Server as a service that the hardware decoder is not working?

If so, than what would be the effects by streaming media files to my Roku or Samsung TV using the Plex players without the Plex server having the hardware decoder not working?

Precisely.

If a file requires transcoding, in order to get played on any plex client, your server’s CPU can only use the hardware encoder.
The decoding has to be done in software.
Which, depending on the codec and bitrate of the source file may be so demanding, that the CPU cannot keep up and the client will pause/stop playback and buffer.
You can kinda simulate this by disabling hardware transcoding under
Settings - Server - Transcoder - ‘Show Advanced’ - “ Use hardware acceleration when available”

Ok, so if I have my Windows 7 box set to autologin, and set Plex to open on login I am good with using hardware acceleration?

If I want to setup my Windows 7 box run the Plex server as a service I need to use nssm.exe in order to use hardware acceleration?

Is there anything I need to do special when I install Plex server as a service using nssm?

The below is what I need to check on my Plex player, and not on the Plex server?

Settings - Server - Transcoder - ‘Show Advanced’ - “ Use hardware acceleration when available”

Do I need to setup anything specific on the Plex Server for hardware acceleration?

Yes.

No, nssm.exe won’t help either. Service = no hardware decoder

Make sure to set up the service to run under the same Windows user account as it used to do when started regularly.

That is a server preference. It won’t affect the clients at all.

If you want to use the QuickSync unit in Intel desktop CPU’s you’ll usually have to enable the “onboard graphics” in the computer’s BIOS menu. And then install the driver software for the onboard graphics controller as well.

Sometimes you even have to attach a monitor to the onboard graphics output (or simulate one with a monitor “dummy plug”). Otherwise, some computers don’t enable the Quicksync unit.
see https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/

OK, so bottom line is to use Autologin and set the Plex server to AutoStart on login in order to use hardware acceleration, correct?

If the above is correct than it appears that Plex may need to address that issue and that is why they don’t furnish a option to start the Plex server as a service, correct?

BTW: I have been running Plex server for several years now and forgot how I was actually starting the server. I am using autologin, and setting the Plex server to start at login.

Thank you for your explanations. It will make it far more clear as to the Pros/Cons of starting the Plex server as a service.

Precisely.

umm i use NSSM for Plex on two servers and can do HW transcoding just fine

Could you show me a screenshot of the Plex Dashboard while a transcoding is taking place?