0
0
ElasticsearchHow-ToBeginner · 4 min read

How to Connect Kibana to Elasticsearch: Simple Setup Guide

To connect Kibana to Elasticsearch, set the elasticsearch.hosts property in the kibana.yml configuration file to your Elasticsearch URL. Then start Kibana, which will use this URL to communicate with Elasticsearch and display your data.
📐

Syntax

The main setting to connect Kibana to Elasticsearch is elasticsearch.hosts in the kibana.yml file.

  • elasticsearch.hosts: Specifies the URL(s) of your Elasticsearch node(s). It can be a single URL or a list.
  • http://localhost:9200: Default URL if Elasticsearch runs locally on port 9200.
  • Additional settings like elasticsearch.username and elasticsearch.password are used if Elasticsearch requires authentication.
yaml
elasticsearch.hosts: ["http://localhost:9200"]
# Optional if security enabled
# elasticsearch.username: "elastic"
# elasticsearch.password: "your_password"
💻

Example

This example shows a basic kibana.yml configuration connecting Kibana to a local Elasticsearch instance without authentication.

yaml
server.port: 5601
server.host: "localhost"
elasticsearch.hosts: ["http://localhost:9200"]
Output
Kibana starts and connects to Elasticsearch at http://localhost:9200 successfully, allowing you to access the Kibana UI at http://localhost:5601.
⚠️

Common Pitfalls

  • Wrong Elasticsearch URL: Using an incorrect host or port will prevent Kibana from connecting.
  • Missing authentication: If Elasticsearch has security enabled, missing username/password causes connection failure.
  • Network issues: Firewalls or network restrictions can block Kibana from reaching Elasticsearch.
  • Version mismatch: Kibana and Elasticsearch versions should be compatible to avoid errors.
yaml
## Wrong way (missing authentication when required):
elasticsearch.hosts: ["http://localhost:9200"]

## Right way (with authentication):
elasticsearch.hosts: ["http://localhost:9200"]
elasticsearch.username: "elastic"
elasticsearch.password: "your_password"
📊

Quick Reference

SettingDescriptionExample
elasticsearch.hostsURL(s) of Elasticsearch nodes["http://localhost:9200"]
elasticsearch.usernameUsername for Elasticsearch authentication"elastic"
elasticsearch.passwordPassword for Elasticsearch authentication"your_password"
server.portPort Kibana listens on5601
server.hostHost Kibana binds to"localhost"

Key Takeaways

Set the elasticsearch.hosts property in kibana.yml to your Elasticsearch URL.
Include username and password if Elasticsearch security is enabled.
Ensure Kibana and Elasticsearch versions are compatible.
Check network connectivity and firewall settings to allow communication.
Start Kibana after configuration to connect and visualize Elasticsearch data.