# Setting up environment variables in Windows10

**URL:** <https://discuss.elastic.co/t/setting-up-environment-variables-in-windows10/215456>\
**Category:** Elasticsearch\
**Tags:** windows-installer\
**Created:** [January 17, 2020, 12:33pm UTC](https://discuss.elastic.co/t/setting-up-environment-variables-in-windows10/215456 "2020-01-17T12:33:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elja\_Suhonen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elja_suhonen/32/60968_2.png) [@Elja\_Suhonen](https://discuss.elastic.co/u/Elja_Suhonen)\
**Post date:** [January 17, 2020, 12:33pm UTC](https://discuss.elastic.co/t/setting-up-environment-variables-in-windows10/215456/1 "2020-01-17T12:33:48Z")

</div>

my problem is in setting up environment variables once setting up Elasticsearch environment variables for local use. The instructions I follow can be found from: [https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-windows.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/zip-windows.html)

First of all, does it matter that do I set up environment variables to user or system? By default, I try to set up everything as system variables. Is there something else in setting these variables than just pointing to root folder (C:\Program Files\Elastic in my case where I extracted the elasticsearch zip package)? The instructions are very short and I'm not sure which variables should I point to elasticsearch folder and which to java install folder. Also, does it matter if I have the these download folders outside C drive and should these environmental variables work once I'm setting them up or later in the setting up process?

Either way, when I'm trying to call any of these variables but they don't seem to work. I think also there should be an easier way to set these up instead of going each one through manually.

Following is the elasticsearch documentation I'm referring to:

"Customizing service settings The Elasticsearch service can be configured prior to installation by setting the following environment variables (either using the set command from the command line, or through the System Properties-\>Environment Variables GUI).

```auto
SERVICE_ID

```

A unique identifier for the service. Useful if installing multiple instances on the same machine. Defaults to elasticsearch-service-x64.

```auto
SERVICE_USERNAME

```

The user to run as, defaults to the local system account.

```auto
SERVICE_PASSWORD

```

The password for the user specified in %SERVICE\_USERNAME%.

```auto
SERVICE_DISPLAY_NAME

```

The name of the service. Defaults to Elasticsearch %SERVICE\_ID%.

```auto
SERVICE_DESCRIPTION

```

The description of the service. Defaults to Elasticsearch Windows Service - [https://elastic.co](https://elastic.co/).

```auto
JAVA_HOME

```

The installation directory of the desired JVM to run the service under.

```auto
SERVICE_LOG_DIR

```

Service log directory, defaults to %ES\_HOME%\logs. Note that this does not control the path for the Elasticsearch logs; the path for these is set via the setting path.logs in the elasticsearch.yml configuration file, or on the command line.

```auto
ES_PATH_CONF

```

Configuration file directory (which needs to include elasticsearch.yml, jvm.options, and log4j2.properties files), defaults to %ES\_HOME%\config.

```auto
ES_JAVA_OPTS

```

Any additional JVM system properties you may want to apply.

```auto
ES_START_TYPE

```

Startup mode for the service. Can be either auto or manual (default).

```auto
ES_STOP_TIMEOUT

```

The timeout in seconds that procrun waits for service to exit gracefully. Defaults to 0."

Thanks a bunch for all the help already in advance! 🙂

---

<div class="post-metadata">

**Author:** ![ygel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ygel/32/55561_2.png) [@ygel](https://discuss.elastic.co/u/ygel)\
**Post date:** [February 5, 2020, 8:34pm UTC](https://discuss.elastic.co/t/setting-up-environment-variables-in-windows10/215456/2 "2020-02-05T20:34:23Z")

</div>

Hello Elija,

> [@Elja\_Suhonen](#):
>
> C:\Program Files\Elastic in my case where I extracted the elasticsearch zip package

It is generally a bad idea to manually fiddle with contents of Program Files. I suggest you create a directory, say `C:\ElasticStack\elasticsearch` and extract the zip there. Program Files is a special location with special permissions, which prevent writes by non-elevated users. You will experience problems running anything from that location that assumes it can write to the same [sub] directory.

> [@Elja\_Suhonen](#):
>
> does it matter that do I set up environment variables to user or system?

It does't matter if you run ES as your user, however you will have to restart the shell/prompt you're running when you add/change a value. Further, any application that is started by the system (services for example) will not "see" the new variable until you restart the system. When ES runs as a service under default service account, you must add variables to the System location and restart the box for guaranteed results.

---

<div class="post-metadata">

**Author:** ![ropc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ropc/32/47022_2.png) [@ropc](https://discuss.elastic.co/u/ropc)\
**Post date:** [February 6, 2020, 2:09am UTC](https://discuss.elastic.co/t/setting-up-environment-variables-in-windows10/215456/3 "2020-02-06T02:09:18Z")

</div>

On a side note, Elasticsearch is not supported in Windows 10. Please refer to [our support matrix](https://www.elastic.co/support/matrix#matrix_os) for further details.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 5, 2020, 2:09am UTC](https://discuss.elastic.co/t/setting-up-environment-variables-in-windows10/215456/4 "2020-03-05T02:09:20Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
