# Logstash as a windows service

**URL:** <https://discuss.elastic.co/t/logstash-as-a-windows-service/129293>\
**Category:** Logstash\
**Created:** [April 24, 2018, 11:06am UTC](https://discuss.elastic.co/t/logstash-as-a-windows-service/129293 "2018-04-24T11:06:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul1243](https://avatars.discourse-cdn.com/v4/letter/p/e99b99/32.png) [@paul1243](https://discuss.elastic.co/u/paul1243)\
**Post date:** [April 24, 2018, 11:06am UTC](https://discuss.elastic.co/t/logstash-as-a-windows-service/129293/1 "2018-04-24T11:06:40Z")

</div>

Could someone help me in installing the Logstash CONF file as a windows service, till date we are running with the command prompt, which will stuck quite often. so wanted to have it as windows service and keep running forever.

I tried doing it with nssm but no luck, it doesnt add any path executables. Is there any way around doing this. Please let me know.

---

<div class="post-metadata">

**Author:** ![anhlqn](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anhlqn/32/5454_2.png) [@anhlqn](https://discuss.elastic.co/u/anhlqn)\
**Post date:** [April 24, 2018, 10:38pm UTC](https://discuss.elastic.co/t/logstash-as-a-windows-service/129293/2 "2018-04-24T22:38:25Z")

</div>

You can create a batch file which launches Logstash, and use nssm to run that batch file as a service. For instance, create a run.bat file in the `bin` folder with the following command

```auto
logstash.bat -f /path/to/logstash.config

```

---

<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:** [May 22, 2018, 10:47pm UTC](https://discuss.elastic.co/t/logstash-as-a-windows-service/129293/3 "2018-05-22T22:47:29Z")

</div>

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