VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-20-04

⇱ How To Install Elasticsearch, Logstash, and Kibana (Elastic Stack) on Ubuntu 20.04 | DigitalOcean


How To Install Elasticsearch, Logstash, and Kibana (Elastic Stack) on Ubuntu 20.04

Published on June 23, 2020

By Erin Glass

Senior Manager, DevEd

English
Not using Ubuntu 20.04?
Choose a different version or distribution.
Ubuntu 20.04
πŸ‘ How To Install Elasticsearch, Logstash, and Kibana (Elastic Stack) on Ubuntu 20.04

A previous version of this article was written by Justin Ellingwood and Vadym Kalsin.

Introduction

The Elastic Stack β€” formerly known as the ELK Stack β€” is a collection of open-source software produced by Elastic which allows you to search, analyze, and visualize logs generated from any source in any format, a practice known as centralized logging. Centralized logging can be useful when attempting to identify problems with your servers or applications as it allows you to search through all of your logs in a single place. It’s also useful because it allows you to identify issues that span multiple servers by correlating their logs during a specific time frame.

The Elastic Stack has four main components:

  • Elasticsearch: a distributed RESTful search engine which stores all of the collected data.
  • Logstash: the data processing component of the Elastic Stack which sends incoming data to Elasticsearch.
  • Kibana: a web interface for searching and visualizing logs.
  • Beats: lightweight, single-purpose data shippers that can send data from hundreds or thousands of machines to either Logstash or Elasticsearch.

In this tutorial, you will install the Elastic Stack on an Ubuntu 20.04 server. You will learn how to install all of the components of the Elastic Stack β€” including Filebeat, a Beat used for forwarding and centralizing logs and files β€” and configure them to gather and visualize system logs. Additionally, because Kibana is normally only available on the localhost, we will use Nginx to proxy it so it will be accessible over a web browser. We will install all of these components on a single server, which we will refer to as our Elastic Stack server.

Note: When installing the Elastic Stack, you must use the same version across the entire stack. In this tutorial we will install the latest versions of the entire stack which are, at the time of this writing, Elasticsearch 7.7.1, Kibana 7.7.1, Logstash 7.7.1, and Filebeat 7.7.1.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

πŸ‘ Erin Glass
Erin Glass
Author
Senior Manager, DevEd
See author profile

Open source advocate and lover of education, culture, and community.

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Hi, the tutorial is not complete. First, we need to install JAVA and NGINX. Otherwise, there are errors. Can you fulfill the tutorial?

I’m getting this error when installing logstash:

Setting up logstash (1:7.8.1-1) ...
Using provided startup.options file: /etc/logstash/startup.options
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2020-08-13T00:30:56.216Z [main] WARN FilenoUtil : Native subprocess control requires open access to sun.nio.ch
Pass '--add-opens java.base/sun.nio.ch=org.jruby.dist' or '=org.jruby.core' to enable.
Errno::EBADF: Bad file descriptor - systemctl
 spawn at org/jruby/RubyProcess.java:1635
 spawn at org/jruby/RubyKernel.java:1658
 popen_run at /usr/share/logstash/vendor/jruby/lib/ruby/stdlib/open3.rb:202
 popen3 at /usr/share/logstash/vendor/jruby/lib/ruby/stdlib/open3.rb:98
 execute at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/detector.rb:74
 detect_systemd at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/detector.rb:29
 detect_platform at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/detector.rb:24
 detect at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/detector.rb:18
 setup_defaults at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/cli.rb:153
 execute at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/cli.rb:119
 run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67
 run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/pleaserun-0.0.31/lib/pleaserun/cli.rb:114
 run at /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132
 <main> at /usr/share/logstash/lib/systeminstall/pleasewrap.rb:28
Unable to install system startup script for Logstash.
chmod: cannot access '/etc/default/logstash': No such file or directory
dpkg: error processing package logstash (--configure):
 installed logstash package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 logstash
E: Sub-process /usr/bin/dpkg returned an error code (1)

I believe there is small typo with one of the commands. It should be this:

sudo filebeat setup -E output.logstash.enabled=false -E 'output.elasticsearch.hosts=["localhost:9200"]' -E setup.kibana.host=localhost:5601

How can we do these in localhost? So elasticsearch is localhost:9200, nginx is localhost:80. So can kibana be localhost:5601?? How can we configure that in nginx configuration, need to listen on 80 or 9200? And Kibana is not loaded in browser, it’s just loading and then the connection was reset. How to troubleshoot that? Appreciated the help/reply…

I replaced a older elkstack on ubuntu and followed this process, it worked well except that it creates 2 indexes per day

filebeat-%{[@metadata][version]}-2020.10.03 filebeat-7.9.2-2020.10.03

the filebeat-7.9.2-2020.10.03 is from the elk server itself and the other is from filebeat from a remote syslog server that I was using before on the older server

It would be fine except the search doesn’t work, when I discover/search I only get the elkstack ubuntu server and a bunch of error popups for 1 of 3 shards failed

illegal_argument_exception

I ran GET _template/filebeat-* and the only one returned is the filebeat-7.9.2-2020.10.03 index so I am missing a index template for the other one

How can I fix this ? I tried hardcoding the %{[@metadata][version]} to 7.9.2 in the file /etc/logstash/conf.d/30-elasticsearch-output.conf but that caused even worse problems and could not load the data.

So I am a little confused, what port do I send my syslogs to? Port 514 isnt listening

Hi, Successfuly installed β€œVersion: 7.6.2” on Centos 7. Hope to follow your guide to install on ubuntu. Thanks…

AS I successfully implemented the tutorial.

Now it is taking 35 GB of memory out of 60 GB and in other instance it is taking 90% of memory out of 16GB.

So is normal with everyone or there is an issue.

Excuse, Erin why different pictures of my Kibana ui and yours examples

my kibana

πŸ‘ Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow β€” whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Β© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.