# Kibana should not be run as root. Use --allow-root to continue

**URL:** <https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253>\
**Category:** Kibana\
**Created:** [February 13, 2020, 4:13pm UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253 "2020-02-13T16:13:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dsv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dsv/32/47173_2.png) [@dsv](https://discuss.elastic.co/u/dsv)\
**Post date:** [February 13, 2020, 4:13pm UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253/1 "2020-02-13T16:13:37Z")

</div>

CentOS Linux release 7.7.1908 (Core)

I have the lastest version of the kibana installed from the elasticsearch repo by yum:  
kibana-7.5.2-1.x86\_64

When I try to install a plugin:

# /usr/share/kibana/bin/kibana-plugin install $url

got error:  
Kibana should not be run as root. Use --allow-root to continue.  
Ok, trying the more secure way:

su -c '/usr/share/kibana/bin/kibana-plugin install $url' kibana  
got error:  
This account is currently not available.

I know the web application with root owner on files is the gift for hackers and pentesters.  
So what is the right (recommended) way to install kibana plugins if the kibana user cant be used?

Best regards,  
Serg

---

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [February 13, 2020, 9:20pm UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253/2 "2020-02-13T21:20:14Z")

</div>

It sounds like you don't have a "kibana" user. The recommendation here is to use any user other than root. Do you have any non-root users on the machine? If not, I would recommend creating one and install/run Kibana using that.

---

<div class="post-metadata">

**Author:** ![dsv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dsv/32/47173_2.png) [@dsv](https://discuss.elastic.co/u/dsv)\
**Post date:** [February 14, 2020, 7:10am UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253/3 "2020-02-14T07:10:09Z")

</div>

As i wrote I've kibana from standart elasticsearch repo:

# repoquery -i kibana

Name : kibana  
Version : 7.6.0  
Release : 1  
Architecture: x86\_64  
Size : 709167330  
Packager : Kibana Team [info@elastic.co](mailto:info@elastic.co)  
Group : default  
URL : [https://www.elastic.co](https://www.elastic.co)  
Repository : elasticsearch-7.x  
Summary : Explore and visualize your Elasticsearch data  
Source : kibana-7.6.0-1.src.rpm  
Description :  
Explore and visualize your Elasticsearch data

# cat /etc/yum.repos.d/elasticsearch.repo

[elasticsearch-7.x]  
name=Elasticsearch repository for 7.x packages  
baseurl=https://artifacts.elastic.co/packages/7.x/yum  
gpgcheck=1  
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch  
enabled=1  
autorefresh=1  
type=rpm-md

And kibana package created kibana user

# id kibana

uid=997(kibana) gid=995(kibana) groups=995(kibana)

So user is present in the system.

Best regards,  
Serg

---

<div class="post-metadata">

**Author:** ![dsv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dsv/32/47173_2.png) [@dsv](https://discuss.elastic.co/u/dsv)\
**Post date:** [February 14, 2020, 7:21am UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253/4 "2020-02-14T07:21:03Z")

</div>

Installation with non root user shows expected errors (obviously general user cant write files to the kibana folders):

someuser$ /usr/share/kibana/bin/kibana-plugin install $url  
Babel could not write cache to file: /usr/share/kibana/optimize/.babel\_register\_cache.json  
due to a **permission issue**. Cache is disabled.  
Plugin installation was unsuccessful due to error "ENOENT: no such file or directory, mkdir '/usr/share/kibana/plugins/.plugin.installing'"

---

<div class="post-metadata">

**Author:** ![dsv](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dsv/32/47173_2.png) [@dsv](https://discuss.elastic.co/u/dsv)\
**Post date:** [February 17, 2020, 8:11am UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253/5 "2020-02-17T08:11:10Z")

</div>

The right answer:  
su -s /bin/bash -c '/usr/share/kibana/bin/kibana-plugin install $url kibana

I thinks the hint "use for example su -s /bin/bash" can be added to the kibana-plugin script error message because the issue occurs after the package installation with default permissions.

---

<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:** [March 16, 2020, 8:11am UTC](https://discuss.elastic.co/t/kibana-should-not-be-run-as-root-use-allow-root-to-continue/219253/6 "2020-03-16T08:11:11Z")

</div>

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