If you’ve ever needed to search a mountain of data quickly, Elasticsearch can help. And if you want to see that data on graphs and dashboards, Kibana is its perfect sidekick.
I’ve set them up on my server more times than I can count (and I’m not great at math anyway). So, I’ll walk you through it using simple steps and everyday language. Whether you’re setting it up on your home computer or a cloud server, this guide will help you do it without pulling your hair out. Unless, of course, you enjoy a good challenge—then feel free to wear a wig for dramatic effect.
Let’s dig in, one bite at a time.
What Are Elasticsearch and Kibana?
Let’s define some stuff first.
Elasticsearch is a search engine. Not like Google, but kind of. It helps you search big piles of data fast. It stores that data in a special way so it can find things really quickly.
Kibana is the tool that shows that data in pictures—like charts and graphs. It connects to Elasticsearch and lets you play with your data visually.
I like to think of them like this:
- Elasticsearch is like a super organized librarian who knows where every book is.
- Kibana is the fancy touchscreen catalog that shows you what’s in those books with colorful graphs and charts.
What You’ll Need
Before you begin, you need a few things. Here’s your prep checklist:
- A computer or server running Ubuntu 20.04 or newer (that’s what I’m using).
- Basic Linux knowledge (you don’t need to be a wizard).
- At least 2 GB of RAM. Elasticsearch eats memory like a teenager at a buffet.
- Internet connection (unless you’re trying to Google how to install Elasticsearch… without the internet).
Step 1: Update Your System
Start by updating your system. This helps avoid surprises. You wouldn’t want to build a treehouse on wobbly ground, right?
Open your terminal and run:
sudo apt update && sudo apt upgrade -y
This updates all your packages and keeps things tidy.
Step 2: Install Java
Elasticsearch needs Java to run. It’s like how pizza needs cheese. Without it, it just doesn’t work right.
Install OpenJDK with:
sudo apt install openjdk-17-jdk -y
Once installed, check that Java is working:
java -version
You should see something like:
openjdk version "17..."
If you see that, you’re good. If not, check your spelling. Typos happen—I once typed javva
and confused my poor terminal.
Step 3: Add the Elasticsearch Repository
Elasticsearch isn’t in Ubuntu’s default list, so we need to add it manually.
First, install a package to help get the repo:
sudo apt install apt-transport-https ca-certificates wget -y
Then, import the Elasticsearch GPG key:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
Now, add the Elasticsearch source list:
echo "deb https://artifacts.elastic.co/packages/8.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-8.x.list
Finally, update your package list:
sudo apt update
Whew. That’s the boring part. Now the fun stuff.
Step 4: Install Elasticsearch
Time to bring in the big cheese.
sudo apt install elasticsearch -y
Once that finishes, you need to enable and start it:
sudo systemctl enable elasticsearch
sudo systemctl start elasticsearch
Check if it’s running:
curl -X GET "localhost:9200"
You should see some JSON text like:
{
"name" : "your-server-name",
"cluster_name" : "elasticsearch",
...
}
If that shows up, Elasticsearch is alive and kicking.
Step 5: Set Up Elasticsearch (Optional, but Smart)
Elasticsearch comes with security features like passwords and certificates. If you’re just testing, you can skip this. But if you’re going to use this on the internet, protect it.
When first started, Elasticsearch shows you passwords and tokens in:
sudo cat /var/lib/elasticsearch/elastic-stack-ca.p12
Store those in a safe place. Like a password manager. Or a drawer labeled “Top Secret.”
Step 6: Install Kibana
Now let’s install Kibana, the visual sidekick.
sudo apt install kibana -y
Then enable and start it:
sudo systemctl enable kibana
sudo systemctl start kibana
Open your browser and go to:
http://your-server-ip:5601
If it loads, you’ve got Kibana running.
If not, check that your server firewall allows port 5601:
sudo ufw allow 5601
Or maybe your cat stepped on the power cable. It happens.
Step 7: Link Kibana to Elasticsearch
Open the Kibana config file:
sudo nano /etc/kibana/kibana.yml
Look for these lines and make sure they’re set:
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
Save the file (CTRL + O
, ENTER
, then CTRL + X
) and restart Kibana:
sudo systemctl restart kibana
Now it should be able to talk to Elasticsearch like old pals.
Why Use Elasticsearch and Kibana?
Let me be honest. At first, I thought this setup was overkill. But when I saw the speed and visuals, I changed my mind. It helps me:
- Search logs across dozens of servers in seconds.
- See traffic spikes on my websites.
- Catch weird behavior, like a bot hammering my site at midnight.
Want to know when your server was last attacked by a rogue IP? Elasticsearch + Kibana.
A Quick Recap
Here’s a short summary of the steps:
- ✅ Updated system and installed Java
- ✅ Added Elastic repo
- ✅ Installed and started Elasticsearch
- ✅ Installed and configured Kibana
- ✅ Linked them together
You’ve built your own data lab. That’s pretty neat.
Bonus Tips
Here are some tips I’ve learned the hard way (so you don’t have to):
- Keep backups. If something breaks, you’ll thank yourself later.
- Don’t expose Elasticsearch directly to the internet. Always use firewalls or VPNs.
- Practice in a test environment first. It’s safer than learning on your production server.
How Are They Different from Databases?
People often ask, “Why not just use MySQL or MongoDB?”
Great question. Traditional databases are like filing cabinets. They store and organize things well.
But Elasticsearch is like a turbo-charged search robot. It’s built to search across tons of data—super fast. It doesn’t replace your database. It works with it.
Conclusion
You just installed two powerful tools: Elasticsearch and Kibana.
You can now collect data, search it fast, and show it in neat graphs. Whether it’s website logs, tweets, or sensor data from your pet hamster’s treadmill, you’ll be able to understand it better.
If something didn’t work, don’t panic. Double-check the steps, and feel free to ask around or try again. I’ve broken my setup plenty of times. But each mistake teaches something.
So, ready to explore your data? Or at least show it some fancy pie charts?