Would you like to learn how to enable the Elasticsearch TLS encryption and HTTPS communication? In this tutorial, we are going to show you how to enable the security feature and how to enable the HTTPS encryption on the ElasticSearch server on a computer running Ubuntu Linux.

• Ubuntu 18
• Ubuntu 19
• ElasticSearch 7.6.2
• Kibana 7.6.2

In our example, The ElastiSearch server IP address is 192.168.100.7.

Tutorial ElasticSearch – Upgrading the Basic License

Install the required packages.

Copy to Clipboard

Verify the license type installed on the ElasticSearch server.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, we have a basic license installed on the ElasticSearch server.

Enable the trial license on the ElasticSearch server.

Copy to Clipboard

The security features are not available on the ElasticSearch basic license.

Tutorial ElasticSearch – Enable the TLS Encryption and HTTPS Communication

Stop the ElasticSearch service.

Copy to Clipboard

Create a self-signed certificate authority.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, no password was set.

Create a certificate for the ElasticSearch node.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, no password was set.

Copy the certificates to the proper directory and set the correct permissions.

Copy to Clipboard

Create a certificate to enable HTTPS communication.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, no password, no DNS, and no IP addresses were set.

In our example, we used the self-signed certificate authority created before.

Copy the certificates to the proper directory and set the correct permissions.

Copy to Clipboard

Edit the ElasticSearch configuration file named: elasticsearch.yml

Copy to Clipboard

Add the following lines at the end of the file.

Copy to Clipboard

Here is the original file, before our configuration.

Copy to Clipboard

Here is the file with our configuration.

Copy to Clipboard

Start the ElasticSearch service.

Copy to Clipboard

Set the password for the ElasticSearch Built-in users.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Test your communication with the ElasticSearch server.

Keep in mind that we need to use HTTPS.

Keep in mind that we are using fake certificates, therefore, we need to disable the certificate verification on the CURL command.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

The ElasticSearch server is requiring user authentication.

Test your communication with the ElasticSearch server using the ELASTIC user account.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

You may choose to enter the user password on the command-line.

Copy to Clipboard

Congratulations! You have finished the ElasticSearch TLS encryption configuration.

Congratulations! You have finished the ElasticSearch HTTPS configuration.

Tutorial ElasticSearch – Kibana Configuration

Stop the Kibana service.

Copy to Clipboard

Copy the self-signed certification authority certificate.

Copy to Clipboard

Edit the Kibana configuration file named: kibana.yml

Copy to Clipboard

Locate and change the Elasticsearch connection from HTTP to HTTPS.

Copy to Clipboard

Add the following lines at the end of the file.

Copy to Clipboard

Here is the original file, before our configuration.

Copy to Clipboard

Here is the file with our configuration.

Copy to Clipboard

Keep in mind that you need to change the Kibana password to reflect your environment.

Start the Kibana service.

Copy to Clipboard

Open your browser and enter the IP address of your Kibana server plus :5601.

In our example, the following URL was entered in the Browser:

• http://192.168.100.7:5601

The Kibana web interface should be presented

Kibana login

After a successful login, the Kibana dashboard should be presented.

Kibana menus

Congratulations! You have finished the Kibana integration to ElasticSearch.