> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/databases/postgresql/how-tos/v2/create-postgresql-cluster.md).

# Create a PostgreSQL Cluster

Using this guide, you can now create clusters in the DCD using the new v2 infrastructure.

{% hint style="info" %}
**Prerequisites:** Before setting up a database, please make sure you are working within a provisioned [<mark style="color:blue;">VDC</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#vdc) that contains at least one [<mark style="color:blue;">virtual machine</mark>](https://docs.ionos.com/cloud/support/general-information/glossary-of-terms#virtual-machine-vm) from which to access the database. The VM you create is counted against the quota allocated in your contract.
{% endhint %}

{% hint style="info" %}
**Note:** Database Manager is available only for contract administrators, owners, and users with **Access and manage DBaaS** privilege. You can set the privilege via the DCD group privileges.
{% endhint %}

{% stepper %}
{% step %}

## Navigate to PostgreSQL cluster overview

1\. In the **DCD**, go to **Menu** > **Databases** > **PostgreSQL**.

{% hint style="info" %}
**Info:** The **Resource allocation** section displays the resources allotted to your contract and the number of used and unused resources if you have already created PostgreSQL clusters.
{% endhint %}

![Number of used and unused resources](/files/tW2MVuw7gMvtB5VRZDcX)

2\. From the **PostgreSQL cluster overview** page, click **Create cluster**.
{% endstep %}

{% step %}

## Define cluster properties

Specify the following:

1\. **Cluster Name:** Provide an appropriate name for the cluster.

2\. **Location:** Select the region where the cluster will be deployed. In v2, each cluster is bound to a region-specific API endpoint. The location you select determines which endpoint manages the cluster and affects latency for all cluster operations. This cannot be changed after the cluster is created.

![Define Cluster Properties](/files/wxgkc5pGXMY7LH1xskSa)
{% endstep %}

{% step %}

## (Optional) Restore from a backup

To create a PostgreSQL cluster from the available backups directly, go to the **Create from backup** section and follow these steps:

1\. **Backup cluster:** Select from the drop-down list of cluster backups.

2\. **Recover target time:** Click the Calendar icon to select a date and time:

* Select the **recovery date** from the calendar.
* Select the **recovery time** using the clock.

![Create backup](/files/A7d78YUDAYW7ldOZUv2i)
{% endstep %}

{% step %}

## Configure the cluster

In the **Cluster configuration** section, enter the following details:

1\. **PostgreSQL Version:** Select the appropriate <code class="expression">space.vars.ionos\_cloud</code> Database Manager versions, such as 14, 15, 16, 17, and 18.

2\. **Instances:** Enter the number of instances in the cluster. One PostgreSQL instance always manages the data of exactly one database cluster. You can create a maximum of five instances within a cluster.

{% hint style="info" %}
**Note:** Here, you will have a **primary** node and one or more standby nodes that run a copy of the active database, so you have **n-1 standby** instances in the cluster.
{% endhint %}

3\. **Synchronization mode:** Select the mode of replication:

* **Asynchronous:** In asynchronous mode, the primary PostgreSQL instance does not wait for a replica to indicate that it wrote the data. The cluster can lose some committed transactions to ensure availability. It is selected by default.
* **Synchronous:** Synchronous replication allows the primary node to be run standalone. The primary PostgreSQL instance will wait for any or all replicas. So, no transactions are lost during failover.

{% hint style="warning" %}
**Note:**

* You must choose either **Asynchronous** or **Strictly Synchronous**, as **Synchronous** replication mode is deprecated and will be fully removed in upcoming releases.

* You can update the existing clusters on **Synchronous** mode to either **Asynchronous** or **Strictly Synchronous** using the [<mark style="color:blue;">Update PostgreSQL Replication Mode</mark>](/cloud/databases/postgresql/api/v1-api/modify-cluster-attributes/update-postgresql-replication-mode.md) API.
  {% endhint %}

* **Strictly Synchronous:** It is similar to the synchronous mode but requires two operating nodes.

4\. **Connection Pooler:** Select a mode from the drop-down list. It defines how database connections are managed and reused. The following options are available:

* **Disabled:** Creates a new connection for every request. It provides strongest isolation but causes connection overhead.
* **Transaction:** A connection is assigned during a transaction and returned to the pool when the transaction ends. Connections are pooled and reused. It provides efficiency and transaction integrity.
* **Session:** A connection is assigned during a client session. It is reused across transactions. It provides the highest performance but holds resources for longer, depending on the session length.

5\. **Backup Location:** Select your cluster backup location (region). You can have off-site backups by using a region that is not included in your database region.

6\. **Backup retention (days):** Enter the number of days to retain the backup. The default is **7** days. You can set a value between **1** and **365** days.

![Configure your PostgreSQL cluster](/files/KpaoD4rz65oq8EihPdZi)
{% endstep %}

{% step %}

## Configure instances

In the **Instance configuration** section, specify the following:

1\. **Number of CPUs (per instance):** Select the number of CPU cores using the slider or choose from the available shortcut values.

2\. **RAM Size (per instance):** Select the RAM size using the slider or choose from the available shortcut values.

3\. **Storage Size:** Enter the storage size value in Gigabytes. Storage type is **SSD Premium** by default.

![Configure instances](/files/zvKg1r5KHkWxgH9lHBaV)
{% endstep %}

{% step %}

## Configure the network

In the **Network configuration** section, provide the following information to connect your cluster with the datacenter:

1\. **Virtual Data Center:** Select a datacenter from the available list. The list displays all available data center locations for the selected cluster creation location.

2\. **VDC LAN:** Select a LAN for your datacenter.

3\. **Private IP:** Select a private IP address from the drop-down list. For more information, see [<mark style="color:blue;">Private IP Address Ranges</mark>](https://www.ionos.com/help/server-cloud-infrastructure/private-network/private-ip-address-ranges/).

{% hint style="info" %}
**Note:** To know your **private IP address/Subnet**, you must:

* Create a single server connected to an empty private LAN and check the IP assigned to that NIC in that LAN. The **DHCP** in that LAN always uses a **/24 subnet**, so you must reuse the **first 3 octets** to reach your database.
* To prevent a collision with the DHCP IP range, we recommend using IP addresses ending between **x.x.x.3/24** and **x.x.x.10/24** (which are never assigned by DHCP).
* If you have disabled DHCP on your private LAN, you must discover the IP address on your own.
  {% endhint %}

![Configure network](/files/joCRIhCeCMSzJQoiagOE)
{% endstep %}

{% step %}

## Set the maintenance window

In the **Maintenance period (optional)** section, you can set a maintenance day and time:

1\. **Day:** Select a day from the drop-down list.

2\. **Start Time (UTC):** Enter a time using the pre-defined format (hh:flag\_mm:ss) to schedule the maintenance task. You can also click the ![Clock icon](/files/qchgBuxKMLdDjQbH2Vom) icon to set a time.

{% hint style="info" %}
**Note:** We recommend choosing the day and time appropriately because the maintenance occurs in a **4-hour-long window**.
{% endhint %}

![Schedule maintenance](/files/p6lzS1VT2jYwYsBWIQA5)
{% endstep %}

{% step %}

## Configure Observability

In the **Observability** section, you can turn-on the following:

1\. **Enable logs:** Turn-on to forward cluster logs to your logging endpoint.

2\. **Enable metrics:** Turn-on to forward cluster metrics to your monitoring endpoint.

{% hint style="info" %}
**Note:**

* By default, both logs and metrics are not turned-on.
* Observability services must be activated for your contract before logs and metrics can be collected. If not activated, selecting these settings is accepted but has no effect. To activate the Observability service, see [<mark style="color:blue;">Central Logging</mark>](/cloud/observability/logging-service/dcd-how-tos/central-logging.md) and [<mark style="color:blue;">Central Monitoring</mark>](/cloud/observability/monitoring-service/dcd-how-tos/central-monitoring.md).
  {% endhint %}

![Observability](/files/KmSGD5mKnwV4TUpyvOdb)
{% endstep %}

{% step %}

## Create the database user

In the **User Creation** section, provide the following details:

1\. **Username:** Enter a username to provide access to the PostgreSQL cluster for the respective user.

2\. **Password:** Enter a password for the respective user.

3\. **Database Name:** Enter a name for the initial database to be created in the cluster.

{% hint style="info" %}
**Note:** The credentials will be overwritten if the user already exists in the backup.
{% endhint %}

![Define user](/files/JeHLeFgcOyYNKspe3Kro)

{% hint style="info" %}
**Note:** The **Estimated costs** will be displayed based on the input. It is exclusive and certain variables like traffic and backup are not considered.
{% endhint %}

![Estimated costs](/files/yQJNtCoWYZUBYxCJigGj)
{% endstep %}

{% step %}

## Save the cluster

Click **Save** to create the PostgreSQL cluster.
{% endstep %}
{% endstepper %}

{% hint style="success" %}
**Result:** Your PostgreSQL cluster is created. Its **STATE** is set to **PROVISIONING** while the cluster is being created. Once complete, the cluster returns to **AVAILABLE**.
{% endhint %}

![PostgreSQL cluster creation started](/files/qzuymkJ4Kzq5Chn2RoO7)

## Next steps

* [<mark style="color:blue;">View PostgreSQL Clusters</mark>](/cloud/databases/postgresql/how-tos/v2/view-postgresql-cluster-details.md): View the details and status of your newly created cluster.
* [<mark style="color:blue;">Update a PostgreSQL Cluster</mark>](/cloud/databases/postgresql/how-tos/v2/update-postgresql-cluster.md): Modify cluster properties such as instances, resources, and maintenance settings.


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/databases/postgresql/how-tos/v2/create-postgresql-cluster.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
