# Java access denied when starting elasticsearch

**URL:** <https://discuss.elastic.co/t/java-access-denied-when-starting-elasticsearch/319333>\
**Category:** Elasticsearch\
**Created:** [November 18, 2022, 8:52pm UTC](https://discuss.elastic.co/t/java-access-denied-when-starting-elasticsearch/319333 "2022-11-18T20:52:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnny1891](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@johnny1891](https://discuss.elastic.co/u/johnny1891)\
**Post date:** [November 18, 2022, 8:52pm UTC](https://discuss.elastic.co/t/java-access-denied-when-starting-elasticsearch/319333/1 "2022-11-18T20:52:51Z")

</div>

Hi,

I'm following this tutorial to install ELK stack [How to install Elastic SIEM and Elastic EDR - On The Hunt](https://newtonpaul.com/how-to-install-elastic-siem-and-elastic-edr/#Configuring_X-Pack) but after adding certificates, I try to restart the service but I get this:

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

I downloaded elastic today on my Linux machine which I try to set everything up on. I have this version:  
/usr/share/elasticsearch/bin/elasticsearch -V  
Picked up \_JAVA\_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true  
Version: 8.5.1, Build: deb/c1310c45fc534583afe2c1c03046491efba2bba2/2022-11-09T21:02:20.169855900Z, JVM: 19.0.1

My java version:  
java -version  
Picked up \_JAVA\_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true  
openjdk version "17.0.5" 2022-10-18  
OpenJDK Runtime Environment (build 17.0.5+8-Debian-2)  
OpenJDK 64-Bit Server VM (build 17.0.5+8-Debian-2, mixed mode, sharing)

Anyone have some thoughts how I can fix this?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [November 19, 2022, 12:05am UTC](https://discuss.elastic.co/t/java-access-denied-when-starting-elasticsearch/319333/2 "2022-11-19T00:05:21Z")

</div>

Hi @johnny1891 The problem with following on outside blog tutorial is they do not get updated and that blog is / was not written for 8.x

8.X Configured Authentication and TLS on elasticsearch by default... so the vast majority of that blog is out of date!

8.x Elastic and Kibana does it all automatically you do not need to set any setting except perhaps 'in the

elastcisearch.yml  
`network.host: <elasticsearch_ip>`

and kibana.yml  
`server.host: "0.0.0.0"`

If you just followed the default install it would all work magically.

My Suggestion would be to clean out everything you have done, including the [data directories](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html#deb-layout) follow the Official Documentation

> **[Install Elasticsearch with Debian Package | Elasticsearch Guide \[8.5\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/deb.html)**

and Kibana

> **[Install Kibana with Debian package | Kibana Guide \[8.5\] | Elastic](https://www.elastic.co/guide/en/kibana/current/deb.html)**

---

<div class="post-metadata">

**Author:** ![johnny1891](https://avatars.discourse-cdn.com/v4/letter/j/43a26b/32.png) [@johnny1891](https://discuss.elastic.co/u/johnny1891)\
**Post date:** [November 19, 2022, 11:08am UTC](https://discuss.elastic.co/t/java-access-denied-when-starting-elasticsearch/319333/3 "2022-11-19T11:08:49Z")

</div>

> [@stephenb](#):
>
> server.host

Thank you, that worked bettter!

---

<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 17, 2022, 11:09am UTC](https://discuss.elastic.co/t/java-access-denied-when-starting-elasticsearch/319333/4 "2022-12-17T11:09:10Z")

</div>

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