# Advanced installation

This section explains how to:

* Change the web server connection parameters
* Modify the default configuration of the server installation

You can also:

* In case of a ZIP installation: run SonarQube Server as a service on [Operating the server](/sonarqube-server/10.8/setup-and-upgrade/operating-the-server.md).
* Run SonarQube Server [behind a proxy](https://docs.sonarsource.com/sonarqube/9.9/setup-and-upgrade/configure-and-operate-a-server/operating-the-server/)
* Monitor and adjust [SonarQube Server instance](/sonarqube-server/10.8/server-upgrade-and-maintenance/monitoring/instance.md)
* Install a [Install a plugin](/sonarqube-server/10.8/setup-and-upgrade/plugins/install-a-plugin.md).

## Changing the web server connection parameters <a href="#change-server-connection-parameters" id="change-server-connection-parameters"></a>

To set up the web server connection:

* For a server installation from the ZIP file: Verify and change if necessary the following properties in the SonarQube Server configuration file (`<sonarqubeHome>/conf/sonar.properties`).
* For a server installation from the Docker image: Verify and change if necessary the following environment variables.

| **Property (ZIP installation)** | **Environment variable (Docker installation)** | **Description**                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| sonar.web.host                  | SONAR\_WEB\_HOST                               | <p>For servers with more than one IP address, this property specifies which address will be used for listening on the specified ports.</p><p><strong>Default value</strong>: 0.0.0.0 (ports will be used on all IP addresses associated with the server)</p>                                                                                                                                              |
| sonar.web.port                  | SONAR\_WEB\_PORT                               | <p>TCP port for incoming HTTP connections.</p><p><strong>Default value</strong>: 9000</p>                                                                                                                                                                                                                                                                                                                 |
| sonar.web.context               | SONAR\_WEB\_CONTEXT                            | <p>Web context specifying the path at which to serve SonarQube Server. For example, with <code>sonar.web.port=9000</code> and <code>sonar.web.context=/sonarqube</code>, you will access the web interface at <http://localhost:9000/sonarqube>.</p><p><strong>Example</strong>: <code>/sonarqube</code> (must start with a forward slash)</p><p><strong>Default value</strong>: empty (root context)</p> |

## Modifying the default configuration of a server installation <a href="#modify-default-config" id="modify-default-config"></a>

To modify the default configuration:

* For a server installation from the ZIP file: Change the sonar properties in the SonarQube Server configuration file (`<sonarqubeHome>/conf/sonar.properties`).
* For a server installation from the Docker image: Change the sonar [Environment variables](/sonarqube-server/10.8/setup-and-upgrade/environment-variables.md).

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

When running in an environment where the DevOps platform or other related tooling is secured by self-signed certificates, the CA needs to be added to the Java truststore of SonarQube Server.

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:

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

In our official Docker images, you can find the systems truststore in `<JAVA_HOME>/lib/security/cacerts`. In order to add new certificates here as well you can:

* Bind mount an existing truststore containing your certificates to `<JAVA_HOME>/lib/security/cacerts`.

<details>

<summary>Example</summary>

```css-79elbk
docker run -d --name sonarqube -v /path/to/your/cacerts.truststore:/opt/java/openjdk/lib/security/cacerts:ro -p 9000:9000 sonarqube 
```

</details>

* Import your CA certificate the same way as in the zip installation but inside the container.

If you deploy SonarQube Server on Kubernetes using the official Helm Chart, you can create a new secret containing your required certificates and reference this via:

```css-79elbk
caCerts:
  enabled: true
  image: adoptopenjdk/openjdk17:alpine
  secret: your-secret
```

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

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

```css-79elbk
echo "networkaddress.cache.ttl=5" >> "${JAVA_HOME}/conf/security/java.security" 
```

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


---

# 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/10.8/setup-and-upgrade/install-the-server/advanced-installation-features.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.
