# Unable to start Kibana - Port 5601 already in use

**URL:** <https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171>\
**Category:** Kibana\
**Created:** [April 2, 2020, 8:05am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171 "2020-04-02T08:05:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moritz\_Kiesewetter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moritz_kiesewetter/32/51243_2.png) [@Moritz\_Kiesewetter](https://discuss.elastic.co/u/Moritz_Kiesewetter)\
**Post date:** [April 2, 2020, 8:05am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/1 "2020-04-02T08:05:54Z")

</div>

Hello Community -  
after i enabled HTTPs on my Kibana Server - i cannot get it to start.  
When i review the logs - i see the following error message:

`{"type":"log","@timestamp":"2019-10-08T13:04:50Z","tags":["fatal","root"],"pid":14383,"message":"Error: Port 5601 is already in use. Another instance of Kibana may be running!\n at Root.shutdown (/usr/share/kibana/src/core/server/root/index.js:53:26)\n at Root.start (/usr/share/kibana/src/core/server/root/index.js:45:24)\n at process._tickCallback (internal/process/next_tick.js:68:7)\n at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)\n at startup (internal/bootstrap/node.js:283:19)\n at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)"`

So i checked which PID is using that Port:

```
[root@kibanaserver kibana]# lsof -i :5601
[root@kibanaserver kibana]#

```

So there is no process active on this Port - why can't it bind to it then?

I check if there was another Process of Kibana Running:

```
[root@kibanaserver kibana]# ps aux | grep kibana
root 17751 0.0 0.0 9088 672 pts/0 S+ 10:00 0:00 grep --color=auto kibana
[root@kibanaserver kibana]# kill -9 17751
bash: kill: (17751) - No such process
[root@kibanaserver kibana]# ps aux | grep kibana
root 17897 0.0 0.0 9088 668 pts/0 S+ 10:01 0:00 grep --color=auto kibana

```

as you can see the process is being forked as soon as i kill it - can anybody help me? I don't know how to get rid of that Error.

I'm using CentOS7 with Kibana (as well as Elasticsearch) v7.6.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Moritz\_Kiesewetter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moritz_kiesewetter/32/51243_2.png) [@Moritz\_Kiesewetter](https://discuss.elastic.co/u/Moritz_Kiesewetter)\
**Post date:** [April 2, 2020, 8:54am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/2 "2020-04-02T08:54:23Z")

</div>

After i outcommented the following settings in Kibana.yml it started normally again:

```
#server.ssl.enabled: true
#server.ssl.certificate: /etc/kibana/certs/kibana-server.csr
#server.ssl.key: /etc/kibana/certs/kibana-server.key

```

Why are they causing the error? Any ideas?

---

<div class="post-metadata">

**Author:** ![Moritz\_Kiesewetter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moritz_kiesewetter/32/51243_2.png) [@Moritz\_Kiesewetter](https://discuss.elastic.co/u/Moritz_Kiesewetter)\
**Post date:** [April 2, 2020, 9:32am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/3 "2020-04-02T09:32:39Z")

</div>

Ok i actually saw that there are no recent logs written to the file - so there seems to be a whole other Problem -

```
Apr 02 11:14:20 mykibana kibana[30287]: {"type":"log","@timestamp":"2020-04-02T09:14:20Z","tags":["fatal","root"],"pid":30287,"message":"Error: error:0909006C:PEM routines:get_name:no start line\n at Object.createSecureContext (_tls_common.js:135:17)\n at Server (_tls_wrap.js:873:27)\n at new Server (http
Apr 02 11:14:20 mykibana kibana[30287]: FATAL Error: error:0909006C:PEM routines:get_name:no start line
```

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [April 2, 2020, 9:35am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/4 "2020-04-02T09:35:01Z")

</div>

The process your are trying to kill in your original post is just the grep command looking for the string "kibana" - it basically finds itself.

From your config it looks like you are using the wrong certificate format. Make sure to pass it in as a pem file. You can find more info here: [https://www.elastic.co/guide/en/kibana/current/configuring-tls.html](https://www.elastic.co/guide/en/kibana/current/configuring-tls.html)

---

<div class="post-metadata">

**Author:** ![Moritz\_Kiesewetter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moritz_kiesewetter/32/51243_2.png) [@Moritz\_Kiesewetter](https://discuss.elastic.co/u/Moritz_Kiesewetter)\
**Post date:** [April 2, 2020, 9:55am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/5 "2020-04-02T09:55:03Z")

</div>

Hey @flash1293 thanks for your reply.

I indeed did use the wrong one - i simply forgot to sign the csr with my ca.

to generate my Kibana Certificate i used and edited version of:

`bin/elasticsearch-certutil csr -name kibana-server -dns some-website.com,www.some-website.com`

A week ago i setup encryption on my Elasticsearch cluster - how do i use the CA which i created there to sign the csr?

Or can i simply go with the

`bin/elasticsearch-certutil cert --ca my-kibana.p12`

then transform the outcome to .pem and use that one instead?

---

<div class="post-metadata">

**Author:** ![Moritz\_Kiesewetter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moritz_kiesewetter/32/51243_2.png) [@Moritz\_Kiesewetter](https://discuss.elastic.co/u/Moritz_Kiesewetter)\
**Post date:** [April 2, 2020, 11:17am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/6 "2020-04-02T11:17:30Z")

</div>

I've solved it by generating a new self-signed certificate via the OpenSSL Command and copying the .pem and the private key to config folder. After that i edited the kibana.yml file and restarted the service.

Now it's encrypted.

---

<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 30, 2020, 11:17am UTC](https://discuss.elastic.co/t/unable-to-start-kibana-port-5601-already-in-use/226171/7 "2020-04-30T11:17:32Z")

</div>

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