---
title: Provisioning
url: https://docs.vultr.com/products/storage/databases/postgresql/provisioning
description: A guide explaining how to set up and configure a new PostgreSQL database instance in Vultrs Managed Database service.
publish_date: 2024-09-23T20:21:37.951198Z
last_updated: 2026-05-26T19:43:28.050004Z
---

# How to Provision Vultr Managed Databases for PostgreSQL

Vultr Managed Databases for PostgreSQL is a highly available and scalable relational database solution that supports modern features like vectors, JSON, and geometric data types. PostgreSQL integrates with modern programming languages like PHP, Python, and Go, making it an ideal choice for developing web applications and application programming interfaces (APIs). PostgreSQL databases are available in major global Vultr locations and you can choose from CPU-optimized, memory-optimized, and general-purpose server types.

Follow this guide to provision Vultr Managed Databases for PostgreSQL using the Vultr Console, API, CLI, or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and click **Databases**.
    1. Click **Add Managed Database**.
    1. Select **PostgreSQL** as the database engine.
    1. Click the version drop-down and select your target PostgreSQL version.
    1. Click the **Server Type** drop-down and select your desired server type.
    1. Click the **Plan** drop-down and select the server specifications.
    1. Click the **Number of Failover Replica Nodes** drop-down and select the number of **failover replica nodes** to ensure high-availability incase the primary node fails.
    1. Select your target server location.
    1. Optional: click the **VPC** drop-down and select a VPC network if available on your account.
    1. Enter a descriptive label in the **Label** field to identify your Vultr Managed Databases for PostgreSQL.
    1. Review the plan, and cost estimates summary.
    1. Click **Deploy Now** to provision the Vultr Managed Databases for PostgreSQL cluster.

=== "Vultr API"

    1. Send a `GET` request to the [**List Regions** endpoint](https://www.vultr.com/api/#tag/region/operation/list-regions) and note your target Vultr region ID.

        ```console
        $ curl "https://api.vultr.com/v2/regions" \
          -X GET \
          -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `GET` request to the [**List Managed Database Plans** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/list-database-plans) to view all available database engines and plans in your target Vultr region.

        ```console
        $ curl "https://api.vultr.com/v2/databases/plans?region=<region-id>" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}"
        ```

    1. Send a `POST` request to the [**Create Database** endpoint](https://api.vultr.com/v2/databases) to provision a Vultr Managed Databases for PostgreSQL cluster with your database engine, version, plan and target Vultr region.

        ```console
        $ curl "https://api.vultr.com/v2/databases" \
            -X POST \
            -H "Authorization: Bearer ${VULTR_API_KEY}" \
            -H "Content-Type: application/json" \
            --data '{
                "database_engine" : "pg",
                "database_engine_version" : "<version>",
                "plan" : "<server-plan>",
                "region" : "<region-id>",        
                "label" : "<label>"
            }'
        ```

        Visit the [**Create Database** endpoint](https://api.vultr.com/v2/databases) to view additional attributes to apply to your request Vultr Managed Databases for PostgreSQL provisioning request.

    1. Send a `GET` request to the [**List Managed Databases** endpoint](https://www.vultr.com/api/#tag/managed-databases/operation/list-databases) to list all Vultr Managed Databases in your account.

        ```console
        $ curl "https://api.vultr.com/v2/databases" \
            -X GET \
            -H "Authorization: Bearer ${VULTR_API_KEY}" \
            -H "Content-Type: application/json"
        ```

=== "Vultr CLI"

    1. List all Vultr regions and note your target region ID.

        ```console
        $ vultr-cli regions list
        ```

    1. List all available database plans and note your target plan.

        ```console
        $ vultr-cli database plan list
        ```

    1. Provision a Vultr Managed Databases for PostgreSQL cluster with your target plan and region.

        ```console
        $ vultr-cli database create \
        --database-engine pg \
        --database-engine-version <version> \
        --plan <server-plan> \
        --region <region-id> \
        --label <label>
        ```

        Run `vultr-cli database create --help` to view all available options to apply to your Vultr Managed Databases for PostgreSQL provisioning request.

    1. List all Vultr Managed Databases in your account.

        ```console
        $ vultr-cli database list  
        ```

=== "Terraform"

    1. Ensure the [Vultr Terraform provider](https://registry.terraform.io/providers/vultr/vultr/latest/docs) is configured in your Terraform project.

    1. Define the Managed Database for PostgreSQL in your Terraform configuration file.

        ```terraform
        terraform {
            required_providers {
                vultr = {
                    source  = "vultr/vultr"
                    version = "~> 2.26"
                }
            }
        }

        provider "vultr" {}

        resource "vultr_database" "pg" {
            database_engine         = "pg"
            database_engine_version = "16"
            region                  = "ewr"  # e.g., ewr, ams, sgp
            plan                    = "vultr-dbaas-startup-cc-1-55-2"
            label                   = "pg-cluster-1"

            # Optional
            # vpc_id      = "<vpc-id>"
            # trusted_ips = ["192.0.2.1", "192.0.2.2"]
        }

        output "pg_host" { value = vultr_database.pg.host }
        output "pg_port" { value = vultr_database.pg.port }
        ```

    1. Apply the configuration and observe the following output:

        ```
        Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
        ```
