How to install Logstash on Ubuntu 20.04


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing Logstash on Ubuntu 20.04

Logstash is an open-source data processing pipeline tool that allows you to collect, transform, and ship data from various sources to your desired destinations. It is part of the Elastic Stack, which also includes Elasticsearch for search and analytics, and Kibana for visualization.


Before installing Logstash, make sure you have the following:

  • An Ubuntu 20.04 server
  • Java Development Kit (JDK) 8 or later installed

Step 1: Install Java

Logstash requires Java to run. You can install OpenJDK using the following command:

sudo apt update
sudo apt install openjdk-11-jdk

Step 2: Download and Install Logstash

Download and install Logstash with the following steps:

wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/logstash.list
sudo apt update
sudo apt install logstash
  1. Retrieve the GPG key used for signing the Logstash packages:
  2. Add the Logstash repository:
  3. Update the package list:
  4. Install Logstash:

Step 3: Configure Logstash

Logstash configurations are stored in the /etc/logstash/conf.d directory. You can create a new configuration file with a .conf extension, for example:

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

Edit the configuration file to define your input, filter, and output plugins. Here's an example that listens for logs sent via syslog and outputs them to Elasticsearch:

  input {
    syslog {
      port => 514
  filter {
    # Add your filter plugins here
  output {
    elasticsearch {
      hosts => ["localhost:9200"]

Step 4: Start and Enable Logstash

Start and enable the Logstash service using the following commands:

sudo systemctl start logstash
sudo systemctl enable logstash


You have successfully installed Logstash on Ubuntu 20.04. You can now configure Logstash to process your data and send it to your desired destinations. For more advanced configurations, refer to the official Logstash documentation.

Refer A Friend
Get $25

Installing Logstash
Logstash installation
Ubuntu 20.04 Logstash
Logstash on Ubuntu 20.04
Logstash setup
Logstash configuration
Logstash tutorial
Logstash guide
Logstash step by step installation
Logstash installation on Ubuntu 20.04

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.