How to Install Elastic Stack on Ubuntu 20.04 LTS

How to Install Elastic Stack on Ubuntu 20.04 LTS

How to Install Elastic Stack on Ubuntu 20.04 LTS

Updated: June 2025

Introduction

The Elastic Stack, commonly known as the ELK Stack (Elasticsearch, Logstash, Kibana), is a powerful set of tools for searching, analyzing, and visualizing log data in real time. This guide will walk you through installing and configuring Elastic Stack on Ubuntu 20.04 LTS.

Prerequisites

  • Ubuntu 20.04 LTS server
  • Root or sudo privileges
  • Minimum 4 GB RAM recommended
  • Stable internet connection

Step 1: Install Java

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

Step 2: Add Elasticsearch GPG Key and Repository


wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -  
sudo apt install apt-transport-https  
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list  
sudo apt update  
    

Step 3: Install and Configure Elasticsearch

sudo apt install -y elasticsearch

Edit the config file:

sudo nano /etc/elasticsearch/elasticsearch.yml

Set:


network.host: localhost  
discovery.type: single-node
    

Enable and start:


sudo systemctl enable elasticsearch  
sudo systemctl start elasticsearch  
curl -X GET http://localhost:9200
    

Step 4: Install and Configure Kibana

sudo apt install -y kibana

In /etc/kibana/kibana.yml:


server.host: "localhost"
    

Enable and start:


sudo systemctl enable kibana  
sudo systemctl start kibana
    

Access via browser: http://localhost:5601

Step 5: Install Logstash

sudo apt install -y logstash

Test with a basic pipeline:


sudo nano /etc/logstash/conf.d/simple.conf
    

Example content:


input { stdin { } }  
output { stdout { codec => rubydebug } }
    
sudo systemctl start logstash

Step 6: Install Filebeat (Optional)

sudo apt install -y filebeat

Enable and configure it to send logs to Logstash or Elasticsearch.

Conclusion

Your Elastic Stack is now set up and ready to process and visualize log data. You can start shipping logs from various sources and build dashboards in Kibana for analysis.

🚀 Need reliable Linux VPS to host your ELK stack? Check our Linux VPS offer here.

© 2025 NETCLOUD24.COM – All rights reserved.

Comments

Popular posts from this blog

How to Install Moodle LMS on Debian 12 Server - Manual & Docker

How to Install and Configure GlusterFS on Ubuntu 24.04

How to Install OpenEMR on Ubuntu 24.04 Server - Manual & Docker