Skip to content

Instantly share code, notes, and snippets.

@niradler
Created December 22, 2018 14:25
Show Gist options
  • Save niradler/16a0b8fb804599c1023a541941304b67 to your computer and use it in GitHub Desktop.
Save niradler/16a0b8fb804599c1023a541941304b67 to your computer and use it in GitHub Desktop.
elastic stack installation on ubuntu
# https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04
# https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
# https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04#installing-the-oracle-jdk
# https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-18-04
# install nginx
sudo apt update
sudo apt install nginx
sudo ufw app list
sudo ufw allow 'Nginx HTTP'
sudo ufw status
systemctl status nginx
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# install ELK
# es
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
sudo apt update
sudo apt install elasticsearch
sudo nano /etc/elasticsearch/elasticsearch.yml
sudo systemctl start elasticsearch
sudo systemctl enable elasticsearch
curl -X GET "localhost:9200"
# kibana
sudo apt install kibana
sudo systemctl enable kibana
sudo systemctl start kibana
echo "kibanaadmin:`openssl passwd -apr1`" | sudo tee -a /etc/nginx/htpasswd.users # replace kibanaadmin
sudo nano /etc/nginx/sites-available/kibana
# server {
# listen 80;
# server_name example.com;
# auth_basic "Restricted Access";
# auth_basic_user_file /etc/nginx/htpasswd.users;
# location / {
# proxy_pass http://localhost:5601;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection 'upgrade';
# proxy_set_header Host $host;
# proxy_cache_bypass $http_upgrade;
# }
# }
sudo ln -s /etc/nginx/sites-available/kibana /etc/nginx/sites-enabled/kibana
sudo nginx -t
sudo systemctl restart nginx
sudo ufw allow 'Nginx Full'
#logstash
sudo apt install logstash
sudo nano /etc/logstash/conf.d/02-beats-input.conf
sudo systemctl start logstash
sudo systemctl enable logstash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment