# Cannot start Elasticsearch 6.2.1 on Centos7

**URL:** <https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669>\
**Category:** Elasticsearch\
**Created:** [June 27, 2018, 5:35pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669 "2018-06-27T17:35:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![longuyen](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@longuyen](https://discuss.elastic.co/u/longuyen)\
**Post date:** [June 27, 2018, 5:35pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/1 "2018-06-27T17:35:33Z")

</div>

I've installed Elasticsearch 6.2.1 via RPM but when I try to run it gives me on several files.  
This is my Dockerfile:  
FROM centos:centos7

ADD elasticsearch.repo /etc/yum.repos.d/elasticsearch.repo  
RUN rpm --import [https://artifacts.elastic.co/GPG-KEY-elasticsearch](https://artifacts.elastic.co/GPG-KEY-elasticsearch) &&   
yum install -y --setopt=tsflags=nodocs --nogpgcheck   
java-1.8.0-openjdk-headless   
elasticsearch-6.2.1

USER 1000  
CMD ["sh", "/usr/share/elasticsearch/bin/elasticsearch"]

If I try to run build this image and run it will give me this err:  
/usr/share/elasticsearch/bin/elasticsearch-env: line 70: /etc/sysconfig/elasticsearch: Permission denied

If I give permission for this file and try to run again. I will get other permission issues with var/lib/elasticsearch and var/log/elasticsearch.

I've also noticed that these file/directory are owned by elasticsearch group. I've tried to start elasticsearch as user 'elasticsearch' and it seems to work. However I wonder if there is any other way to run elasticsearch? Or is running as 'elasticsearch' user the standard way? Thanks.

---

<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:** [June 27, 2018, 5:55pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/2 "2018-06-27T17:55:47Z")

</div>

Why not using elastic official docker image instead ?

---

<div class="post-metadata">

**Author:** ![longuyen](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@longuyen](https://discuss.elastic.co/u/longuyen)\
**Post date:** [June 27, 2018, 6:07pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/3 "2018-06-27T18:07:17Z")

</div>

I haven't tried it yet. But do you suggest any changes I should make with the current Dockerfile in order for the Elasticsearch to run ?

---

<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:** [June 27, 2018, 6:34pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/4 "2018-06-27T18:34:42Z")

</div>

I don't know. I'm trying to always use the simplest path. 😉

---

<div class="post-metadata">

**Author:** ![longuyen](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@longuyen](https://discuss.elastic.co/u/longuyen)\
**Post date:** [June 27, 2018, 6:52pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/5 "2018-06-27T18:52:19Z")

</div>

Do you happen to know where can I find the dockerfile that is used to build official image ?

---

<div class="post-metadata">

**Author:** ![longuyen](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@longuyen](https://discuss.elastic.co/u/longuyen)\
**Post date:** [June 27, 2018, 6:56pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/6 "2018-06-27T18:56:52Z")

</div>

nvm I found it

---

<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:** [July 25, 2018, 6:57pm UTC](https://discuss.elastic.co/t/cannot-start-elasticsearch-6-2-1-on-centos7/137669/7 "2018-07-25T18:57:02Z")

</div>

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