# Kibana as a windows service : "Error 5: Access is Denied" on start

**URL:** <https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309>\
**Category:** Kibana\
**Created:** [May 10, 2018, 1:06pm UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309 "2018-05-10T13:06:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![stennett](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@stennett](https://discuss.elastic.co/u/stennett)\
**Post date:** [May 10, 2018, 1:06pm UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/1 "2018-05-10T13:06:45Z")

</div>

Hi

I'm trying to get Kibana running as a windows service on an instance of Windows Server 2016.

I've followed the instructions to install Kibana detailed here: [https://www.elastic.co/guide/en/kibana/current/windows.html](https://www.elastic.co/guide/en/kibana/current/windows.html)

And then executed the following command in an elevated command window:  
`sc create "ElasticSearch Kibana " binPath= "C:/Elastic/kibana/bin" depend= "Elasticsearch"`

This command was successful:

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

However, when I attempt to start the service, I get the following issue:

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

I have already ensured that the account that the service runs as has full permissions to the kibana.bat file; so there shouldn't be any file system permission issues. Additionally, if I run the bat file myself then the kibana server starts with no issue; so I dont think it's a config issue with Kibana.

---

<div class="post-metadata">

**Author:** ![jen-huang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jen-huang/32/74327_2.png) [@jen-huang](https://discuss.elastic.co/u/jen-huang)\
**Post date:** [May 10, 2018, 6:11pm UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/2 "2018-05-10T18:11:10Z")

</div>

This sounds like a generic Windows configuration/permission issue, not a Kibana issue. Try the solution suggested here: [https://stackoverflow.com/a/27608055](https://stackoverflow.com/a/27608055)

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [May 10, 2018, 6:13pm UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/3 "2018-05-10T18:13:39Z")

</div>

I also wonder if the error is coming from the Kibana service trying to write log files. Based on the search results I see, that error could result from seemingly _any_ permissions issues.

---

<div class="post-metadata">

**Author:** ![stennett](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@stennett](https://discuss.elastic.co/u/stennett)\
**Post date:** [May 11, 2018, 8:44am UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/4 "2018-05-11T08:44:40Z")

</div>

A good suggestion, but unfortunately one that I had already tried; the service doesn't execute when it runs as `Local System account` either.

I agree that it's unlikely to be a bug in Kibana or anything along those lines; I was just hoping I was missing something obvious..

Thanks for the quick response!

---

<div class="post-metadata">

**Author:** ![stennett](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@stennett](https://discuss.elastic.co/u/stennett)\
**Post date:** [May 14, 2018, 8:48am UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/5 "2018-05-14T08:48:30Z")

</div>

Thanks for the suggestion; however I have also eliminated this as a possible cause. I configured kibana to log to a specific file, and when starting it manually it opens and runs fine (including outputting to the log file) -- however when I start the service I receive the same error.

I will have to try and figure out what this mysterious permissions issue could be.

---

<div class="post-metadata">

**Author:** ![stennett](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@stennett](https://discuss.elastic.co/u/stennett)\
**Post date:** [May 14, 2018, 1:20pm UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/6 "2018-05-14T13:20:10Z")

</div>

Fixed it;

Bascially, i'm an idiot -- `binPath= "C:/Elastic/kibana/bin"` should have been `binPath= "C:/Elastic/kibana/bin/` **kibana.bat** `"`

Figured I would post this here just for anyone googling around like I was.

---

<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:** [June 11, 2018, 1:20pm UTC](https://discuss.elastic.co/t/kibana-as-a-windows-service-error-5-access-is-denied-on-start/131309/7 "2018-06-11T13:20:11Z")

</div>

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