๐Ÿš€ deploy elastic stack on ubuntu vps
Learn how to deploy elastic stack on ubuntu vps!

Hereโ€™s the guide to deploy Elastic Stack on Ubuntu VPS, with secure access, HTTPS proxying, and service optimization.

What is Elastic Stack?

Also known as ELK Stack, the Elastic Stack isย a collection of tools for securely taking data from any source and format to search, analyze, and visualize it. The core components areย Elasticsearchย (a search and analytics engine),ย Kibanaย (for visualization),ย Beatsย (data shippers), andย Logstashย (a data ingestion pipeline). It is widely used for use cases like log management, security, observability, and business analytics.

๐Ÿงญ Full Guide: Deploy Elastic Stack on Ubuntu VPS

โœ… Works on Ubuntu 22.04 LTS or later

The Elastic Stack (formerly ELK Stack) consists of:

  • Elasticsearch โ€“ data storage and search engine
  • Logstash โ€“ data ingestion and processing pipeline
  • Kibana โ€“ web-based data visualization and management UI

โš™๏ธ Prerequisites

  • Ubuntu VPS (with fresh install of 22.04+)
  • At least 4 GB RAM, 2 vCPUs minimum
  • Root or sudo access
  • Open ports (see: How to Open Ports on Linux Server)
    • 9200 (Elasticsearch)
    • 9300 (Elasticsearch transport)
    • 5601 (Kibana)
    • 5044 (Logstash input)
  • Optional: domain name for HTTPS proxying (e.g., search.example.com)

Launch 100% ssd ubuntu vps from $2. 49/mo!

How to Deploy Elastic Stack on Ubuntu VPS

To deploy Elastic Stack on Ubuntu VPS, follow the steps outlined below:

  1. ๐Ÿงฉ System Update

    sudo apt update && sudo apt upgrade -y sudo apt install apt-transport-https wget curl gnupg ufw -y
  2. ๐Ÿ”‘ Add Elastic APT Repository

    Import the GPG key and repository:

    curl -fsSL https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elastic-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/elastic-archive-keyring.gpg] https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-8.x.list sudo apt update
  3. ๐Ÿงฑ Install Elasticsearch

    sudo apt install elasticsearch -y

    Configure Elasticsearch

    Edit /etc/elasticsearch/elasticsearch.yml:

    cluster.name: elastic-stack node.name: node-1 network.host: 0.0.0.0 http.port: 9200 discovery.type: single-node

    Enable and start the service:

    sudo systemctl enable elasticsearch sudo systemctl start elasticsearch sudo systemctl status elasticsearch

    Test Elasticsearch

    curl -k https://localhost:9200 -u elastic
  4. โšก Install Logstash

    Logstash processes logs and sends them to Elasticsearch.

    sudo apt install logstash -y

    Configure Logstash Pipeline

    Create a configuration file:

    sudo nano /etc/logstash/conf.d/01-logstash-input.conf

    Example configuration:

    input { beats { port => 5044 } } filter { grok { match => { "message" => "%{COMMONAPACHELOG}" } } } output { elasticsearch { hosts => ["https://localhost:9200"] index => "logs-%{+YYYY.MM.dd}" user => "elastic" password => "your_elastic_password" ssl => true cacert => "/etc/elasticsearch/certs/http_ca.crt" } }

    ๐Ÿ’ก You can use the generated CA certificate from /etc/elasticsearch/certs/ (Elasticsearch 8.x automatically generates one).

    Enable and start Logstash:

    sudo systemctl enable logstash sudo systemctl start logstash sudo systemctl status logstash
  5. ๐Ÿ–ฅ Install Kibana

    sudo apt install kibana -y

    Configure Kibana

    Edit /etc/kibana/kibana.yml:

    server.port: 5601 server.host: "0.0.0.0" elasticsearch.hosts: ["https://localhost:9200"] elasticsearch.username: "kibana_system" elasticsearch.password: "your_kibana_password" server.publicBaseUrl: "https://your-domain.com"

    Enable and start Kibana:

    sudo systemctl enable kibana sudo systemctl start kibana

    Access it via:

    http://your-server-ip:5601
  6. ๐ŸŒ Secure with Nginx Reverse Proxy + HTTPS (Certbot)

    Install Nginx and Certbot:

    sudo apt install nginx certbot python3-certbot-nginx -y

    Create proxy configuration:

    sudo nano /etc/nginx/sites-available/kibana.conf

    Add:

    server { listen 80; server_name your-domain.com; location / { proxy_pass http://localhost:5601; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; } }

    Enable and secure:

    sudo ln -s /etc/nginx/sites-available/kibana.conf /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx sudo certbot --nginx -d your-domain.com

    Now, Kibana will be accessible securely via:

    https://your-domain.com
  7. ๐Ÿ“Š Connect Beats (Optional)

    To ship logs from other systems, install Filebeat:

    sudo apt install filebeat -y

    Configure /etc/filebeat/filebeat.yml:

    output.logstash: hosts: ["your-vps-ip:5044"]

    Then enable and start:

    sudo systemctl enable filebeat sudo systemctl start filebeat
  8. ๐Ÿง  Verify Stack Connectivity

    Check that all services are communicating:

    sudo systemctl status elasticsearch
    sudo systemctl status logstash
    sudo systemctl status kibana
    

    Then in Kibana:

    • Visit Stack Management โ†’ Index Patterns
    • Confirm indices like logs-* are appearing.
  9. โš™๏ธ Optional JVM Optimization

    Edit heap size settings for performance:

    sudo nano /etc/elasticsearch/jvm.options.d/custom.options

    Add (50% of available RAM recommended):

    -Xms2g -Xmx2g

    Restart services:

    sudo systemctl restart elasticsearch logstash kibana
  10. ๐Ÿ›ก Secure and Maintain

    • Use ufw to limit access to ports:
      sudo ufw allow 5601,9200,5044/tcp
    sudo ufw enable
    
    • Regularly update:
      sudo apt update && sudo apt upgrade -y
    
    • Monitor logs:
      sudo journalctl -u elasticsearch -f
    sudo journalctl -u logstash -f
    sudo journalctl -u kibana -f
    

โœ… Final Verification

Open:

https://your-domain.com

Log in with your Elastic superuser credentials and confirm:

  • Elasticsearch cluster health = green
  • Logstash pipelines visible
  • Indices showing in Kibana โ†’ Discover

๐ŸŽฏ Summary

Component Port Function Service
Elasticsearch 9200 Core search & data engine elasticsearch
Logstash 5044 Data ingestion pipeline logstash
Kibana 5601 Visualization UI kibana

You now have a fully functional Elastic Stack running securely on your Ubuntu VPS โ€” ideal for central log management, data analytics, and real-time search.
Launch 100% ssd ubuntu vps from $2. 49/mo!

Conclusion

You now know how to deploy Elastic Stack on Ubuntu VPS.

Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.

One thought on “๐Ÿš€ Deploy Elastic Stack on Ubuntu VPS (5 Minute Quick-Start Guide)

  1. […] This dashboard provides detailed insights into Elasticsearch cluster performance. It includes panels for indexing performance, query latency, JVM stats, node […]

Comments are closed.

lg