# 4.1 Installation of SonarScanner in Windows

1. Expand the downloaded file into the directory of your choice. We'll refer to it as \_\<install\_directory> \_in the next steps.
2. Update the global settings (server URL) by editin&#x67;*\<install\_directory>/conf/sonar-scanner.properties*:

   | `#----- Default SonarQube server#sonar.host.url=`[`http://localhost:9000`](http://localhost:9000/) |
   | -------------------------------------------------------------------------------------------------- |
3. Create a new *SONAR\_RUNNER\_HOME \_environment variable set to* \<install\_directory>\_.![](/files/-M4S6l5OMcGKs_ntAFo1)
4. Add the \_\<install\_directory>/bin \_directory to your path.
5. You can check the basic installation by opening a new shell and executing the command`sonar-scanner -h`(on Windows platform the command is`sonar-scanner.bat -h`) . You should get a message like this:

   ```
   usage: sonar-scanner [options]

   Options:
    -D,--define <arg>     Define property
    -e,--errors           Produce execution error messages
    -h,--help             Display help information
    -v,--version          Display version information
    -X,--debug            Produce execution debug output
   ```

If you need more debug information you can add the`sonar.verbose`property by adding the command line parameter`-Dsonar.verbose=true`.

Always keep in mind that if you change the port number of SonarQube installation then you must also change in ***sonar-scanner.properties** under configuration folder(conf) of **sonar scanner installation directory.***

```
#----- Default SonarQube server
sonar.host.url=http://localhost:<to port number you have changed in SonarQube>
```

Restart the sonarQube server if you have changed configuration settings of sonarscanner

You are now ready to **analyze a project with the SonarQube Scanner.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://n-saikiran.gitbook.io/sonarqube/sonarscanner-installation/41-installation-of-sonarscanner-in-windows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
