# How to install filebeat as a service and start it everytime windows start?

**URL:** <https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [July 19, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777 "2017-07-19T13:52:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickian](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@patrickian](https://discuss.elastic.co/u/patrickian)\
**Post date:** [July 19, 2017, 1:52pm UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777/1 "2017-07-19T13:52:32Z")

</div>

I'm installing filebeat in client PCs and basically, I don't want them seeing what filebeat does. I want to install it as a service in windows, run it everytime their machine starts and read from a defined directory (not default)

I've installed it as a service following the guide but if I'm not mistaken, I have to manually type in  
Start-Service filebeat  
to run the service and it doesn't read from the log file I defined in the prospector (it works if I start filebeat via the command line normally)

Is there a way to do this? Thank you

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 19, 2017, 5:44pm UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777/2 "2017-07-19T17:44:54Z")

</div>

Once you have enabled the filebeat service it will start-up automatically when the machine boots, so you do not need to continually run `Start-Service filebeat`. Give it a test, reboot the machine and see.

---

<div class="post-metadata">

**Author:** ![patrickian](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@patrickian](https://discuss.elastic.co/u/patrickian)\
**Post date:** [July 19, 2017, 11:01pm UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777/3 "2017-07-19T23:01:55Z")

</div>

Thanks. will give it a try in a while. Does it always use the configuration file in the filebeat root directory when it autostart?

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [July 19, 2017, 11:04pm UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777/4 "2017-07-19T23:04:57Z")

</div>

Yes, the path to the config file is specified in the service's properties.

---

<div class="post-metadata">

**Author:** ![patrickian](https://avatars.discourse-cdn.com/v4/letter/p/c57346/32.png) [@patrickian](https://discuss.elastic.co/u/patrickian)\
**Post date:** [July 20, 2017, 1:16am UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777/5 "2017-07-20T01:16:26Z")

</div>

Thanks for the assistance. It's now running as a service and automatically starts during windows startup.

For those who will be having this issue in the future, here are the steps I did.

1.) Download and extract filebeat.  
2.) _Important_ create the configuration first.  
3.) Install as service using Powershell.  
4.) Start the service using Start-Service filebeat.  
5.) You can now close the powershell window. It will automatically start now even when windows restart.

\*I think the reason why it did not work for me before was that I installed the service before I did the configuration.

---

<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 17, 2017, 1:16am UTC](https://discuss.elastic.co/t/how-to-install-filebeat-as-a-service-and-start-it-everytime-windows-start/93777/6 "2017-08-17T01:16:50Z")

</div>

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