# Custom template in config/templates

**URL:** <https://discuss.elastic.co/t/custom-template-in-config-templates/51168>\
**Category:** Elasticsearch\
**Created:** [May 27, 2016, 2:53pm UTC](https://discuss.elastic.co/t/custom-template-in-config-templates/51168 "2016-05-27T14:53:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgohin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mgohin/32/9997_2.png) [@mgohin](https://discuss.elastic.co/u/mgohin)\
**Post date:** [May 27, 2016, 2:53pm UTC](https://discuss.elastic.co/t/custom-template-in-config-templates/51168/1 "2016-05-27T14:53:45Z")

</div>

Hi,

Is it still possible in 2.3.3 to use config/templates folder to store custom templates ? I saw in 1.6 doc that it was possible :

[https://www.elastic.co/guide/en/elasticsearch/reference/1.6/indices-templates.html](https://www.elastic.co/guide/en/elasticsearch/reference/1.6/indices-templates.html)

> For example, a file called template\_1.json can be placed under config/templates and it will be added if it matches an index

We are trying hard but do not manage to make it work, we place a mytemplate.json file with a copy paste definition of the default one (the one adding .raw fields).

When we use the API to PUT the template, it works.

Our need is to use this folder if still possible, or call API to PUT the template in the docker, but there we can't call it because the entrypoint doesn't give back hand.

Thanks for your help 🙂

---

<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:** [May 27, 2016, 3:21pm UTC](https://discuss.elastic.co/t/custom-template-in-config-templates/51168/2 "2016-05-27T15:21:35Z")

</div>

The ability to configure index templates through files has been [deprecated in Elasticsearch 2.x](https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking_20_mapping_changes.html#_mappings_in_config_files_not_supported).

---

<div class="post-metadata">

**Author:** ![mgohin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mgohin/32/9997_2.png) [@mgohin](https://discuss.elastic.co/u/mgohin)\
**Post date:** [May 27, 2016, 3:35pm UTC](https://discuss.elastic.co/t/custom-template-in-config-templates/51168/3 "2016-05-27T15:35:35Z")

</div>

That's what we though.

We tricked a command in docker to do a curl PUT **after** elasticsearch is launched, ugly but works 😉

---

<div class="post-metadata">

**Author:** ![mgohin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mgohin/32/9997_2.png) [@mgohin](https://discuss.elastic.co/u/mgohin)\
**Post date:** [May 31, 2016, 8:52am UTC](https://discuss.elastic.co/t/custom-template-in-config-templates/51168/4 "2016-05-31T08:52:01Z")

</div>

FYI, here is our uggly-but-working trick

```
nohup wget --retry-connrefused http://127.0.0.1:9200/_template && 
curl -H "Content-Type: application/json" -XPUT 
--data @/usr/share/elasticsearch/config/templates/my-template_default.json 
http://127.0.0.1:9200/_template/my-template-default &
//then we call the blocking entrypoint
```

---

<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, 10:47pm UTC](https://discuss.elastic.co/t/custom-template-in-config-templates/51168/5 "2017-07-05T22:47:46Z")

</div>


