# How to Build a Cluster Database and Create Repository

Before you start using the Astera server, a repository must be set up. Astera supports SQL Server and PostgreSQL for building cluster databases, which can then be used for maintaining the repository. The repository is where job logs, job queues, and schedules are kept.

To see these options, go to *Server > Configure > Step 1: Build repository database and configure server*.

<figure><img src="/files/kzcXkpiG2nqvlt5gFhmx" alt=""><figcaption></figcaption></figure>

The first step is to point to the SQL Server or PostgreSQL instance where you want to build the repository and provide the credentials to establish the connection.

<figure><img src="/files/wfy0OgRHroAPl8YKIy8V" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Astera will not create the database itself, just the tables. A database will have to be created beforehand or an existing database can be used. We recommend Astera to have its own database for this purpose.
{% endhint %}

### Building a Repository on SQL Server

1. Go to *Server > Configure > Step 1: Build repository database and configure server*.
2. Select SQL Server from the Data Provider drop-down list and provide the credentials for establishing the connection.
3. From the drop-down list next to the Database option, select the database on the SQL instance where you want to host the repository.

<figure><img src="/files/4GUhWVkK4RnRiSl8v3J6" alt=""><figcaption></figcaption></figure>

4. Click *Test Connection* to test whether the connection is successfully established or not. You should be able to see the following message if the connection is successfully established.

<figure><img src="/files/CTE2XIizvLgGSWZQA2P4" alt="" width="374"><figcaption></figcaption></figure>

4. Click *OK* to exit out of the test connection window and again click *OK*, the following message will appear. Select *Yes* to proceed.

<figure><img src="/files/Jow4vaChhGTV5h09ZkSm" alt=""><figcaption></figcaption></figure>

The repository is now set up and configured with the server to be used.

The next step is to log in using your credentials.

### Building a Repository on PostgreSQL

1. Go to *Server > Configure > Step 1: Build repository database and configure server*.
2. Select PostgreSQL from the Data Provider drop-down list and provide the credentials for establishing the connection.
3. From the drop-down list next to the *Database* option, select the database on the PostgreSQL instance where you want to host the repository.

<figure><img src="/files/nxmQqrmTQDqVD8pHY1cH" alt=""><figcaption></figcaption></figure>

4. Click *Test Connection* to test whether the connection is successfully established or not. You should be able to see the following message if the connection is successfully established.

<figure><img src="/files/lnY9yYdRfiB9vea6Mos1" alt="" width="300"><figcaption></figcaption></figure>

5. Click *OK* and the following message will appear. Select *Yes* to proceed.

<figure><img src="/files/Kn9v3nieuCw1W9e2gkWq" alt=""><figcaption></figcaption></figure>

The repository is now set up and configured with the server to be used.

The next step is to log in using your credentials.


---

# 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://documentation.astera.com/setting-up/on-prem/how-to-build-a-cluster-database-and-create-repository.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.
