# How to install Elastic search 8.9 on Windows 10 as a standalone service?

You can go to this article [Install Elasticsearch with .zip on Windows | Elasticsearch Guide \[8.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-windows.html) and follow the instructions which will help you install elastic search as a service, but there is a lot of additional stuff which is not needed for your purpose of B2B commerce related work.

So, here are clean steps to follow to get your localhost:9200 port up and running for Optimizely B2B commerce's search index configuration.

### Initial Installation

1. Download the latest zip from here - [Download Elasticsearch | Elastic](https://www.elastic.co/downloads/elasticsearch), at the time of writing this article I used Elastic search 8.9 [https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.0-windows-x86\_64.zip](https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.9.0-windows-x86_64.zip)
    
2. Go to your downloads folder, unzip the package and extract it into a folder.
    
3. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691106244132/291ab85b-932c-41c6-bee9-111d7bb72ea3.png align="center")
    
    Copy the "elasticsearch-8.9.0" folder and paste it into your C:/ drive
    
4. Open Windows Terminal OR Command Line and navigate to your elastic folder
    
5. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691106458707/0fae229d-1d7e-400e-90cf-12710b27018d.png align="center")
    
    Run command `.\bin\elasticsearch.bat`. It will take some time to run.
    
6. <mark>Please note </mark> \- You don't need JVM or JDK installation before doing this, it all comes with this zip file, so don't need to worry about it. This was an issue with past elastic installations.
    
7. Once your command runs fine without any errors, you will get 3 one-time generated pieces of information.
    
    1. password for your "elastic" username. Store this in a safe place. This is needed for the first-time login.
        
    2. Enrollment token for Kibana - *not needed for our installation*
        
    3. Hex-encoded SHA-256 fingerprint - *not needed for our installation*
        
8. Now if you hit URL https://localhost:9200 it will ask you for your username and password
    
9. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691107030700/804ed9b1-e82c-4639-b38e-b34d03696cf8.png align="center")
    
    This is where you will enter the username as "elastic" and the password generated in your terminal window
    
10. If you enter your username and password correctly, you should see the below screen as an acknowledgment that the elastic service is running with cluster information.
    
11. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691107338586/018a71c7-cabb-48af-966e-96b56f48e0c1.png align="center")
    
    You can terminate your elastic session by pressing CTRL + C twice
    
12. Next steps are to configure elastic service in background.
    

### Standalone Installation of Service

1. Keep in the same terminal session and use the command
    
2. ```bash
    elasticsearch-service.bat install
    ```
    
3. Now start the service using the command
    
4. ```bash
    elasticsearch-service.bat start
    ```
    
5. <mark>Please note </mark> \- Elastic search now uses Daemon to host the service on your machine and doesn't use Window Services which was the case before. So you will not find an Elastic search service running in Services.msc
    
6. Starting service will still be temporary until your terminal session remains open, you can permanently keep it running using the command
    
7. ```bash
    elasticsearch-service.bat manager
    ```
    
8. Start it and configure its startup type. I kept it to Manual.
    
9. ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691107921943/8ad1e69b-0804-44d4-9800-32db63d64f59.png align="center")
    
    Now critical step left here is to configure your environment variable for JDK. This is necessary for the service to look for the JDK folder to keep it running in the background. This will be set to the JDK path of your elastic folder.
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1691108069170/06980503-9684-414b-8718-4368a897449c.png align="center")

1. Once this is done, now you can close all terminal windows and your localhost:9200 port will be open to respond to elastic service calls from Optimizely.
