# Advanced setup

## Self Signed Certificates of DevOps platforms <a href="#selfsigned-certificates" id="selfsigned-certificates"></a>

In a ZIP installation, the systems truststore can be found in `$JAVA_HOME/lib/security/cacerts`. In order to add a new certificate to the truststore you can use the following command as an example:

```sh
keytool -importcert -file $PATH_TO_CERTIFICATE -alias $CERTIFICATE_NAME -keystore /$JAVA_HOME/lib/security/cacerts -storepass changeit -trustcacerts -noprompt
```

## Changing SonarQube DNS cache TTL <a href="#dns-cache" id="dns-cache"></a>

When reporting Quality Gate status to DevOps platforms, SonarQube uses a DNS cache time to live policy of 30 seconds. If necessary, you can change this setting in your JVM:

```sh
echo "networkaddress.cache.ttl=5" >> "${JAVA_HOME}/conf/security/java.security" 
```

Please be aware that low values increase the risk of DNS spoofing attacks.

## Adjusting Java executable path <a href="#adjusting-java-exec-path" id="adjusting-java-exec-path"></a>

By default, the scripts will use the Java executable available in the PATH. If multiple versions of Java are installed on your server, you may need to explicitly define which version is used.

It is possible to overwrite the default Java executable by setting the environmental variable `SONAR_JAVA_PATH`.

<details>

<summary>Linux</summary>

```sh
export SONAR_JAVA_PATH="path/to/java_home/bin/java"
```

</details>

<details>

<summary>Windows</summary>

```sh
setx SONAR_JAVA_PATH "C:\Program Files\java_home\bin\java.exe"
```

</details>

## Enabling IPv6 <a href="#enabling-ipv6" id="enabling-ipv6"></a>

On your SonarQube host:

1. Enable IPv6 in the JVM by setting the `JAVA_TOOL_OPTIONS` environment variable to `-Djava.net.preferIPv6Addresses=true`.
2. Enable IPv6 in SonarQube by setting the `sonar.web.javaAdditionalOpts` system property to `-Djava.net.preferIPv6Addresses=true` in the SonarQube configuration file (`<sonarQubeHome>/conf/sonar.properties`).

{% hint style="info" %}
In case of a Data Center Edition, perform both steps on all application nodes. Perform only the first step on the search nodes.
{% endhint %}

## Keeping user sessions alive on server restart <a href="#keeping-user-sessions" id="keeping-user-sessions"></a>

To maintain your user sessions accross server restarts:

* Store the JWT token you generated during pre-installation (see [Defining a JWT token](/sonarqube-server/2025.5/server-installation/pre-installation/jwt-token.md)) in the `sonar.auth.jwtBase64Hs256Secret` system property. See [Configuration methods](/sonarqube-server/2025.5/server-installation/system-properties/configuration-methods.md).

In case of a Data Center Edition, the same token must be stored on each application node.

## Related pages <a href="#related-pages" id="related-pages"></a>

* [Installation overview](/sonarqube-server/2025.5/server-installation/from-zip-file/overview.md)
* [Basic installation](/sonarqube-server/2025.5/server-installation/from-zip-file/basic-installation.md)
* **Configuring network security features:**
  * [Reverse proxy and network security](/sonarqube-server/2025.5/server-installation/network-security/securing-behind-proxy.md)
  * [Network rules](/sonarqube-server/2025.5/server-installation/network-security/network-rules.md)
* [Starting / stopping server](/sonarqube-server/2025.5/server-installation/from-zip-file/starting-stopping-server.md)
* [Running as a service](/sonarqube-server/2025.5/server-installation/from-zip-file/starting-stopping-server/running-as-a-service.md)
* Installing the Data Center Edition from the ZIP file: [Installing from ZIP file](/sonarqube-server/2025.5/server-installation/data-center-edition/from-zip-file.md)
* System properties:[Configuration methods](/sonarqube-server/2025.5/server-installation/system-properties/configuration-methods.md)


---

# 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://docs.sonarsource.com/sonarqube-server/2025.5/server-installation/from-zip-file/advanced-setup.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.
