How to Provision Vultr Managed Databases for PostgreSQL

Updated on November 27, 2024

Vultr Managed Databases for PostgreSQL is a highly available and scalable relational database that supports modern features like vectors, JSON, and geometric data types. PostgreSQL integrates well with modern programming languages like 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 Customer Portal, API, and CLI.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  1. Navigate to Products and select Databases.

  2. Click Add Managed Database.

    Add Managed Database

  3. Choose PostgreSQL as the database engine and select a version.

    Choose the Database Engine

  4. Select the Server Type, Plan, and Number of Replica Nodes.

    Select the Server Type

  5. Choose a server location.

    Choose a Server Location

  6. Select a VPC Network.

    Select a VPC Network

  7. Enter a database label, review the monthly and hourly cost estimates, and click Deploy Now.

    Enter a Database Label

  1. Send a GET request to the List Managed Database Plans endpoint to view all available plans.

    console
    $ curl "https://api.vultr.com/v2/databases/plans" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a POST request to the Create Database endpoint to create a new database instance.

    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" : "16",
            "plan" : "vultr-dbaas-startup-cc-1-55-2",
            "region" : "jnb",        
            "label" : "Remote-PostgreSQL-Db"
        }'
    

    Visit the Create Database endpoint to view additional attributes to add to your request.

  3. Send a GET request to the List Managed Databases endpoint to list all database instances.

    console
    $ curl "https://api.vultr.com/v2/databases" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json"
    
  1. List the available database plans.

    console
    $ vultr-cli database plan list
    
  2. Create a new PostgreSQL database instance.

    console
    $ vultr-cli database create \
    --database-engine pg \
    --database-engine-version 15 \
    --plan vultr-dbaas-startup-cc-1-55-2 \
    --region jnb \
    --vpc-id 24ab6b57-845b-4354-a243-9bcafb4bd505 \
    --label Remote-PostgreSQL-Db
    
  3. List all database instances.

    console
    $ vultr-cli database list
    

    Run vultr-cli database create --help to view all options.