> For the complete documentation index, see [llms.txt](https://docs.perfectscale.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/getting-started/provisioner-installation-with-managed-postgres.md).

# Provisioner installation with Managed Postgres

To install the PerfectScale Provisioner with Managed Postgres, you first need to set up a Postgres database and then configure its connection details in the config.yaml file for the PerfectScale self-hosted platform.

## Prerequisites

1. A running Postgres instance (either self-hosted or managed).
2. Access to the Postgres instance with sufficient privileges to create databases and users.
3. The Postgres instance should be accessible from the PerfectScale on-prem cluster nodes.

{% hint style="info" %}
We tested it using PostgreSQL version 16.
{% endhint %}

## Provisioning options

You can use one of the following options in order to configure provisioning:

* **Manual provisioning** - requires manual creation of databases, users, and schemas.
* **Automated provisioning** - requires passing superuser credentials to PerfectScale on-prem, and it will create databases, users, and schemas on your behalf.

### Manual Provisioning

In this case, you don't need to pass superuser (postgres by default) credentials to PerfectScale, instead, you need to manually create databases, users, and schemas.

In the `config.yaml` file, you need to set the following parameters:

{% hint style="info" %}
Ensure to update the host, port, and SSL mode to your values.
{% endhint %}

```yaml
deploy_postgres_chart: false
deploy_postgres_init_chart: false
postgres_host: <your-postgres-host>
postgres_port: 5432
postgres_ssl_mode: require
```

To get SQL commands for manual provisioning, use the `provisioner` CLI tool:

```bash
/provisioner pg-init-print
```

### Automated Provisioning <a href="#automated-provisioning" id="automated-provisioning"></a>

To automate provisioning, you need to pass superuser credentials to PerfectScale. In this case, PerfectScale will create databases, users, and schemas on your behalf.

In the `config.yaml` file, you need to set the following parameters:

```yaml
deploy_postgres_chart: false
deploy_postgres_init_chart: true
postgres_host: <your-postgres-host>
postgres_port: 5432
postgres_ssl_mode: require
postgres_admin_user_name: <your-postgres-superuser> # e.g. postgres
postgres_admin_user_pass: <your-postgres-superuser-password>
```

{% hint style="info" %}
Postgres superuser credentials are stored in the postgres-creds secret (key postgres-password) in the PerfectScale Onprem namespace.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.perfectscale.io/2.0-self-hosted-or-perfectscale-documentation/getting-started/provisioner-installation-with-managed-postgres.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.
