Setup Elasticsearch and Kibana on Ubuntu 18.04 on a single node

Topic created · 1 Posts · 3 Views
  • This is for test / non prod environments


    Even for a test environment, considering that both Elasticsearch and Kibana will consume memory anc cpu, we need at least 1 VM with 16g of ram and 4vCPU


    We need to install the following packages in our system:

    • openjdk-11-jre-headless
    • apt-transport-https
    • elasticsearch
    • kibana

    To do so we will execute the following commands as root:

    apt install openjdk-11-jre-headless
    apt-get install apt-transport-https

    Add the elasticsearch GPG key and repo

    wget -qO - | sudo apt-key add -
    add-apt-repository "deb stable main"

    Then, proceed to install Kibana and elasticsearch

    apt-get update
    apt-get install kibana
    apt-get install elasticsearch


    Prior to start the services, we will need to perform a initial configuration

    Edit the file /etc/elasticsearch/elasticsearch.yml and add the following parameters:

    Replace the cluster name, node name, publish host and initial mater nodes values by your host IP address mycluster elkserver
    node.master: true true
    action.auto_create_index: true
    http.port: 9200
    index.number_of_replicas: 0

    Then, edit the kibana config file /etc/kibana/kibana.yml and add the following parameters:
    (replace the elastic host IP for your IP)

    server.port: 5601 "" "elkserver"
    elasticsearch.hosts: [""]
    kibana.index: ".kibana"

    Start Services

    Then, start the elastic service by executing

    systemctl enable elasticsearch.service
    systemctl start elasticsearch.service

    Start also the kibana service:

    systemctl enable kibana.service
    systemctl start kibana.service


    From any other node, you can verify that Elasticsearch is accessible by querying its status by running:

    curl -X GET ""


    curl -X GET ""
      "name" : "elkserver",
      "cluster_name" : "mycluster",
      "cluster_uuid" : "q3aOcBEsQWOGfuT0_5bWqg",
      "version" : {
        "number" : "7.6.0",
        "build_flavor" : "default",
        "build_type" : "deb",
        "build_hash" : "7f634e9f44834fbc12724506cc1da681b0c3b1e3",
        "build_date" : "2020-02-06T00:09:00.449973Z",
        "build_snapshot" : false,
        "lucene_version" : "8.4.0",
        "minimum_wire_compatibility_version" : "6.8.0",
        "minimum_index_compatibility_version" : "6.0.0-beta1"
      "tagline" : "You Know, for Search"

    You can also verify the node:

    curl -XGET ''
    curl -XGET ''
    ip           heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name           45          37   1    0.00    0.01     0.04 dilm      *      elkserver

    Then, you can create your first index

    curl -XPUT ""

    And verify its creation

    curl -XGET ''


    curl -XGET ''
    health status index                    uuid                   pri rep docs.count docs.deleted store.size
    green  open   .kibana_task_manager_1   jHpC_e8mRzq5A8JdwHVu_g   1   0          2            0     43.4kb         43.4kb
    green  open   .apm-agent-configuration yoVyzzG5S56Q05Mqxghaog   1   0          0            0       283b           283b
    green  open   .kibana_1                2oE1URIITm6KNwqYgEd9ng   1   0         16            0     36.7kb         36.7kb
    green  open   myfirstindex             0bNB5LNMT6m31rHeTy_usQ   1   1          0            0       230b           230b

    Finally, access the Kibana dashboard by typing in your browser your host url on port 5601

    alt text

Log in to reply