John Siu Blog

Tech - Business Tool, Personal Toys

Elastic Stack / ELK Quick Install - Ubuntu

☰ Table of Content

Install ELK / Elastic Stack in Ubuntu.


Preparation

Use official Elastic Stack 7.x repository:

1
2
3
4
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
apt -y install apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" >> /etc/apt/sources.list.d/elastic-7.x.list
apt update

Install

Using filebeat instead of logstash for lower resource requirement.

1
2
ELK_PKG="elasticsearch kibana filebeat"
apt -y install ${ELK_PKG}

Auto Start

1
2
3
4
systemctl daemon-reload
systemctl enable ${ELK_PKG}
systemctl start ${ELK_PKG}
systemctl status ${ELK_PKG}

URLs

ApplicationURL
elasticsearchhttp://localhost:9200
kibanahttp://localhost:5601

Filebeat and Nginx

Enable nginx log shipping into elasticseach:

1
2
filebeat modules enable nginx
filebeat setup

Browser

Connect browser to http://localhost:5601 if installing in local machine.

Use ssh tunnel if installing on remote server:

1
ssh <remote server> -L 5601:localhost:5601

Then connect browser to http://localhost:5601.

John Siu

Update: 2020-08-28
comments powered by Disqus