Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Know it before you install
Kibana stores nothing big itself — it reads from Elasticsearch and keeps its own settings (dashboards, saved searches, alerts) as saved objects in Elasticsearch. A data view tells Kibana which indices to search (for example logs-*).
| Item | Value |
|---|---|
| Package | kibana (same Elastic repository and version as Elasticsearch) |
| Service | kibana.service |
| Config | /etc/kibana/kibana.yml |
| Tools | /usr/share/kibana/bin/ (kibana-setup, kibana-verification-code, kibana-encryption-keys) |
| Logs | /var/log/kibana/ and journalctl -u kibana |
| Port | 5601/tcp |
What you need: a running, secured Elasticsearch (see the Elasticsearch guide) of the same version, and 2 GB RAM for Kibana.
Install on RHEL, Rocky, Alma and Fedora
With the Elasticsearch repository from the Elasticsearch guide:
dnf -y install --enablerepo=elasticsearch kibanaInstall on Ubuntu and Debian
With the Elastic apt repository from the Elasticsearch guide:
apt-get update
apt-get install -y kibana
apt-mark hold kibanaConnect Kibana to Elasticsearch
Make an enrollment token on the Elasticsearch node (valid 30 minutes) and give it to Kibana:
/usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
eyJ2ZXIiOiI5LjEuNSIsImFkciI6WyIxMC4wLjIuMTE6OTIwMCJdLCJmZ3IiOiI…
/usr/share/kibana/bin/kibana-setup --enrollment-token eyJ2ZXIiOiI5LjEuNSIsImFkciI6…
✔ Kibana configured successfully.kibana-setup writes the Elasticsearch address, the CA certificate and a service account token into kibana.yml. (Other way: start Kibana, open the UI, paste the token, and enter the code from kibana-verification-code.)
First configuration: the settings to make first
Create the encryption keys (needed for alerts, reports and saved secrets):
/usr/share/kibana/bin/kibana-encryption-keys generate -q
xpack.encryptedSavedObjects.encryptionKey: 3f5c…
xpack.reporting.encryptionKey: 9a1b…
xpack.security.encryptionKey: 7d2e…Add them and the rest to kibana.yml (keep the lines that kibana-setup added):
server.host: "127.0.0.1"
server.port: 5601
server.publicBaseUrl: "https://kibana.example.com"
server.name: "kibana-1"
logging.appenders.file.type: file
logging.appenders.file.fileName: /var/log/kibana/kibana.log
logging.appenders.file.layout.type: json
logging.root.appenders: [default, file]
xpack.encryptedSavedObjects.encryptionKey: "3f5c…"
xpack.reporting.encryptionKey: "9a1b…"
xpack.security.encryptionKey: "7d2e…"| Setting | Why |
|---|---|
server.host: 127.0.0.1 | Only Nginx (HTTPS) is public. |
server.publicBaseUrl | Correct links in alerts, reports and emails; removes a warning. |
| The three encryption keys | Alerts, reports and stored credentials work and survive restarts. Keep them in your secret store. |
| File logging | Logs for problems with startup and plugins. |
Start Kibana and put Nginx with TLS in front:
systemctl daemon-reload
systemctl enable --now kibana
journalctl -u kibana -fserver {
listen 443 ssl;
server_name kibana.example.com;
ssl_certificate /etc/letsencrypt/live/kibana.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/kibana.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:5601;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}Open https://kibana.example.com and log in as elastic — then create your own users.
Users, roles and data views
In Stack Management → Users / Roles: create a role with read rights on logs-* and give it to people; admins get more. Do not share elastic.
In Stack Management → Data Views → Create: name logs-*, time field @timestamp. Now Discover shows the logs.
Daily use: search, dashboards and alerts
Search in Discover with KQL:
host.name : "web1"
log.level : "error" and service.name : "shop-api"
http.response.status_code >= 500
event.action : "ssh_login" and event.outcome : "failure"
message : "timeout" and not host.name : "test-*"
source.ip : 203.0.113.0/24- Dashboards: Lens visualizations of errors per service, requests per status code, top source IPs.
- Alerts (Stack Management → Rules): "more than 50 failed logins in 5 minutes" → email, Slack, Teams or webhook.
- Index Lifecycle Policies: see and edit ILM (delete old logs).
- Dev Tools: run Elasticsearch API calls (
GET _cluster/health) from the browser.
Real uses at work:
- Incident search across all servers; dashboards for operations and security.
- Elastic Security: detection rules, timelines and cases (SIEM).
- Fleet: manage Elastic Agents on all hosts from one place.
Make it safe
Security checklist:
- Kibana on
127.0.0.1behind Nginx with HTTPS; never 5601 open to the internet. - Personal users or SSO (SAML/OIDC);
elasticonly for emergencies. - Roles with least privilege (read-only for most people; restrict indices and spaces).
- Encryption keys set and backed up (in a secret store).
- Same version as Elasticsearch; update both together.
Update and remove
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
Kibana server is not ready yet | Kibana can not reach or log in to Elasticsearch, or version mismatch. | journalctl -u kibana; check elasticsearch.hosts, the CA and the token; same versions. |
| Enrollment token rejected | It expired (30 minutes) or the wrong node. | Make a new token with elasticsearch-create-enrollment-token -s kibana. |
Warning about server.publicBaseUrl | Not set. | Set it to the HTTPS address. |
| Alerts/reports do not work: "encryption key" error | Encryption keys missing or changed. | Set the three keys (same on every Kibana instance); restart. |
| Blank page or redirect loop behind Nginx | Missing headers or WebSocket upgrade. | Use the proxy block above; publicBaseUrl with https. |
| 502 from Nginx on RHEL | SELinux blocks the proxy. | setsebool -P httpd_can_network_connect 1. |
| Discover shows "No results" | Wrong data view or time range. | Check the index pattern and the time picker (top right). |
Next steps
- The data store: Install and set up Elasticsearch. Ship logs: Fluent Bit.
- The proxy in front: Install and set up Nginx, certificates: Certbot.
- The Grafana way: Grafana + Loki.
- Practise log investigation: Lab: investigate an SSH brute-force attack from the logs.
1Kibana says "Kibana server is not ready yet". Where do you look first?
journalctl -u kibana — usually it can not reach or log in to Elasticsearch, or the versions differ.
2Why set xpack.encryptedSavedObjects.encryptionKey?
Alerts and saved credentials are encrypted with it; without a fixed key they break after a restart.