# Issue setting Server BasePath via Env Variable

**URL:** <https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131>\
**Category:** Kibana\
**Created:** [February 23, 2017, 1:45am UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131 "2017-02-23T01:45:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicksoft](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@musicksoft](https://discuss.elastic.co/u/musicksoft)\
**Post date:** [February 23, 2017, 1:45am UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/1 "2017-02-23T01:45:46Z")

</div>

I'm trying to set the server basepath via a SERVER\_BASEPATH environment variable on Kibana 5.2.1. The value does not appear to be picked up. I can set it via server.basePath in Kibana.yml fine. I can also change other environment variables such as ELASTICSEARCH\_URL and Kibana reads these values fine.

I am following this guide:  
[https://www.elastic.co/guide/en/kibana/current/\_configuring\_kibana\_on\_docker.html](https://www.elastic.co/guide/en/kibana/current/_configuring_kibana_on_docker.html)

Any assistance would be appreciated as using env variables is more convenient in our environment.  
Thanks.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [February 23, 2017, 9:56am UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/2 "2017-02-23T09:56:27Z")

</div>

Hi @musicksoft,

I just tried to reproduce your problem by running

```
 docker run -e SERVER_BASEPATH=/foo -p 5601:5601 --link elasticsearch docker.elastic.co/kibana/kibana:5.2.1

```

but it worked fine for me. Could you provide more details about your deployment environment and the way you are starting the container?

---

<div class="post-metadata">

**Author:** ![musicksoft](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@musicksoft](https://discuss.elastic.co/u/musicksoft)\
**Post date:** [February 23, 2017, 6:05pm UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/3 "2017-02-23T18:05:33Z")

</div>

Hi, thanks for the reply. I'm using the default Docker registry and running:

docker run -e SERVER\_BASEPATH=/foo -p 5601:5601 --link elasticsearch kibana:5.2.1

This image appears not to support all the env variables. I switched to try the [docker.elastic.co](http://docker.elastic.co) image, but it has XPack installed which we are not currently using.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [February 24, 2017, 8:53pm UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/4 "2017-02-24T20:53:10Z")

</div>

The image in the official docker registry is not created and unsupported by Elastic!

It is correct that the official docker image at `docker.elastic.co/kibana/kibana:5.2.1` includes X-Pack. If you don't want to use the X-Pack features you can disable them by setting

- `xpack.security.enabled: false` or the environment variable `XPACK_SECURITY_ENABLED=false`
- `xpack.monitoring.enabled: false` or the environment variable `XPACK_MONITORING_ENABLED=false`

in the `kibana.yml` (and the `elasticsearch.yml` if you're running Elasticsearch from the image at `docker.elastic.co/elasticsearch/elasticsearch:5.2.1`). You might also choose to use X-Pack with the free basic license which still provides quite some [advantages](https://www.elastic.co/subscriptions) such as single-cluster monitoring, search profiling and improved map zoom levels.

---

<div class="post-metadata">

**Author:** ![musicksoft](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@musicksoft](https://discuss.elastic.co/u/musicksoft)\
**Post date:** [February 28, 2017, 5:48pm UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/5 "2017-02-28T17:48:19Z")

</div>

Hi, I switched over to the [elastic.co](http://elastic.co) images, but now my problem is disabling Xpack security via environment variables. I am able to disable it via the kibana.yml and elasticsearch.yml config files. However, when i use XPACK\_SECURITY\_ENABLED=false it is not disabled. I get a basic auth challenge in Kibana and this error in elasticsearch:  
Error: [security\_exception] missing authentication token for REST request [/content-index-read/content/\_search], with { header={ WWW-Authenticate="Basic realm="security" charset="UTF-8"" } }

I'm launching the images using compose:  
elasticsearch:  
image: [docker.elastic.co/elasticsearch/elasticsearch:5.2.1](http://docker.elastic.co/elasticsearch/elasticsearch:5.2.1)  
ports:  
- 9200:9200  
environment:  
- XPACK\_SECURITY\_ENABLED=false  
- XPACK\_MONITORING\_ENABLED=false  
kibana:  
image: [docker.elastic.co/kibana/kibana:5.2.1](http://docker.elastic.co/kibana/kibana:5.2.1)  
ports:  
- 5601:5601  
environment:  
- XPACK\_SECURITY\_ENABLED=false  
- XPACK\_MONITORING\_ENABLED=false

I have confirmed that the environment variables have been set within the container.  
Any help would be great.

---

<div class="post-metadata">

**Author:** ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)\
**Post date:** [March 8, 2017, 4:54pm UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/6 "2017-03-08T16:54:38Z")

</div>

Sorry for the long delay, @musicksoft. It looks like the way the wrapper script of the Elasticsearch docker image is parsing the environment variables differently from the Kibana image. The variable needs to have the same name as the setting in the `elasticsearch.yml` would have. In this case is it would be

```
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.1
environment:
  - xpack.security.enabled=false
  - xpack.monitoring.enabled=false
```

---

<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 5, 2017, 4:54pm UTC](https://discuss.elastic.co/t/issue-setting-server-basepath-via-env-variable/76131/7 "2017-04-05T16:54:48Z")

</div>

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