# How to run Logstash as a service on Windows

**URL:** <https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801>\
**Category:** Logstash\
**Created:** [July 10, 2019, 2:39pm UTC](https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801 "2019-07-10T14:39:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhilsharma.in](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@akhilsharma.in](https://discuss.elastic.co/u/akhilsharma.in)\
**Post date:** [July 10, 2019, 2:39pm UTC](https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801/1 "2019-07-10T14:39:46Z")

</div>

Hello,

I'm configuring Logstash on windows server. And I need logstash to run as a service and not from command line. And I assume service is configured with an .exe file as binary and not other files like .bat or .ps1. How can we configure logstash to run as a service in Windows?

Thanks  
Akhil

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 10, 2019, 2:42pm UTC](https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801/2 "2019-07-10T14:42:06Z")

</div>

Use a [service wrapper](https://en.wikipedia.org/wiki/Service_wrapper).

---

<div class="post-metadata">

**Author:** ![akhilsharma.in](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@akhilsharma.in](https://discuss.elastic.co/u/akhilsharma.in)\
**Post date:** [July 11, 2019, 10:26am UTC](https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801/3 "2019-07-11T10:26:56Z")

</div>

Please help me with the steps.

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [July 11, 2019, 10:39am UTC](https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801/4 "2019-07-11T10:39:10Z")

</div>

Use NSSM ([https://nssm.cc/commands](https://nssm.cc/commands))

```
nssm install <servicename> <program> [<arguments>]

```

Example :

```
nssm.exe install logstash_service_x86 "c:/logstash/config/run_logstash_config.bat"

```

where run\_logstash\_config.bat is a windows batch file that run logstash against your config file with :

```
$logstash -f logstash_cofig.d
```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 8, 2019, 10:39am UTC](https://discuss.elastic.co/t/how-to-run-logstash-as-a-service-on-windows/189801/5 "2019-08-08T10:39:11Z")

</div>

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