---
# System prepended metadata

title: ELK Installation

---

# ELK Installation

### Prerequites
sudo apt update 
sudo apt install apt-transport-https 

sudo apt install openjdk-11-jdk 
java --version 

sudo nano /etc/environment 
JAVA_HOME=“/usr/lib/jvm/java-11-openjdk-amd64” 

![](https://i.imgur.com/PflGLlb.png)

source /etc/environment 
echo $JAVA_HOME 

### Elasticsearch Installation
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg 

echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list 

sudo apt-get update
sudo apt-get install elasticsearch 

![](https://i.imgur.com/DP4xUSu.png)

The generated password for the elastic built-in superuser is : NtYYg*jy1NAwCBow0XT8

sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
sudo systemctl status elasticsearch

sudo nano /etc/elasticsearch/elasticsearch.yml
network.host: 0.0.0.0 
discovery.seed_hosts: []
xpack.security.enabled: false
![](https://i.imgur.com/1DOKSCo.png)

![](https://i.imgur.com/s19OrxK.png)

sudo systemctl restart elasticsearch
curl http://192.168.1.35:9200
![](https://i.imgur.com/xXiti38.png)

![](https://i.imgur.com/GPNY9iw.png)


### Kibana Installation

sudo apt install kibana
sudo systemctl start kibana 
sudo systemctl enable kibana 
sudo systemctl status kibana

sudo nano /etc/kibana/kibana.yml
![](https://i.imgur.com/6dPn3pf.png)
.
server.port: 5601
server.host: "192.168.1.35"
elasticsearch.hosts: ["http://localhost:9200"]

![](https://i.imgur.com/YYOoWev.png)
sudo systemctl restart kibana 
sudo systemctl status kibana 

![](https://i.imgur.com/73q5Oe4.png)

### Logstash Installation

sudo apt install logstash
sudo systemctl start logstash
sudo systemctl enable logstash

cd /etc/logstash
sudo nano logstash-trial.conf

input { stdin { } }
output {
  elasticsearch {
    hosts => ["localhost:9200"]
    index => "trial_index"
  }
  stdout { codec => rubydebug }
}

sudo chmod 777 -R /usr/share/logstash/data
cd /usr/share/logstash
bin/logstash -f /etc/logstash/logstash-trial.conf

![](https://i.imgur.com/ofi4Jgh.png)

![](https://i.imgur.com/1gIDmYV.png)

![](https://i.imgur.com/m5uwGNh.png)

![](https://i.imgur.com/lhxQUll.png)
