# How can we install elastic as windows service

**URL:** <https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918>\
**Category:** Elasticsearch\
**Created:** [January 4, 2019, 9:25am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918 "2019-01-04T09:25:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sid\_nikhil](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@sid\_nikhil](https://discuss.elastic.co/u/sid_nikhil)\
**Post date:** [January 4, 2019, 9:25am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/1 "2019-01-04T09:25:01Z")

</div>

I know how to host kibana & ES on command prompt . But we need to install ES & Kibana on servers , and ensure that they start automatically when the server restarts .

I hosted ES/Kibana on servers using command prompt , but the problem is when the server restarts the i have to again restart ES/Kibana everytime using command promt.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 4, 2019, 9:37am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/2 "2019-01-04T09:37:19Z")

</div>

Probably this will help: [https://www.elastic.co/guide/en/elasticsearch/reference/current/windows.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/windows.html)

---

<div class="post-metadata">

**Author:** ![sid\_nikhil](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@sid\_nikhil](https://discuss.elastic.co/u/sid_nikhil)\
**Post date:** [January 4, 2019, 9:42am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/3 "2019-01-04T09:42:31Z")

</div>

I isntalled using msi installer . successfullly installed

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/e/ae8c6f36f482f4aac7ac5837e194e1c6bd86b666.png)

but localhost:9200 gives no result

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/3/d3758199b2e3148b2a4679b25b7e531bc64982dc.png)

I checked in Services.msc the Elastic Search service is automatically getting stopped , whenever i start it

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 4, 2019, 10:11am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/4 "2019-01-04T10:11:45Z")

</div>

You need to check the logs.  
Most of the time this is caused by a bad installation, for example bad installation of Java (JAVA\_HOME not set correctly).

---

<div class="post-metadata">

**Author:** ![sid\_nikhil](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@sid\_nikhil](https://discuss.elastic.co/u/sid_nikhil)\
**Post date:** [January 4, 2019, 10:17am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/5 "2019-01-04T10:17:40Z")

</div>

the log folder is empty .  
I got some .NET errors in the event viewer :

Application: elasticsearch.exe  
Framework Version: v4.0.30319  
Description: The process was terminated due to an unhandled exception.  
Exception Info: Elastic.ProcessHosts.Process.StartupException  
at Elastic.ProcessHosts.Process.ProcessBase.HandleException(System.Exception)  
at System.Reactive.ObserverBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception) at System.Reactive.Observer`1[[System.\_\_Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception)  
at System.Reactive.Linq.ObservableImpl.AsObservable`1+_[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception) at System.Reactive.AutoDetachObserver`1[[System.\_\_Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnErrorCore(System.Exception)  
at System.Reactive.ObserverBase`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnError(System.Exception) at Elastic.ProcessHosts.Process.ObservableProcess+<>c__DisplayClass22_0.<CreateProcessExitSubscription>b__0(System.Reactive.EventPattern`1\<System.Object\>)  
at System.Reactive.AnonymousSafeObserver`1[[System.\_\_Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].OnNext(System.\_\_Canon)  
at System.EventHandler.Invoke(System.Object, System.EventArgs)  
at System.Diagnostics.Process.OnExited()  
at System.Diagnostics.Process.RaiseOnExited()  
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)  
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)  
at System.Threading.\_ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback(System.Object, Boolean)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 4, 2019, 10:57am UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/6 "2019-01-04T10:57:29Z")

</div>

I have not enough knowledge on Windows to be helpful. May be someone else?

---

<div class="post-metadata">

**Author:** ![sid\_nikhil](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@sid\_nikhil](https://discuss.elastic.co/u/sid_nikhil)\
**Post date:** [January 4, 2019, 3:51pm UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/7 "2019-01-04T15:51:23Z")

</div>

Thanks David .. JAVA\_HOME was the issue.. solved now..  
so Elastic Search is now hosted as service  
How do i host Kibana as Service .. there is no MSI installer available for it  
I still need to start Kibana via command prompt.. every time when server restarts

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 4, 2019, 4:17pm UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/8 "2019-01-04T16:17:55Z")

</div>

I don't know. May be ask in #kibana channel?

---

<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:** [February 1, 2019, 4:17pm UTC](https://discuss.elastic.co/t/how-can-we-install-elastic-as-windows-service/162918/9 "2019-02-01T16:17:58Z")

</div>

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