# How to create multiple running instances of Elasticsearch on a sever but on different ports?

**URL:** <https://discuss.elastic.co/t/how-to-create-multiple-running-instances-of-elasticsearch-on-a-sever-but-on-different-ports/80818>\
**Category:** Elasticsearch\
**Created:** [March 31, 2017, 1:19pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-running-instances-of-elasticsearch-on-a-sever-but-on-different-ports/80818 "2017-03-31T13:19:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phalcony](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phalcony/32/16951_2.png) [@phalcony](https://discuss.elastic.co/u/phalcony)\
**Post date:** [March 31, 2017, 1:19pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-running-instances-of-elasticsearch-on-a-sever-but-on-different-ports/80818/1 "2017-03-31T13:19:56Z")

</div>

Hi,

I would to run two or more instances of ES on my server but on different ports.  
e.g. [http://localhost:9200](http://localhost:9200), [http://localhost:9201](http://localhost:9201) ...

I created two different "elasticsearch.1.yml & elasticsearch.2.yml" with respected port numbers (http.port:9200 & http.port:9101), logs and data paths. The mentioned config files located under "elasticsearch-5.1.2/config/" folder. I tried to run "bin/elasticsearch -d" but it shows me only the instance with port 9200.

Can you please tell me where i am wrong and what have to do?

kind regards

---

<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:** [March 31, 2017, 1:45pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-running-instances-of-elasticsearch-on-a-sever-but-on-different-ports/80818/2 "2017-03-31T13:45:14Z")

</div>

First of all don't do that. Unless you have more than 64Gb of RAM on your machine.

Then, only `config/elasticsearch.yml` is read.  
You can create multiple config dirs if you wish and then start elasticsearch with `-Epath.conf=config1`.

Read [https://www.elastic.co/guide/en/elasticsearch/reference/5.3/settings.html#\_config\_file\_location](https://www.elastic.co/guide/en/elasticsearch/reference/5.3/settings.html#_config_file_location)

---

<div class="post-metadata">

**Author:** ![phalcony](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/phalcony/32/16951_2.png) [@phalcony](https://discuss.elastic.co/u/phalcony)\
**Post date:** [April 4, 2017, 1:31pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-running-instances-of-elasticsearch-on-a-sever-but-on-different-ports/80818/3 "2017-04-04T13:31:59Z")

</div>

Thanks a lot, it helps me 😉

I would like to add some other points to your suggested solution which may help others:

1. For older version of Elasticsearch the command looks a bit different  
e.g. ES version 1.6. `bin/elasticsearch -d -Des.path.conf=config1`

2. For each instance you need to create 'config, data, and logs' folders. e.g. create config1, config2, ...

3. You may change '[cluster.name](http://cluster.name), [node.name](http://node.name), path.data, path.logs and http.port' in config files "elasticsearch.yml" in config1 and config2 folders accordingly

---

<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:** [May 2, 2017, 1:32pm UTC](https://discuss.elastic.co/t/how-to-create-multiple-running-instances-of-elasticsearch-on-a-sever-but-on-different-ports/80818/4 "2017-05-02T13:32:11Z")

</div>

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