Installing the ELK Stack on Windows

how to install elk stack on windows

Windows? ELK? Well, while it would be safe to assume that most ELK Stack deployments are on Linux-based systems, there are certain use cases in which you would want to install the stack on a Windows machine.

If you’re looking to log Windows event logs, for example, and you do not want to ship the logs over the Web to an ELK server for security reasons, you’re going to want to deploy the stack locally.

This article will guide you through the necessary steps to install the ELK Stack’s components as Windows services. Note: This example will use Elasticsearch, 2.3.5, Logstash 2.3.4, and Kibana 4.5.4.

The setup

I’ll be using a Windows 2012 R2 instance on Amazon Web Services. The operating system is just a basic Server 2012 R2 installation — but with updates and a disabled firewall. I’ve also installed an Apache server for the purpose of demonstrating how to log into ELK.

Elasticsearch and Logstash require Java, so you will also need to download and install it — JDK and NOT JRE — and create a JAVA_HOME system variable as well.

Adding JAVA system variable

Installing Elasticsearch

Our first step is to install Elasticsearch — the heart of the stack, if you like, that is responsible for storing and indexing the log data.

You can download the latest version of Elasticsearch from Elastic’s Elasticsearch download page. Extract the downloaded package into a designated folder in your file system (e.g. c:\elk).

Next, open a Powershell prompt and enter the following command (be sure to enter your installation path in the command):

$ Invoke-Expression -command “c:\elk\elasticsearch\bin\service install”

You should get an output that looks as follows:

Installing service      :  "elasticsearch-service-x64"

Using JAVA_HOME (64-bit):  "C:\Program Files\Java\jdk1.8.0_1

The service 'elasticsearch-service-x64' has been installed.

Next, we’re going to open the service manager for the Elasticsearch service:

$ Invoke-Expression -command “c:\elk\elasticsearch\bin\service manager”

Service manager for Elasticsearch

This is where you customize settings for Elasticsearch. Memory for JVM, for example, can be configured on the Java tab, which is important for when you start to ingest large quantities of data.

On the General tab, we’re going to select the “Automatic” startup type and hit the “Start” button to start Elasticsearch. To make sure that all is running as expected, enter the following URL into your browser:


You should get the following output:


 "name" : "Andrew Chord",

 "cluster_name" : "elasticsearch",

 "version" : {

   "number" : "2.3.5",

   "build_hash" : "90f439ff60a3c0f497f91663701e64ccd01edbb4",

   "build_timestamp" : "2016-07-27T10:36:52Z",

   "build_snapshot" : false,

   "lucene_version" : "5.5.0"


 "tagline" : "You Know, for Search"


Installing Logstash

Next up is Logstash. Now, there are a number of ways to install Logstash on Windows, but it cannot be installed as a service out-of-the-box. So, I’ll be using a service manager called Non-Sucking Service Manager (NSSM), which I have downloaded and extracted into the folder that contains all of our installed ELK packages.

Now, download and extract Logstash from the Logstash download page to the same folder.

Before installing Logstash NSSM, create a Logstash configuration file called “config.json” and place it in the “bin” directory.

Next, enter the following command in Powershell (be sure to update the paths invoked):

$ Invoke-Expression -command “c:\elk\nssm\win64\nssm install Logstash”

You should see the NSSM dialog:

NSSM service installer for Logstash

For the application path, browse to and select the Logstash .bat file. The “Startup” directory field below is completed automatically. In the “Arguments” field, enter:

-f c:\elk\logstash\bin\config.json

There are other options you can configure such as tying the service to Elasticsearch, but for the purpose of this guide, these settings will suffice.

Click the “Install Service” button and a success message will be displayed. In Powershell, you will see the following message:

Service "Logstash" installed successfully!

Logstash service installed successfully message

Open Windows Task Manager and start the service from the “Services” tab.

Installing Kibana

As with Logstash, we will install Kibana as a Windows service using NSSM. Download and extract Kibana from the Kibana download page.

Use this command in Powershell to create the service:

$ Invoke-Expression -command “c:\elk\nssm\win64\nssm install Kibana”

In the NSSM dialog, complete the relevant paths to the Kibana files (there is no need to pass any arguments for Kibana) and click “Install service”:

Service "Kibana" installed successfully!

As with Logstash, start the service from your Task Manager — you should now have all three services up and running!

Service manager - up and running!

To verify, open your browser at this address:

Kibana open in browser

Congrats! You’ve successfully installed the ELK Stack on your Windows server!

As you may notice — Kibana is notifying you that it could not fetch mapping. This is because you have not shipped any data yet. This is, of course, the next step. If you’re trying to set up a pipeline of Windows event logs into ELK, I described how to install and use Winlogbeat (a log shipper by Elastic for shipping event logs into ELK) in this additional guide to Windows event log analysis.

Want Even More Capabilities from your ELK Stack? has you Covered!

    Stay updated with us!

    By submitting this form, you are accepting our Terms of Use and our Privacy Policy

    Thank you for subscribing!