# Change default index shard count

**URL:** https://discuss.elastic.co/t/change-default-index-shard-count/40887
**Category:** Elasticsearch
**Created:** [February 3, 2016, 4:51pm UTC](https://discuss.elastic.co/t/change-default-index-shard-count/40887 "2016-02-03T16:51:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kaufusihm](https://avatars.discourse-cdn.com/v4/letter/k/bcef8e/32.png) [@Kaufusihm](https://discuss.elastic.co/u/Kaufusihm)
#### Post date: [February 3, 2016, 4:51pm UTC](https://discuss.elastic.co/t/change-default-index-shard-count/40887/1 "2016-02-03T16:51:33Z")

</div>

I'm trying to change the default value for shard count in my elasticsearch nodes. The old config file used to have the commented out section that explained this.

How do I change this setting?  
What is the syntax or line I need to add to my .yml file to change default count?

---

<div class="post-metadata">

### Author: ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)
#### Post date: [February 3, 2016, 5:50pm UTC](https://discuss.elastic.co/t/change-default-index-shard-count/40887/2 "2016-02-03T17:50:07Z")

</div>

In your elasticsearch.yml file, to change the default for all indices:

index.number\_of\_shards: 5

---

<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 5, 2017, 11:19pm UTC](https://discuss.elastic.co/t/change-default-index-shard-count/40887/3 "2017-07-05T23:19:13Z")

</div>


