# Install elasticsearch in a running docker container

**URL:** https://discuss.elastic.co/t/install-elasticsearch-in-a-running-docker-container/224743
**Category:** Elasticsearch
**Tags:** docker
**Created:** [March 23, 2020, 10:01pm UTC](https://discuss.elastic.co/t/install-elasticsearch-in-a-running-docker-container/224743 "2020-03-23T22:01:58Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Chandrak](https://avatars.discourse-cdn.com/v4/letter/c/a9a28c/32.png) [@Chandrak](https://discuss.elastic.co/u/Chandrak)
#### Post date: [March 23, 2020, 10:01pm UTC](https://discuss.elastic.co/t/install-elasticsearch-in-a-running-docker-container/224743/1 "2020-03-23T22:01:58Z")

</div>

There is a lot of documentation on installing ELK using dockers e.g. [https://github.com/deviantony/docker-elk](https://github.com/deviantony/docker-elk)

However, I want to install ELK in a running docker container.

1. I followed the instructions here  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/targz.html) to install elasticsearch in a running container

2. I got an error - [java.lang.RuntimeException: can not run elasticsearch as root]. I followed instructions here to solve this. [https://stackoverflow.com/questions/34920801/how-to-run-elasticsearch-2-1-1-as-root-user-in-linux-machine](https://stackoverflow.com/questions/34920801/how-to-run-elasticsearch-2-1-1-as-root-user-in-linux-machine).

3. Now, I am getting this error -  
main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")  
at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)

How to resolve this?

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 23, 2020, 11:59pm UTC](https://discuss.elastic.co/t/install-elasticsearch-in-a-running-docker-container/224743/2 "2020-03-23T23:59:43Z")

</div>

Is there a reason you cannot use the existing containers that have Elasticsearch already installed?

---

<div class="post-metadata">

### Author: ![Chandrak](https://avatars.discourse-cdn.com/v4/letter/c/a9a28c/32.png) [@Chandrak](https://discuss.elastic.co/u/Chandrak)
#### Post date: [March 24, 2020, 1:09am UTC](https://discuss.elastic.co/t/install-elasticsearch-in-a-running-docker-container/224743/3 "2020-03-24T01:09:19Z")

</div>

I already have a container running with some other deep learning packages. I want to use elasticsearch for data pre-processing steps.

---

<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, 2020, 1:09am UTC](https://discuss.elastic.co/t/install-elasticsearch-in-a-running-docker-container/224743/4 "2020-04-21T01:09:20Z")

</div>

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