# PlexConnect Windows Service

**URL:** <https://forums.plex.tv/t/plexconnect-windows-service/40611>\
**Category:** Apps & Creations\
**Created:** [August 16, 2013, 10:34am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611 "2013-08-16T10:34:03Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmeijer](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rmeijer](https://forums.plex.tv/u/rmeijer)\
**Post date:** [August 16, 2013, 10:34am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/1 "2013-08-16T10:34:03Z")

</div>

Hi Guys,  
  
A simple and quick quide how to install and remove PlexConnect for aTV as a Windows Service.  
Tested with: Windows 7, Windows 8 (32b & 64b).  
  
Good luck!  
  
  
**Install and Start PlexConnect-service**

- Download NSSM:&nbsp;[nssm-2.16.zip](https://global.discourse-cdn.com/plex/original/3X/d/6/d65ff171064c286dd0421fe738eb9cdc9119d8e8.zip) (187 KB)
- Put the NSSM-binary in your PlexConnect folder.
- Start Command-Prompt (Run \> cmd) and go to your PlexConnect-folder (cd foldername).
- Type: nssm install SERVICE-NAME PYTHON-FOLDER "PLEXCONNECT-FOLDER"  
  
**Example:&nbsp;**  

```
nssm install PlexConnect C:\Python27\python.exe "C:\PlexConnect\PlexConnect.py"
```
- Type: net start SERVICE-NAME  
  
**Example:&nbsp;**  

```
net start PlexConnect
```
- Done!

&nbsp;

**Example download:** &nbsp;[PlexConnect\_example.zip](https://global.discourse-cdn.com/plex/original/3X/d/9/d9e2d447a842786211dbd7fc2fb7aa5e115d7c19.zip) (362 KB)

&nbsp;

**Stop and Remove PlexConnect-service**

- Start Command-Prompt (Run \> cmd) and go to your PlexConnect-folder (cd foldername).
- Type: net stop SERVICE-NAME  
  
**Example:&nbsp;**  

```
net stop PlexConnect
```
- Type: nssm remove SERVICE-NAME&nbsp;  
  
**Example:&nbsp;**  

```
nssm remove PlexConnect
```
- Done!

---

<div class="post-metadata">

**Author:** ![drewbie](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drewbie/32/6262_2.png) [@drewbie](https://forums.plex.tv/u/drewbie)\
**Post date:** [August 16, 2013, 11:35am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/2 "2013-08-16T11:35:15Z")

</div>

Rogger,  
  
  
Looks great. My only question is does NSSM handle closing plexconnect with CTRL C so that the settings changes made through the UI on the ATV are sved to atvsettings.cfg?

---

<div class="post-metadata">

**Author:** ![rmeijer](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rmeijer](https://forums.plex.tv/u/rmeijer)\
**Post date:** [August 16, 2013, 12:05pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/3 "2013-08-16T12:05:11Z")

</div>

Yes... set all your settings in&nbsp;ATVSettings.cfg...

Because CTRL + C does not work with background processes (service), create a little restart script for Windows so you can activate newly set settings, example:

```
@echo off
net stop PlexConnect
net start PlexConnect
exit
```

Save as "plexconnect\_restart.cmd"

Download:&nbsp;[PlexConnect\_restart.zip](https://global.discourse-cdn.com/plex/original/3X/6/1/61221ade7611af8f6d6d46ac5775793a13926832.zip) (188 Bytes)

---

<div class="post-metadata">

**Author:** ![drewbie](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/drewbie/32/6262_2.png) [@drewbie](https://forums.plex.tv/u/drewbie)\
**Post date:** [August 16, 2013, 10:48pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/4 "2013-08-16T22:48:48Z")

</div>

Sorry maybe I did not phrase my question correctly.  
  
  
Plex connect only saves the atvsettings.cfg file web you ctrl c the python script. This settings file is any changes you have made in the UI on the ATV, ie list v grid view etc  
  
  
So if you do a net stop or stop the service through the services control panel does NSSM close the script cleanly ie send a ctrl c or does it just kill the python process? Because if it just kills the python process then no changes made in the ATV UI will be saved.

---

<div class="post-metadata">

**Author:** ![rmeijer](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rmeijer](https://forums.plex.tv/u/rmeijer)\
**Post date:** [August 17, 2013, 9:45am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/5 "2013-08-17T09:45:27Z")

</div>

> ...&nbsp;So if you do a net stop or stop the service through the services control panel does NSSM close the script cleanly ie send a ctrl c or does it just kill the python process? Because if it just kills the python process then no changes made in the ATV UI will be saved.

True... on restarting the service (net stop/start servicename) the ATVSettings.cfg won't be written. Just set your settings once and you'll be ok.

---

<div class="post-metadata">

**Author:** ![gosieg](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gosieg](https://forums.plex.tv/u/gosieg)\
**Post date:** [September 3, 2013, 6:06pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/6 "2013-09-03T18:06:25Z")

</div>

Love the idea. Thanks for sharing. I followed these instructions, but I haven't been able to get PlexConnect to run in the background. According to the nssm command prompt, I was able to install and start the service successfully, as shown here:

> C:\Program Files (x86)\PlexConnect\>nssm install PlexConnect C:\Python27\python.e
> 
> xe "C:\Program Files (x86)\PlexConnect\PlexConnect.py"
> 
> Service "PlexConnect" installed successfully!
> 
> &nbsp;
> 
> C:\Program Files (x86)\PlexConnect\>net start PlexConnect
> 
> The PlexConnect service is starting.
> 
> The PlexConnect service was started successfully.

However, Trailers doesn't work, and the Windows service manager shows the service as being Paused. I'm running Windows 7 and I've actually tried using the 32-bit and 64-bit versions of nssm, which gave me the same results. Any ideas? Thanks!

Gordon

---

<div class="post-metadata">

**Author:** ![Christophorus](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/christophorus/32/77043_2.png) [@Christophorus](https://forums.plex.tv/u/Christophorus)\
**Post date:** [September 4, 2013, 7:31am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/7 "2013-09-04T07:31:32Z")

</div>

Not sure how I missed this first time. Definitely trying this out when I get home.

---

<div class="post-metadata">

**Author:** ![itzvaibhav](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/itzvaibhav/32/7682_2.png) [@itzvaibhav](https://forums.plex.tv/u/itzvaibhav)\
**Post date:** [September 4, 2013, 2:54pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/8 "2013-09-04T14:54:17Z")

</div>

Hi Rogger,

I downloaded the nssm but I did'nt get&nbsp;NSSM-binary. Do I have to copy the complete folder or any particular file?

---

<div class="post-metadata">

**Author:** ![rmeijer](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rmeijer](https://forums.plex.tv/u/rmeijer)\
**Post date:** [September 4, 2013, 5:19pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/9 "2013-09-04T17:19:16Z")

</div>

Please read this:&nbsp;[https://github.com/iBaa/PlexConnect/wiki/Install-guides](https://github.com/iBaa/PlexConnect/wiki/Install-guides)&nbsp;and fix&nbsp;[http://forums.plexapp.com/index.php/topic/79540-windows-specific-instructions-for-creating-and-installing-the-ssl-cert/](http://forums.plexapp.com/index.php/topic/79540-windows-specific-instructions-for-creating-and-installing-the-ssl-cert/)

---

<div class="post-metadata">

**Author:** ![gosieg](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gosieg](https://forums.plex.tv/u/gosieg)\
**Post date:** [September 4, 2013, 5:32pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/10 "2013-09-04T17:32:12Z")

</div>

> Hi Rogger,
> 
> I downloaded the nssm but I did'nt get&nbsp;NSSM-binary. Do I have to copy the complete folder or any particular file?

When he says "binary" he means the .exe file. So you either want the one from the x64 folder or the x32 folder.

Rogger - if your reply was directed toward me, I believe I've already done all that. I have PlexConnect working with the cert file when I run it without nssm (from the command line). It's the nssm service that won't start correctly.

---

<div class="post-metadata">

**Author:** ![rmeijer](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rmeijer](https://forums.plex.tv/u/rmeijer)\
**Post date:** [September 4, 2013, 6:25pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/11 "2013-09-04T18:25:31Z")

</div>

Send you a PM. Please let me know....

---

<div class="post-metadata">

**Author:** ![itzvaibhav](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/itzvaibhav/32/7682_2.png) [@itzvaibhav](https://forums.plex.tv/u/itzvaibhav)\
**Post date:** [September 5, 2013, 3:24am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/12 "2013-09-05T03:24:57Z")

</div>

@Rogger

tried the complete setup again. But no go.

08:41:51 PlexConnect: \*\*\*

08:41:51 PlexConnect: PlexConnect

08:41:51 PlexConnect: Press CTRL-C to shut down.

08:41:51 PlexConnect: \*\*\*

08:41:51 PlexConnect: started: 08:41:51

08:41:51 PlexConnect: IP\_self: 192.168.1.2

08:41:51 DNSServer: started: 08:41:51

08:41:51 DNSServer: \*\*\*

08:41:51 DNSServer: DNSServer: Serving DNS on port 53.

08:41:51 DNSServer: intercept: ['trailers.apple.com', 'atv.plexconnect'] =\> 192.

168.1.2

08:41:51 DNSServer: restrain: ['mesu.apple.com', 'appldnld.apple.com', 'appldnld

.apple.com.edgesuite.net'] =\> 127.0.0.1

08:41:51 DNSServer: forward other to higher level DNS: 8.8.8.8

08:41:51 DNSServer: \*\*\*

08:41:52 WebServer: started: 08:41:52

08:41:52 WebServer: \*\*\*

08:41:52 WebServer: WebServer: Serving HTTP on 0.0.0.0 port 80.

08:41:52 WebServer: WebServer: Serving HTTPS on 0.0.0.0 port 443.

08:41:52 WebServer: \*\*\*

08:41:52 PlexGDM: \*\*\*

08:41:52 PlexGDM: looking up Plex Media Server

08:41:52 PlexGDM: \*\*\*

08:41:53 PlexGDM: servers discovered: 1

08:41:53 XMLConverter: PlexGDM - PMS: 192.168.1.2:32400

08:42:04 DNSServer: DNS request received!

08:42:04 DNSServer: Source: ('192.168.1.102', 51772)

08:42:04 DNSServer: Domain: p40-buy.itunes.apple.com.akadns.net

08:42:04 DNSServer: \*\*\*forward request

08:42:04 DNSServer: -\> DNS response from higher level

08:42:04 DNSServer: DNS request received!

08:42:04 DNSServer: Source: ('192.168.1.102', 61453)

08:42:04 DNSServer: Domain: p40-buy.itunes.apple.com.akadns.net

08:42:04 DNSServer: \*\*\*forward request

08:42:04 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 62611)

08:42:08 DNSServer: Domain: itunes-cdn.apple.com.akadns.net

08:42:08 DNSServer: \*\*\*forward request

08:42:08 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 61333)

08:42:08 DNSServer: Domain: itunes-cdn.apple.com.akadns.net

08:42:08 DNSServer: \*\*\*forward request

08:42:08 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 52634)

08:42:08 DNSServer: Domain: ax.init-cdn.itunes.apple.com.akadns.net

08:42:08 DNSServer: \*\*\*forward request

08:42:08 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 59617)

08:42:08 DNSServer: Domain: ax.init-cdn.itunes.apple.com.akadns.net

08:42:08 DNSServer: \*\*\*forward request

08:42:08 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 65141)

08:42:08 DNSServer: Domain: e673.g.akamaiedge.net

08:42:08 DNSServer: \*\*\*forward request

08:42:08 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 64636)

08:42:08 DNSServer: Domain: a771.da1.akamai.net

08:42:08 DNSServer: \*\*\*forward request

08:42:08 DNSServer: -\> DNS response from higher level

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 57343)

08:42:08 DNSServer: Domain: trailers.apple.com

08:42:08 DNSServer: \*\*\*intercept request

08:42:08 DNSServer: -\> DNS response: 192.168.1.2

08:42:08 DNSServer: DNS request received!

08:42:08 DNSServer: Source: ('192.168.1.102', 62388)

08:42:08 DNSServer: Domain: trailers.apple.com

08:42:08 DNSServer: \*\*\*intercept request

08:42:08 DNSServer: -\> DNS response: 192.168.1.2

&nbsp;

Here is my settings file

&nbsp;

[PlexConnect]

logpath = .

enable\_dnsserver = True

ip\_webserver = 0.0.0.0

prevent\_atv\_update = True

port\_dnsserver = 53

enable\_plexconnect\_autodetect = True

port\_pms = 32400

port\_webserver = 80

ip\_plexconnect = 0.0.0.0

certfile = c:\plexconnect\assets\certificates railers.pem

ip\_dnsmaster = 8.8.8.8

loglevel = Normal

ip\_pms = 192.168.178.10

enable\_plexgdm = True

port\_ssl = 443

---

<div class="post-metadata">

**Author:** ![Trowhill](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/trowhill/32/4215_2.png) [@Trowhill](https://forums.plex.tv/u/Trowhill)\
**Post date:** [September 6, 2013, 2:41pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/13 "2013-09-06T14:41:10Z")

</div>

I had problems getting this to work on my win7 plex server, I do not have a password at startup so I use this instead of creating a service. &nbsp;The bat file will do a delay startup of plexconnect, this gives the plex server a chance to startup first

I created a bat file and put it in the startup folder:

@ECHO OFF

&nbsp;

TIMEOUT /T 30

REM Total Delay = 30 seconds

START C:\plexconnect\plexconnect.py

---

<div class="post-metadata">

**Author:** ![Ian\_E](https://avatars.discourse-cdn.com/v4/letter/i/4da419/32.png) [@Ian\_E](https://forums.plex.tv/u/Ian_E)\
**Post date:** [September 6, 2013, 4:36pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/14 "2013-09-06T16:36:09Z")

</div>

Worked great, a slight delay would be useful as I found the service starts up before the plex server so if you try and access the server via ATV straight after start up it fails, but hit menu and back and it works so hardly a problem.

---

<div class="post-metadata">

**Author:** ![rmeijer](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rmeijer](https://forums.plex.tv/u/rmeijer)\
**Post date:** [September 6, 2013, 4:52pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/15 "2013-09-06T16:52:36Z")

</div>

> I had problems getting this to work on my win7 plex server, I do not have a password at startup so I use this instead of creating a service. &nbsp;The bat file will do a delay startup of plexconnect, this gives the plex server a chance to startup first
> 
> I created a bat file and put it in the startup folder:
> 
> @ECHO OFF
> 
> &nbsp;
> 
> TIMEOUT /T 30
> 
> REM Total Delay = 30 seconds
> 
> START C:\plexconnect\plexconnect.py

**Alternative:**

Rename&nbsp;PlexConnect **.py&nbsp;** to&nbsp;PlexConnect **.pyw**.

Click on&nbsp; **PlexConnect.pyw** &nbsp;and PlexConnect will run in the background.&nbsp;

To start PlexConnect on Windows logon, make a shortcut to&nbsp; **PlexConnect.pyw&nbsp;** and place it in your StartUp folder (StartMenu \> Startup).

Only one disadvantage; If you want to stop/restart PlexConnect you have to kill the process in the Task Manager (pythonw.exe).

---

<div class="post-metadata">

**Author:** ![gosieg](https://avatars.discourse-cdn.com/v4/letter/g/58f4c7/32.png) [@gosieg](https://forums.plex.tv/u/gosieg)\
**Post date:** [September 6, 2013, 6:02pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/16 "2013-09-06T18:02:04Z")

</div>

Thanks, Rogger! The pyw tweak worked for me. So simple!

---

<div class="post-metadata">

**Author:** ![billvan](https://avatars.discourse-cdn.com/v4/letter/b/7c8e57/32.png) [@billvan](https://forums.plex.tv/u/billvan)\
**Post date:** [March 15, 2014, 3:08pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/17 "2014-03-15T15:08:18Z")

</div>

> **Alternative:**
> 
> Rename&nbsp;PlexConnect **.py&nbsp;** to&nbsp;PlexConnect **.pyw**.
> 
> Click on&nbsp; **PlexConnect.pyw** &nbsp;and PlexConnect will run in the background.&nbsp;
> 
> To start PlexConnect on Windows logon, make a shortcut to&nbsp; **PlexConnect.pyw&nbsp;** and place it in your StartUp folder (StartMenu \> Startup).
> 
> Only one disadvantage; If you want to stop/restart PlexConnect you have to kill the process in the Task Manager (pythonw.exe).

Thanks for the suggestion. Definitely the simplest way to go; and best of all; it actually works...

---

<div class="post-metadata">

**Author:** ![Prits](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@Prits](https://forums.plex.tv/u/Prits)\
**Post date:** [May 1, 2014, 11:07am UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/18 "2014-05-01T11:07:10Z")

</div>

works perfectly on win 8.1, thanks heaps!

---

<div class="post-metadata">

**Author:** ![f00b4r](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/f00b4r/32/768_2.png) [@f00b4r](https://forums.plex.tv/u/f00b4r)\
**Post date:** [May 1, 2014, 12:59pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/19 "2014-05-01T12:59:53Z")

</div>

> **Alternative:**  
>   
> Rename PlexConnect **.py** to PlexConnect **.pyw**.  
>   
> Click on **PlexConnect.pyw** and PlexConnect will run in the background.   
> To start PlexConnect on Windows logon, make a shortcut to **PlexConnect.pyw** and place it in your StartUp folder (StartMenu \> Startup).  
>   
> Only one disadvantage; If you want to stop/restart PlexConnect you have to kill the process in the Task Manager (pythonw.exe).

  
The issue with this is:  
  
- PlexConnect will never be shut done cleanly  
- your settings will not get saved if you change them.  
- if PlexConnect crashes it will not automatically restart

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 11:54pm UTC](https://forums.plex.tv/t/plexconnect-windows-service/40611/20 "2019-12-20T23:54:57Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
