> For the complete documentation index, see [llms.txt](https://docs.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.collibra.com/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/install-on-self-hosted-spark-standalone.md).

# Install on self-hosted Spark Standalone

After performing the steps in [Before you install on self-hosted Spark Standalone](/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/before-you-install-on-self-hosted-spark-standalone.md), you are ready to install Data Quality & Observability (self-hosted) on self-hosted Spark Standalone.

{% hint style="info" %}
To perform a FIPS-compliant installation of Data Quality & Observability (self-hosted), go to [Configure FIPS-compliant algorithms](/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/configure-fips-compliant-algorithms.md).
{% endhint %}

## Run the setup script

After extracting the DQ package and setting the environment variables (described in [Before you install](/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/before-you-install-on-self-hosted-spark-standalone.md)), you are ready to run the `setup.sh` script. This script installs Collibra DQ and the required components, including Spark and PostgreSQL. You may install the components separately or at the same time.

When executing the `setup.sh` script, use the `-options` parameter to specify which components are installed. The options are:

* `spark` (required)
* `owlweb` (required)
* `owlagent` (required)
* `postgres` (optional)

Note that Java is a required component, but it is not included in the installation package.

You have the option to include the PostgreSQL metastore in the installation or use an external PostgreSQL metastore (recommended). Both options are described next.

## Install Collibra DQ, Spark, and PostgreSQL metastore

To include PostgreSQL metastore in the installation process, include postgres in the `-options` parameter. For example, the following command executes `setup.sh` and installs PostgreSQL locally:

```
./setup.sh \
-owlbase=$OWL_BASE \
-user=$OWL_METASTORE_USER \
-pgpassword=$OWL_METASTORE_PASS \
-options=postgres,spark,owlweb,owlagent
```

When the setup script completes, you are prompted to finish the PostgreSQL installation:

```
Postgres DB needs to be intialized. Default location = <OWL_BASE>/postgres/data
to change path please enter a FULL valid path for Postgres and hit <enter>
DB Path [ <OWL_BASE>/owl/postgres/data ] =
```

Use the default location unless the PostgreSQL needs to be hosted at a specific location. If you change the location, verify that the directory is writable.

{% hint style="info" %}
To see the directory structure created by `setup.sh`, go to [Data Quality & Observability (self-hosted) Directory Structure](/data-quality-self-hosted/architecture/data-quality-observability-self-hosted-directory-structure.md).
{% endhint %}

If you would like to install DQ Web on a machine with DQ Agent already installed, update the `owl-env.sh` file based on your specific configuration, then run the following command: `./owlmanage.sh start=owlweb`.

{% hint style="info" %}
For additional configuration options in `setup.sh`, `owl-env.sh`, and `owl.properties`, go to [Additional Spark Standalone configuration options](/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/additional-spark-standalone-configuration-options.md).
{% endhint %}

## Install Collibra DQ and Spark with an external PostgreSQL metastore (recommended)

If you would like to use an external PostgreSQL metastore, such as a GCP Cloud SQL service, omit `postgres` from the `-options` parameter and include `-pgserver` in the command. For example:

```
./setup.sh \
-owlbase=$OWL_BASE \
-user=$OWL_METASTORE_USER \
-pgpassword=$OWL_METASTORE_PASS \
-options=spark,owlweb,owlagent \
-pgserver="localhost:5432/postgres"
```

In this example, the installation process does not install PostreSQL and instead uses the existing PostgresDB server located in `localhost:5432` with the `postgres` database, which is the default DQ metadata storage.

{% hint style="info" %}
To see the directory structure created by `setup.sh`, go to [Data Quality & Observability (self-hosted) Directory Structure](/data-quality-self-hosted/architecture/data-quality-observability-self-hosted-directory-structure.md).
{% endhint %}

{% hint style="info" %}
For additional configuration options in `setup.sh`, `owl-env.sh`, and `owl.properties`, go to [Additional Spark Standalone configuration options](/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/additional-spark-standalone-configuration-options.md).
{% endhint %}

## What's next

[Complete the initial setup](/data-quality-self-hosted/installation/installing-data-quality-observability-self-hosted-on-self-hosted-spark-standalone/complete-the-initial-setup.md)
