How to Install and Setup ELK on Ubuntu 20 with Login Page.
What is ELK?
“ELK” is the acronym for three open source projects: Elasticsearch, Logstash, and Kibana.
- Elasticsearch is a search and analytics engine.
- Logstash is a server‑side data processing pipeline that ingests data from multiple sources simultaneously, transforms it, and then sends it to a “stash” like Elasticsearch.
- Kibana lets users visualize data with charts and graphs in Elasticsearch.
So without wasting any further time, let’s dive into the installation part. Before proceeding I wanted to clarify certain things.
This installation is for Ubuntu version 20 with 16gigs of ram. The Minimum Requirements for ELK Stack to run is 4GB. So please verify and then proceed.
ElasticSearch Logstash Kibana Ubuntu Installation
sudo apt-get update
Check, the java version and then update your system. If not java is not the latest version. I highly recommend doing it so.
sudo apt intsall eleasticsearchsudo service elasticsearch start (/stop/restart/status)curl “http://localhost:9200/”
sudo apt-get install apt-transport-httpssudo apt install logstash
sudo apt-get update && sudo apt-get install kibana
sudo service kibana start (/stop/restart/status)
If it doesn’t show any kind of error, visit your browser and type http://localhost:5601/. By default kibana web-interface runs on this post.
After performing these exact steps correctly, you have successfully installed ELK Stack onto your system. You can check all the services status by running above mentioned commands.
Now let us set up the login page for kibana. (without using trial)
sudo systemctl stop elasticsearchsudo vi /etc/elasticsearch/elasticsearch.yml
This will open the editor on your terminal screen, press ‘i’ and insert the following line at the end of the file. Press ‘Esc: wq!” to save the file. (You can also use the nano editor)
Then, to set up the bootstrap password using “elastic search-setup-password”cd /usr/share/elasticsearch/bin/
In the directory, you will be able to see the files likes these in the above image.
sudo ./elasticsearch-setup-passwords interactive
After setting up the password for the elastic search you need to make some changes in the kibana.yml file. Verify your user
sudo systemctl start elasticsearchsudo systemctl restart kibanacurl — user elastic:elastic -X GET “http://localhost:9200"
Now change the directory to sudo vi /etc/kibana/kibana.yml & enter the user and password for the kibana. Please make sure to remember the password.
Restart both the services and visit the URL in your browser.
To check the trial version go to Stack Management ->License Management.
Hence, we have successfully installed elk and set up a login page for kibana on a ubuntu operating system.
👋 Join FAUN today and receive similar stories each week in your inbox! ️ Get your weekly dose of the must-read tech stories, news, and tutorials.