Elastic Kibana - install as windows service

KibanaElasticsearch

Kibana Problem Overview


How can I install Elastic Kibana (which is just a batch file) as a windows service?

It probably needs to depend on the ElasticSearch process as well (this assumes I'm running it on the same server)

Kibana Solutions


Solution 1 - Kibana

The following command will create the service with a name of "ElasticSearch Kibana 4.0.1" and make it depend on ElasticSearch so it doesn't try to start too soon.

sc create "ElasticSearch Kibana 4.0.1" binPath= "{path to batch file}" depend= "elasticsearch-service-x64" 

Solution 2 - Kibana

The kibana.bat file delivered with Kibana 4.6.1 was not suited to use with sc create directly for me (Service start failed). I used nssm like this

  1. nssm install kibana461
  2. UI: choose kibana.bat as Application Path
  3. UI: select a log file to write to on "I/O" tab for stdout and stderr
  4. UI: on the "Dependencies" tab enter elasticsearch241 (or whatever you called it)
  5. UI: "Install Service"
  6. sc start kibana461

Solution 3 - Kibana

Rather than creating a dependency, I made a delayed start.

  1. First use the sc command (from jhilden).

     sc create "Elasticsearch Kibana 4.4.2" binPath= "C:\kibana-4.4.2-windows\bin\kibana.bat"
    
  2. Open services.msc and find your new service.

  3. Right click the service and select Properties.

  4. Change to Automatic (Delayed Start).

  5. If you haven't already, change Elasticsearch to Automatic.

services

This will ensure elasticsearch will start when the machine starts, and kibana will start sometime soon after (approx 2 minutes from this question).

Solution 4 - Kibana

I found this video very helpful.

Use NSSM (Non-sucking Service Manager) to install Kibana as a Service.

https://www.youtube.com/watch?v=L-0A2cqTn-w

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjhildenView Question on Stackoverflow
Solution 1 - KibanajhildenView Answer on Stackoverflow
Solution 2 - KibanaChristianView Answer on Stackoverflow
Solution 3 - KibanastyfleView Answer on Stackoverflow
Solution 4 - KibanaMurali BalaView Answer on Stackoverflow