# How to run logstash config file automatically after system restarts?

**URL:** <https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177>\
**Category:** Logstash\
**Created:** [December 1, 2020, 9:18am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177 "2020-12-01T09:18:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Chougule](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_chougule/32/71789_2.png) [@Rahul\_Chougule](https://discuss.elastic.co/u/Rahul_Chougule)\
**Post date:** [December 1, 2020, 9:18am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177/1 "2020-12-01T09:18:32Z")

</div>

I want to load/run my logstash config file automatically after system restarts everytime (after updates). How to do that?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![TheHunter1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thehunter1/32/80190_2.png) [@TheHunter1](https://discuss.elastic.co/u/TheHunter1)\
**Post date:** [December 1, 2020, 10:17am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177/2 "2020-12-01T10:17:18Z")

</div>

Hello,

I am not expert on that, but I think if you are in a linux machine you just need to run: `sudo systemctl enable logstash` and it will run automatically after a reboot.

---

<div class="post-metadata">

**Author:** ![Rahul\_Chougule](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rahul_chougule/32/71789_2.png) [@Rahul\_Chougule](https://discuss.elastic.co/u/Rahul_Chougule)\
**Post date:** [December 1, 2020, 10:30am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177/3 "2020-12-01T10:30:45Z")

</div>

Thanks for your response, but I'm using windows. How we can achieve on the windows systems?

---

<div class="post-metadata">

**Author:** ![TheHunter1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thehunter1/32/80190_2.png) [@TheHunter1](https://discuss.elastic.co/u/TheHunter1)\
**Post date:** [December 1, 2020, 10:38am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177/4 "2020-12-01T10:38:39Z")

</div>

In windows, I think you can run this command: `sc config logstash start= auto`

---

<div class="post-metadata">

**Author:** ![Thelmo\_Henrique\_Sant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thelmo_henrique_sant/32/62803_2.png) [@Thelmo\_Henrique\_Sant](https://discuss.elastic.co/u/Thelmo_Henrique_Sant)\
**Post date:** [December 2, 2020, 7:26am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177/5 "2020-12-02T07:26:37Z")

</div>

HI Rahul,

Take a look at this page:

> **[ELK STACK ON WINDOWS SERVER — PART 2 — INSTALLATION](https://medium.com/@samil.mehdiyev/elk-stack-on-windows-server-part-2-installation-d2a7200b65a6)**
>
> In Part 1, we spoke about ELK Stack commonly. In this post, we will go through the ELK Stack installation process on Windows Server 2012 R2…

  
I used this one when I installed ELK on my windows for the first time. You will need to use a program called NSSM to make Logstash a service in Windows. Then you can configure the service to start when the machine start.

I hope this page could you.

Br,

Thelmo Henrique

---

<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:** [December 30, 2020, 7:26am UTC](https://discuss.elastic.co/t/how-to-run-logstash-config-file-automatically-after-system-restarts/257177/6 "2020-12-30T07:26:51Z")

</div>

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