--- title: "createCloudPostgresqlInstance" slug: "cli-vpostgresql-createcloudpostgresqlinstance" tags: ["Cloud DB for PostgreSQL", "VPC"] updated: 2026-09-17T10:08:42Z published: 2026-09-17T10:08:42Z canonical: "cli.ncloud-docs.com/cli-vpostgresql-createcloudpostgresqlinstance" --- > ## Documentation Index > Fetch the complete documentation index at: https://cli.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # createCloudPostgresqlInstance Available in VPC Create a Cloud DB for PostgreSQL instance. ## Syntax The `createCloudPostgresqlInstance` syntax is as follows: ``` ./ncloud vpostgresql createCloudPostgresqlInstance \ --vpcNo \ --subnetNo \ --cloudPostgresqlServiceName \ --cloudPostgresqlServerNamePrefix \ --cloudPostgresqlDatabaseName \ --cloudPostgresqlUserName \ --cloudPostgresqlUserPassword \ --clientCidr \ [--cloudPostgresqlImageProductCode ] \ [--cloudPostgresqlProductCode ] \ [--engineVersionCode ] \ [--dataStorageTypeCode ] \ [--isStorageEncryption ] \ [--isHa ] \ [--isMultiZone ] \ [--secondarySubnetNo ] \ [--isBackup ] \ [--isAutomaticBackup ] \ [--backupTime ] \ [--backupFileRetentionPeriod ] \ [--backupFileStorageCount ] \ [--isBackupFileCompression ] \ [--cloudPostgresqlPort ] \ [--regionCode ] \ [--output ] ``` ## Options This section describes the options available when running `createCloudPostgresqlInstance`. ### Required options The following options are required for `createCloudPostgresqlInstance`. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--vpcNo` | String | Required | Number of VPC to create the Cloud DB for PostgreSQL instance in - See [getCloudPostgresqlTargetVpcList](/docs/en/cli-vpostgresql-getcloudpostgresqltargetvpclist). | | `--subnetNo` | String | Required | Subnet number of the default network interface to be used in the Cloud DB for PostgreSQL instance - Subscription to public domains can only be done in a DB server created in public subnet. - Subnet migrations are not available after creating the Cloud DB for PostgreSQL instance. - See [getCloudPostgresqlTargetSubnetList](/docs/en/cli-vpostgresql-getcloudpostgresqltargetsubnetlist). | | `--cloudPostgresqlServiceName` | String | Required | Cloud DB for PostgreSQL service name - Enter 3-30 characters, including English letters, Korean letters, numbers, and special character `-`. | | `--cloudPostgresqlServerNamePrefix` | String | Required | Prefix for the Cloud DB for PostgreSQL server name - Enter 3-20 characters, including lowercase English letters, numbers, and special character `-`. - The string must begin with an English letter and end with an English letter or number. - A three-digit number is automatically generated after the prefix, and random text is added to prevent hostname duplication. - Example: If the prefix is `test-123`: `test-123-001-523a`. | | `--cloudPostgresqlDatabaseName` | String | Required | DB name to be created by default in the Cloud DB for PostgreSQL instance - Enter 1-30 characters, including lowercase English letters, numbers, and special character `_`. - The string must begin with an English letter. | | `--cloudPostgresqlUserName` | String | Required | DB user ID - Enter 4-16 characters using a combination of lowercase English letters, numbers, and special character `_`. - The string must start with an English letter. - Predefined roles or reserved words can't be used. | | `--cloudPostgresqlUserPassword` | String | Required | DB user account password - Enter 8-20 characters containing at least one English letter, number, and special character. - Special characters ``` `&` `+` `\` `"` `'` `/` and spaces can't be used. - User ID can't be included. | | `--clientCidr` | String | Required | CIDR range of clients allowed to connect to the PostgreSQL server - Allow all: `0.0.0.0/0` - Specific IP: `192.168.1.1/32` - IP range: `192.168.1.0/24` | | `--isMultiZone` | Boolean | Conditional | Multi-zone status - `true` \| `false` (default) - `true`: Create the primary and secondary servers in separate zones to provide higher availability. - `false`: Multi-zone not enabled. - Required if `isHa`=`true`. - Unavailable in the Neurocloud environment. | | `--secondarySubnetNo` | String | Conditional | Subnet number of the secondary server - Must be entered for multi-zone Cloud DB for PostgreSQL. - It must be in a different zone from the primary server's subnet, but the public or private status must match. - See [getCloudPostgresqlTargetSubnetList](/docs/en/cli-vpostgresql-getcloudpostgresqltargetsubnetlist). | | `--backupTime` | String | Conditional | Set backup time (HH:MM). - Required if `isBackup`=`true` and `isAutomaticBackup`=`false`. | ### Optional options These are the optional options for `createCloudPostgresqlInstance`. Options that are not specified will use their default values. | Options | Type | Required | Description | | --- | --- | --- | --- | | `--cloudPostgresqlImageProductCode` | String | Optional | Cloud DB for PostgreSQL image product code - Automatically generated by NAVER Cloud Platform. - See [getCloudPostgresqlImageProductList](/docs/en/cli-vpostgresql-getcloudpostgresqlimageproductlist). | | `--cloudPostgresqlProductCode` | String | Optional | Cloud DB for PostgreSQL product code - Determine the server specifications for the Cloud DB for PostgreSQL instance. - Default: Minimum specifications (in the order of memory, CPU) - See [getCloudPostgresqlProductList](/docs/en/cli-vpostgresql-getcloudpostgresqlproductlist). | | `--engineVersionCode` | String | Optional | DB engine version - If not entered, it is created with the latest version currently available. - Can be entered if `generationCode` of `cloudPostgresqlImageProductCode` is `G3`. - See [getCloudPostgresqlImageProductList](/docs/en/cli-vpostgresql-getcloudpostgresqlimageproductlist). | | `--dataStorageTypeCode` | String | Optional | Data storage type code - Valid values vary depending on the `generationCode` of `cloudPostgresqlImageProductCode`. - G2: `SSD` (default) \| `HDD` - G3: `CB2` (default) - You cannot change the data storage type after installation. | | `--isStorageEncryption` | Boolean | Optional | Data storage encryption application status (to be applied later) - `true` \| `false` (default) - When encryption is applied, the DB data is encrypted and saved in the storage. - You can't change the storage encryption settings after creating a Cloud DB for PostgreSQL instance. - Unavailable in the Neurocloud environment | | `--isHa` | Boolean | Optional | High availability status - `true` (default) \| `false` - `true`: It creates two servers, including a secondary server, and incurs additional fees. - `false`: `isMultiZone` and `secondarySubnetNo` are unavailable. | | `--isBackup` | Boolean | Optional | Whether PostgreSQL backup is enabled - `true` (default) \| `false` - If `isHa`=`true`, it is fixed to `true`. | | `--isAutomaticBackup` | Boolean | Optional | Whether to set the backup time automatically - `true` (default) \| `false` - If set to `true`, `backupTime` can't be entered. | | `--backupFileRetentionPeriod` | Integer | Optional | Backup file retention period (days) - `1` (default) - Backup is performed every day, and the backup file is stored in a separate backup storage. - Fees are charged for the space you use. | | `--backupFileStorageCount` | Integer | Optional | Number of backup files to retain - `1`-`30` | | `--isBackupFileCompression` | Boolean | Optional | Whether to compress backup files - `true` (default) \| `false` | | `--cloudPostgresqlPort` | Integer | Optional | TCP port number to access the Cloud DB for PostgreSQL instance - `10000`-`20000` (default: `5432`) - The port number can't be changed after it is specified. | ### Common options For information about the options common to all `vpostgresql` subcommands, see [Cloud DB for PostgreSQL (VPC) options](/docs/en/cli-vpostgresql#%EC%98%B5%EC%85%98). ## Examples If the request to create a Cloud DB for PostgreSQL instance is successful, the instance's configuration information and creation status are returned. ### Command The command example is as follows: ``` ./ncloud vpostgresql createCloudPostgresqlInstance \ --vpcNo 12345678 \ --subnetNo 23456789 \ --cloudPostgresqlServiceName test-pgsql \ --cloudPostgresqlServerNamePrefix testpg \ --cloudPostgresqlDatabaseName testdb \ --cloudPostgresqlUserName testuser \ --cloudPostgresqlUserPassword Examplepw123! \ --clientCidr 0.0.0.0/0 \ --cloudPostgresqlImageProductCode SW.VPGSL.OS.LNX64.ROCKY.0810.PGSQL.B050 \ --cloudPostgresqlProductCode SVR.VPGSL.DBSVR.HICPU.C002.M004.NET.SSD.B050.G002 \ --dataStorageTypeCode SSD \ --isHa true \ --cloudPostgresqlPort 13432 \ --regionCode KR \ --output json ``` ### Output The output example is as follows: ``` { "createCloudPostgresqlInstanceResponse": { "totalRows": 1, "cloudPostgresqlInstanceList": [ { "cloudPostgresqlInstanceNo": "34567890", "cloudPostgresqlServiceName": "test-pgsql", "cloudPostgresqlInstanceStatusName": "creating", "cloudPostgresqlInstanceStatus": { "code": "INIT", "codeName": "CLOUD DATABASE (VPC) Init status" }, "cloudPostgresqlInstanceOperation": { "code": "CREAT", "codeName": "CLOUD DATABASE(VPC) Creat OP" }, "cloudPostgresqlImageProductCode": "SW.VPGSL.OS.LNX64.ROCKY.0810.PGSQL.B050", "generationCode": "G2", "engineVersion": "PostgreSQL 15.15", "license": "PostgreSQL License", "cloudPostgresqlPort": 13432, "isHa": true, "isMultiZone": false, "isBackup": true, "backupFileRetentionPeriod": 1, "backupTime": "AUTO", "createDate": "2026-06-09T18:40:14+0900", "accessControlGroupNoList": [], "cloudPostgresqlServerInstanceList": [ { "cloudPostgresqlServerName": "testpg-001-98b4", "cloudPostgresqlServerRole": { "code": "M", "codeName": "Primary" }, "cloudPostgresqlServerInstanceStatusName": "creating", "cloudPostgresqlServerInstanceStatus": { "code": "PEND", "codeName": "CLOUD DATABASE (VPC) server Pending status" }, "cloudPostgresqlServerInstanceOperation": { "code": "CREAT", "codeName": "CLOUD DATABASE (VPC) server Create OP" }, "cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.HICPU.C002.M004.NET.SSD.B050.G002", "regionCode": "KR", "zoneCode": "KR-1", "vpcNo": "12345678", "subnetNo": "23456789", "isPublicSubnet": false, "dataStorageType": { "code": "SSD", "codeName": "SSD" }, "isStorageEncryption": false, "dataStorageSize": 10737418240, "cpuCount": 2, "memorySize": 4294967296, "createDate": "2026-06-09T18:40:14+0900" }, { "cloudPostgresqlServerName": "testpg-002-98b5", "cloudPostgresqlServerRole": { "code": "H", "codeName": "Secondary" }, "cloudPostgresqlServerInstanceStatusName": "creating", "cloudPostgresqlServerInstanceStatus": { "code": "PEND", "codeName": "CLOUD DATABASE (VPC) server Pending status" }, "cloudPostgresqlServerInstanceOperation": { "code": "CREAT", "codeName": "CLOUD DATABASE (VPC) server Create OP" }, "cloudPostgresqlProductCode": "SVR.VPGSL.DBSVR.HICPU.C002.M004.NET.SSD.B050.G002", "regionCode": "KR", "zoneCode": "KR-1", "vpcNo": "12345678", "subnetNo": "23456789", "isPublicSubnet": false, "dataStorageType": { "code": "SSD", "codeName": "SSD" }, "isStorageEncryption": false, "dataStorageSize": 10737418240, "cpuCount": 2, "memorySize": 4294967296, "createDate": "2026-06-09T18:40:14+0900" } ] } ], "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "returnCode": "0", "returnMessage": "success" } } ```