Elastic Install and Run - Root or Not?

I am a little confused. I have read you need to install Elastic as root and others say you must not. Some say install as root but run as another user. The docs aren't entire clear on this.

I have to do this for versions 6.X and unfortunately 5.2 as well. Any help is appreciated. Thank you.

If you install Elasticsearch from reb or rpm, it will automatically set up a user to run under. It's normal that installing rpms or deb packages requires root permissions on the server. Our docker images are also already set with users. So if you're using one of those methods, then just follow the docs we have and you should be good to go.

If you're downloading the tarball/zip and using some config management, this is when you have some options that can lead to bad outcomes. Do set up a user for Elasticsearch and do chown the directories to be owned by Elasticsearch. Don't try to run it as root. It will actually refuse to start if it detects that as a security precaution.

The docs for how to set up Elasticsearch on various platforms and with each of these install mechanisms is at https://www.elastic.co/guide/en/elasticsearch/reference/6.4/install-elasticsearch.html

2 Likes

Shane,
Thank you for the explanation. Makes so much more sense now. Much appreciated.

1 Like

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