How To Install Elastic Stack 8 On Debian 11 - Linux Tutorial - Atetux
How To Install Elastic Stack 8 On Debian 11 - Linux Tutorial - Atetux
In this tutorial, we’ll install Elasticsearch, Kibana, and Logstash which is usually called Elastic
Stack. Elasticsearch is usually used for centralized logging, its competitor like Datadog,
Sumologic etc.
When installing Elastic Stack, we must use the same version across all applications. In this
tutorial, we’ll install Kibana 8.0.1, Elasticsearch 8.0.1 and Logstash 8.0.1, which is the latest
version at the time of this writing.
System Requirement
The minimum requirement for Elastic Stack installation
2 GB Memory
1 CPU
8 GB Memory
256 GB SSD
1. Initial Setup
After the Debian 11 installation is complete, no matter if you use the template from your
cloud provider or install the minimalist/desktop version, this tutorial should work for you as
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 1/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
well.
Install Dependency
sudo apt install curl socat wget gnupg apt-transport-https -y
timedatectl
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 2/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
wget https://raw.githubusercontent.com/acmesh-official/acme.sh/master/acme.sh
source ~/.bashrc
wait until it finish and show the path of the SSL files
java --version
# output
# Config File/Folder
2. Install Elasticsearch
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 4/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
TLS for the transport and HTTP layers is enabled and configured.
The generated password for the elastic built-in superuser is : 9mmWuutjuPIJ+eA8odGV
# enable on boot
{
"name" : "debian11",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "zVIG9HmcRXStjNE8OXVZtg",
"version" : {
"number" : "8.0.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "801d9ccc7c2ee0f2cb121bbe22ab5af77a902372",
"build_date" : "2022-02-24T13:55:40.601285296Z",
"build_snapshot" : false,
"lucene_version" : "9.0.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 5/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
# example
eyJ2ZXIiOiI4LjAuMSIsImFkciI6WyIxOTIuMTY4Ljg4LjM1OjkyMDAiXSwiZmdyIjoiZTA5ODUyYjZiYzc2NzNkODUxMTY5Y
we’ll use this code to initial install Kibana, so it can connect to Elasticsearch.
3. Install Kibana
Kibana is the UI for Elasticsearch, we can make a dashboard, alert, and monitoring from
Kibana. It’s so powerful and easy to use. From my experience, you can create a dashboard
from scratch in less than a week, even for beginners.
Update the Kibana config, to enable access from outside the server. Update the following
values
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 6/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
server.port: 5601
server.host: "0.0.0.0"
the start Kibana service since by default Elasticsearch repository didn’t start the service after
installation.
# enable on boot
check the log to get the initial installation link and code
open the link, but replace the 0.0.0.0 with your Kibana IP address.
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 7/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
put the Kibana token that we generate earlier, the click Configure Elastic
Wait till the login page appear, usually takes less than 2 minutes. Then use the username
elastic and the password generated after Elastisearch installation
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 8/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 9/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
server {
server_name elasticsearch.prod.atetux.com;
client_max_body_size 30M;
location / {
proxy_redirect off;
proxy_pass https://localhost:9200;
ssl_certificate /root/.acme.sh/elasticsearch.prod.atetux.com/fullchain.cer;
ssl_certificate_key /root/.acme.sh/elasticsearch.prod.atetux.com/elasticsearch.prod.atetux.co
}
server {
server_name kibana.prod.atetux.com;
client_max_body_size 30M;
location / {
proxy_redirect off;
proxy_pass http://localhost:5601;
ssl_certificate /root/.acme.sh/kibana.prod.atetux.com/fullchain.cer;
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 10/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
ssl_certificate_key /root/.acme.sh/kibana.prod.atetux.com/kibana.prod.atetux.com.key;
server.port: 5601
server.host: "localhost"
Restart Kibana
Restart Kibana
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 11/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
Elasticsearch
If you prefer using command line, replace localhost:9200 with domain name
5. Install Logstash
After we have elasticsearch and kibana, now time to send some logs there. For this purpose,
logstash is the app that can ship logs from any Linux distro to Elasticsearch
If you have multiple servers, you just need to add the Elasticsearch repository and install the
logstash using the command line.
Logstash run as user logstash, to able send the logs logstash user will need permission
to read the file/directory. For example we want logstash to send SSH logs to Elasticsearch,
the log for SSH is at /var/log/auth.log, check the file permission
sudo ls -l /var/log/auth.log
the group owner is adm, just add that group to logstash user
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 12/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
# verify
sudo id logstash
# output
input {
file {
path => [
"/var/log/auth.log"
}
output {
elasticsearch {
Restart logstash
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 13/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
1. Using curl
2. Using Kibana
For the first add the index to Kibana data view from menu Kibana -> Stack Management
-> Kibana -> Data Views
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 14/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
2 Comments
DNS setup
JUNE 15, 2022 / 7:13 PM REPLY
Excuse me, how am I supposed to setup DNS for Elasticsearch and Kibana with given Tipe,
Name and Content (IP)?
Jack
JUNE 17, 2022 / 8:55 PM REPLY
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 15/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
What do you mean by setup DNS for elasticsearch? Care to elaborate more
Leave a Reply
Your email address will not be published. Required fields are marked *
Name *
Email *
Website
Add Comment
Save my name, email, and website in this browser for the next time I comment.
Post Comment
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 16/17
12/9/22, 12:55 How To Install Elastic Stack 8 on Debian 11 - Linux Tutorial - Atetux
https://atetux.com/how-to-install-elastic-stack-8-on-debian-11 17/17