# Elasticsearch 7.17.6 can't be started as root

**URL:** <https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274>\
**Category:** Elasticsearch\
**Created:** [September 9, 2024, 10:50pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274 "2024-09-09T22:50:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ch101495](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@ch101495](https://discuss.elastic.co/u/ch101495)\
**Post date:** [September 9, 2024, 10:50pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274/1 "2024-09-09T22:50:38Z")

</div>

Hello, I'm using RHEL 7.6 Maipo and I'm trying to start the elasticsearch service in a single node instance as root, but I'm receiving this error after i try to start the service using ./elasticsearch -d  
Error meesage:  
java.lang.RuntimeException: can not run elasticsearch as root  
at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:107)  
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:183)  
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)  
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)  
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)  
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)  
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)  
at org.elasticsearch.cli.Command.main(Command.java:77)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)  
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)

---

<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:** [September 9, 2024, 11:32pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274/2 "2024-09-09T23:32:51Z")

</div>

Welcome!

You can not run as root.

---

<div class="post-metadata">

**Author:** ![ch101495](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@ch101495](https://discuss.elastic.co/u/ch101495)\
**Post date:** [September 10, 2024, 1:32pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274/3 "2024-09-10T13:32:59Z")

</div>

Hello, David

Doing a research, I've found that Elastic Search can't be run as root. But maybe using a different approach would I be able to run it as root? In the machine I'm working on I can't create a new user only for run Elasticsearch even I can't create a different user than root.

Also, I've tried this '-Des.insecure.allow.root=true' but it's not working for me. Thanks for your help and I hope someone has a way to get the service running as root.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 10, 2024, 1:39pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274/4 "2024-09-10T13:39:19Z")

</div>

As [outlined in the documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/es-security-principles.html#security-not-root-user) you must never run Elasticsearch as root and Elasticsearch will as you have noticed prevent this.

---

<div class="post-metadata">

**Author:** ![ch101495](https://avatars.discourse-cdn.com/v4/letter/c/c89c15/32.png) [@ch101495](https://discuss.elastic.co/u/ch101495)\
**Post date:** [September 10, 2024, 5:21pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274/5 "2024-09-10T17:21:07Z")

</div>

Thank you Christian, but I'm trying to achieve this because I need to start the Elasticsearch service in a cloud instance where I'm not able to create/use a different user than root. I've read the doc you linked but just curious if there is a different way to get the root user running Elasticsearch service.  
Thank you

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 10, 2024, 5:33pm UTC](https://discuss.elastic.co/t/elasticsearch-7-17-6-cant-be-started-as-root/366274/6 "2024-09-10T17:33:58Z")

</div>

Can you try installing from a `deb` or `rpm` package?

If you have root access I do not see how you could be prevented from creating a new user. Where exactly are you installing?
