# How to start kibana from docker

**URL:** <https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285>\
**Category:** Kibana\
**Created:** [July 10, 2018, 7:22am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285 "2018-07-10T07:22:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bamboo2222](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bamboo2222](https://discuss.elastic.co/u/bamboo2222)\
**Post date:** [July 10, 2018, 7:22am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/1 "2018-07-10T07:22:02Z")

</div>

Hi, I want to develop kibana from docker and the kibana source code(adding some plugins and change some source code) and try to write a dockerfile to start it.

I have a server running elasticsearch. However, when I run the image it always stop at the "optimization success" and only a few times can start normally.

I run the kibana on this command : docker run -e "ELASTICSEARCH\_URL= [server ip address]" [kibana image name]

Can anyone give me some advice? Thank you!

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [July 10, 2018, 7:54am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/2 "2018-07-10T07:54:57Z")

</div>

Hi @bamboo2222,

What docker image exactly you use and what is your OS?

Also what you mean by `it always stop at the "optimization success"`?

Thanks,  
Oleg

---

<div class="post-metadata">

**Author:** ![bamboo2222](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bamboo2222](https://discuss.elastic.co/u/bamboo2222)\
**Post date:** [July 10, 2018, 8:18am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/3 "2018-07-10T08:18:00Z")

</div>

Thanks for the reply. 🙂  
I'm running my program on Win10, and build the docker image from the source code of kibana 6.2.4.  
And when I run kibana, the last two logs are:

{"type":"log","@timestamp":"2018-07-10T08:13:48Z","tags":["info","optimize"],"pid":32,"bundles":["sense-tests","kibana","stateSessionStorageRedirect","status\_page","timelion"],"status":"success","seconds":"57.03","message":"Optimization success in 57.03 seconds"}  
{"type":"log","@timestamp":"2018-07-10T08:13:53Z","tags":["info","optimize"],"pid":32,"bundles":["sense-tests","kibana","stateSessionStorageRedirect","status\_page","timelion"],"status":"success","seconds":"2.97","message":"Optimization success in 2.97 seconds"}

And it always stop here and no other logs display. When I try to access "localhost:5601", there is no connection.

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [July 10, 2018, 8:26am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/4 "2018-07-10T08:26:51Z")

</div>

Ah, you're not using [official docker image](https://www.elastic.co/guide/en/kibana/6.3/docker.html)?

> And it always stop here and no other logs display.

That sounds correct, you shouldn't see anything else until you start interacting with Kibana. Are you sure you've exposed 5601 port from docker container (like [here](https://github.com/elastic/kibana-docker/blob/master/templates/Dockerfile.j2#L20))?

Best,  
Oleg

---

<div class="post-metadata">

**Author:** ![bamboo2222](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bamboo2222](https://discuss.elastic.co/u/bamboo2222)\
**Post date:** [July 10, 2018, 8:37am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/6 "2018-07-10T08:37:42Z")

</div>

Yes, I think I do expose 5601 port.  
My dockerfile is like this,

FROM node  
RUN set -x  
&& git clone --branch v6.2.4 [https://github.com/elastic/kibana.git](https://github.com/elastic/kibana.git)  
&& cd kibana  
#automatically delete container files when stopped  
&& rm -rf .git  
&& npm install   
&& sed -ri "s!^(#\s\*)?(server.host:).\*!\2 '0.0.0.0'!" /kibana/config/kibana.yml   
&& grep -q "^server.host: '0.0.0.0'$" /kibana/config/kibana.yml \

&& sed -ri "s!^(#\s\*)?(elasticsearch.url:).\*!\2 '[http://elasticsearch.url:9200](http://elasticsearch.url:9200)'!" /kibana/config/kibana.yml   
&& grep -q "^elasticsearch.url: '[http://elasticsearch:9200](http://elasticsearch:9200)'$" /kibana/config/kibana.yml   
EXPOSE 5601  
WORKDIR /kibana  
VOLUME /kibana/plugins  
CMD ["npm", "start"]

One more question, if I want to change the source code and add plugins to kibana, can I use the official docker image to achieve this? Thanks!

---

<div class="post-metadata">

**Author:** ![azasypkin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/azasypkin/32/42216_2.png) [@azasypkin](https://discuss.elastic.co/u/azasypkin)\
**Post date:** [July 10, 2018, 8:48am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/7 "2018-07-10T08:48:12Z")

</div>

> [@bamboo2222](#):
>
> One more question, if I want to change the source code and add plugins to kibana, can I use the official docker image to achieve this?

INAL, but generally you can do whatever license permits, there are two of them used in Kibana, see [Image Types](https://www.elastic.co/guide/en/kibana/current/docker.html#image-type) for more details and also [license for Docker image itself](https://github.com/elastic/kibana-docker/blob/master/LICENSE).

And [We Opened X-Pack](https://www.elastic.co/products/x-pack/open) may be interesting to you too 🙂

Best,  
Oleg

---

<div class="post-metadata">

**Author:** ![bamboo2222](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bamboo2222](https://discuss.elastic.co/u/bamboo2222)\
**Post date:** [July 11, 2018, 1:06am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/8 "2018-07-11T01:06:03Z")

</div>

Thanks ! 🙂

---

<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:** [August 8, 2018, 1:06am UTC](https://discuss.elastic.co/t/how-to-start-kibana-from-docker/139285/9 "2018-08-08T01:06:05Z")

</div>

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