Deploy Database Clusters with tcloud CLI: VPC to PostgreSQL

Create a complete database infrastructure with tcloud CLI. Learn how to create a VPC, subnets, and deploy a highly available PostgreSQL cluster.

2026-02-04
Thalassa Cloud
4 min read

Thalassa Cloud’s Database as a Service (DBaaS) for PostgreSQL gives you managed, highly available Postgres clusters: we handle patching, backups, and failover so you can focus on your applications. You can create and manage clusters from the Console, our API (with Terraform), or the command line.

The tcloud CLI is Thalassa Cloud’s command-line tool. You can manage your infrastructure from the terminal, automate deployments, script changes, or work without leaving the shell.

This guide walks through deploying a PostgreSQL database cluster with tcloud CLI. We start by creating a VPC and subnets, then deploy a highly available database cluster ready for your applications.

Prerequisites

Before you start, make sure you have:

  • tcloud CLI installed and configured with your credentials
  • An active Thalassa Cloud account with the right permissions
  • Basic knowledge of networking (VPCs, subnets, CIDR blocks)

If you need to install tcloud, see our documentation.

Provisioning the infrastructure

Step 1: List Available Regions

First, check which regions are available:

tcloud region ls

This shows all available regions and their zones:

ID                                      NAME    SLUG    ZONES                
2390f948-a7bb-4f7b-9a75-c5ad1dd6dd10    nl-01   nl-01   nl-01a,nl-01b,nl-01c

We use the nl-01 region. You can use the region slug nl-01 instead of the full ID.

Step 2: Create a VPC

A VPC (Virtual Private Cloud) creates an isolated network for your resources. Create a VPC with CIDR block 10.0.0.0/16:

tcloud networking vpc create --name myvpc --region nl-01

The command shows the VPC details:

ID                              NAME    REGION  CIDRS           AGE      
vpc-d5qi8jlv0r1s73dm79h0        myvpc   nl-01   10.0.0.0/16     just now

Save the VPC ID (vpc-d5qi8jlv0r1s73dm79h0). You need it to create subnets.

Step 3: Create Subnets

Subnets divide your VPC into smaller network ranges. For production databases, use dedicated isolated subnets. Create two subnets:

Create a demo subnet:

tcloud network subnets create --vpc vpc-d5qi8jlv0r1s73dm79h0 --name demo --cidr 10.0.1.0/24

Create a private subnet for the database:

tcloud network subnets create --vpc vpc-d5qi8jlv0r1s73dm79h0 --name private --cidr 10.0.2.0/24

Both commands return subnet details:

ID                              NAME    VPC     CIDR            AGE      
subnet-d5qi90tv0r1s73dm79jg     demo    myvpc   10.0.1.0/24     just now
subnet-d5qi93tv0r1s73dm79l0     private myvpc   10.0.2.0/24     just now
Verify Subnet Status

Subnets need a few seconds to provision. Check their status:

tcloud network subnets ls

At first, they show status creating:

ID                              NAME            STATUS          VPC     CIDR            AGE            
subnet-d5qi93tv0r1s73dm79l0     private         creating        myvpc   10.0.2.0/24     7 seconds ago 
subnet-d5qi90tv0r1s73dm79jg     demo            creating        myvpc   10.0.1.0/24     19 seconds ago

Wait a moment and check again. They should change to ready:

ID                              NAME            STATUS  VPC     CIDR            AGE          
subnet-d5qi93tv0r1s73dm79l0     private         ready   myvpc   10.0.2.0/24     1 minute ago
subnet-d5qi90tv0r1s73dm79jg     demo            ready   myvpc   10.0.1.0/24     2 minute ago
Step 4: Deploy a PostgreSQL Database Cluster

Now the networking is ready. Deploy a highly available PostgreSQL cluster. Thalassa Cloud DBaaS provides automatic replication, failover, and backups.

Create a PostgreSQL 18.1 cluster with 2 instances in the private subnet:

tcloud dbaas create \
  --subnet subnet-d5qi93tv0r1s73dm79l0 \
  --engine postgres \
  --engine-version 18.1 \
  --storage 2 \
  --name exampledb \
  --instance-type db-pgp-micro \
  --instances 2 \
  --volume-type block \
  --wait

Here are the parameters:

  • --subnet: The subnet for the database cluster (our private subnet)
  • --engine: Database engine type (postgres)
  • --engine-version: PostgreSQL version (18.1)
  • --storage: Storage size in GB (2)
  • --name: Name for your database cluster
  • --instance-type: Instance size (db-pgp-micro, with 1 vCPU and 1GB RAM)
  • --instances: Number of Database instances (2 for high availability)
  • --volume-type: Storage type (block for persistent block storage)
  • --wait: Wait until the cluster is fully provisioned

The command returns cluster details when provisioning is complete:

ID                      NAME            VPC     ENGINE          VERSION INSTANCE TYPE   INSTANCES       STORAGE STATUS  AGE           
db-d5qm68o1fi8c73f0esj0 exampledb       myvpc   postgres        18.1                    2               2 GB    ready   2 minutes ago
High Availability Architecture

With --instances 2, your cluster has:

  • 1 primary instance: Handles all write operations
  • 2 replica instances: Automatically replicate data and can take over if the primary fails

All instances are automatically distributed across availability zones. This protects against datacenter-level failures. Failovers happen automatically, and the primary instance switches over during updates to maintain high availability.

In case you’re running with just one instance, should the AZ fail, it will automatically be started up in another AZ after a little while.

Conclusion

With just a few commands, you created a complete database infrastructure:

  • A VPC for network isolation
  • Subnets for network segmentation
  • A production-ready PostgreSQL cluster with high availability

The tcloud CLI makes it easy to manage your Thalassa Cloud infrastructure from the command line. Use it for development environments or to automate production deployments.

For more information about tcloud CLI commands, see our CLI documentation. To learn more about DBaaS, see our database documentation.


Related posts