As of 8.0, Elastic Stack security is on by default for self-managed clusters!
When you download and run Elasticsearch and Kibana v8+ for the first time, you will notice that credentials for the elastic superuser and a unique enrollment token are automatically generated for you.
This post will walk you through:
- using the enrollment token to configure Kibana and connect Kibana to Elasticsearch
- logging in as a superuser to start using your new secure deployment.
Resources
Download pages for Elasticsearch and Kibana
If you want more in depth overview of Elasticsearch and Kibana, check out my blog on Beginner's Crash Course to Elastic Stack Series.
Elasticsearch
Step 1: Download Elasticsearch
Go to the Elasticsearch download page.
Choose the appropriate platform (green box) and click on the download option (orange box) for Elasticsearch.
macOS/Linux
Windows
Elasticsearch will begin to download.
Step 2: Unzip Elasticsearch
Step 3: Start Elasticsearch
Using the command line, we will cd into the unzipped Elasticsearch directory and start Elasticsearch!
macOS/Linux
In the terminal, execute the following command to start Elasticsearch.
# In the elasticsearch directory
bin/elasticsearch
Windows
In the terminal, execute the following command to start Elasticsearch.
# In the elasticsearch directory
bin\elasticsearch.bat
You will see the cursor blinking for a while before Elasticsearch starts running!
macOS/Linux
Windows
Keep this terminal open to continue running Elasticsearch for the rest of the tutorial.
Step 4: Find and save the credentials for Elasticsearch and Kibana
In the same terminal, scroll down to the end to find the credentials.
macOS/Linux
Windows
Save the generated password for the elastic user and the enrollment token for Kibana in a secure location. These values are shown only once when you start Elasticsearch for the first time.
Also, note that the enrollment token for Kibana is only valid for the next 30 min!
Kibana
Next, we will download Kibana. Using the enrollment token, we will configure Kibana and connect it to Elasticsearch.
Step 1: Download Kibana
Go to the Kibana download page.
Choose the appropriate platform (green box) and click on the download button (orange) for Kibana.
macOS/Linux
Windows
Kibana will begin to download.
Step 2: Unzip Kibana
Step 3: Start Kibana
By using the command line, we will cd into the unzipped Kibana directory and start Kibana!
macOS/Linux
In the terminal, execute the following command start Kibana.
# In the Kibana directory
bin/kibana
Windows
# In the Kibana directory
bin\kibana.bat
You will see the cursor blinking for a while before Kibana starts running!
When you look at the log, you will see the message "Kibana has not been configured" and it will point to a URL that will help you configure Kibana and connect it to Elasticsearch (red box).
macOS/Linux
Windows
Copy and paste the URL (red box) into a browser and hit enter.
You will see the following page.
Paste the enrollment token you had saved earlier and click on the "Configure Elastic" option (blue button).
Kibana will automatically set up everything and will connect over TLS to Elasticsearch.
When the set up completes, it will display the login page.
Use the username "elastic" and enter the unique password you had saved from the Elasticsearch section.
When you log in, you will see the following page. Click on the "Explore on my own" option (pink box).
It will take you to the Kibana home page. You are now ready to start using your new secure deployment!
Step 4: Start exploring what you can do with Elasticsearch and Kibana
The step by step guide is covered in my Beginner's Crash Course to Elastic Stack Series.
Part 1
This workshop will show you how you can perform CRUD (Create, Read, Update, and Delete) operations with Elasticsearch and Kibana.
Part 1 GitHub repo contains:
- the video recording of the workshop. Timestamp 25:03 will take you directly to the CRUD operations section.
- the requests needed to perform CRUD operations with Elasticsearch and Kibana.
Part 2
This workshop will show you how you can send search queries from Kibana to Elasticsearch and how you can finetune the relevance of your search results.
Part 2 GitHub repo contains the video recording of this workshops as well as all the queries and aggregations requests covered during the workshop.
Check out the following links to explore these topics after setting up Elasticsearch and Kibana:
- How to add data into Elasticsearch
- Queries and Aggregations used for search
- Queries used to fine-tune Precision or Recall
There you have it. Now, go explore what you can do!