# How to set custom env variable in kibana.yml

**URL:** <https://discuss.elastic.co/t/how-to-set-custom-env-variable-in-kibana-yml/79855>\
**Category:** Kibana\
**Created:** [March 24, 2017, 7:26am UTC](https://discuss.elastic.co/t/how-to-set-custom-env-variable-in-kibana-yml/79855 "2017-03-24T07:26:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajkumar\_E](https://avatars.discourse-cdn.com/v4/letter/r/9de053/32.png) [@Rajkumar\_E](https://discuss.elastic.co/u/Rajkumar_E)\
**Post date:** [March 24, 2017, 7:26am UTC](https://discuss.elastic.co/t/how-to-set-custom-env-variable-in-kibana-yml/79855/1 "2017-03-24T07:26:45Z")

</div>

I need to assign **server.host** and **elasticsearch.url** our custom env varible

this is my env variable MY\_IP.

I need to assign this variable has a serverhost and elasticsearch.url , so i tried below way

**kibana.yml**

```
user_dir: &docker_ip ${MY_IP}
server.host: "%{*docker_ip}"

elasticsearch.url: "http://%{*docker_ip}:9200"

```

its not working for me, Suggest me how to set our custom env varible to kibana configuration.

---

<div class="post-metadata">

**Author:** ![Stacey\_Gammon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stacey_gammon/32/14025_2.png) [@Stacey\_Gammon](https://discuss.elastic.co/u/Stacey_Gammon)\
**Post date:** [March 24, 2017, 3:29pm UTC](https://discuss.elastic.co/t/how-to-set-custom-env-variable-in-kibana-yml/79855/2 "2017-03-24T15:29:11Z")

</div>

It currently isn't possible to use environment variables in kibana.yml, but you might be able to use the alternative approach outlined here: [Using environment variables in kibana.yml](https://discuss.elastic.co/t/using-environment-variables-in-kibana-yml/41307) by passing the parameters on the command line.

Something like:

```auto
bin/kibana --elasticsearch.url="http://${DOCKER_IP}:9200" --server.host="${DOCKER_IP}"

```

---

<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:** [April 21, 2017, 3:29pm UTC](https://discuss.elastic.co/t/how-to-set-custom-env-variable-in-kibana-yml/79855/3 "2017-04-21T15:29:23Z")

</div>

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