---
title: "ezgh databases create"
description: "Create a database."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh databases create

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh databases create <name> --engine e --engine-version v --instance-type t --subnet s --storage-size-gib n [flags] [--wait]
```

Create a database in a subnet of your VPC. `ezgh databases engine-versions` lists the engines (postgresql, percona, mariadb) and versions. The subnet needs at least 16 free addresses. The admin password is written to a new Secret in the project, which `ezgh databases connection` names. It takes minutes: `--wait` waits until it's available and prints it.

Part of [`ezgh databases`](/cli/reference/databases).

## Examples

```sh
ezgh databases create orders --engine postgresql --engine-version 18 --instance-type gp-1.large \
  --subnet sbn_2m9x0a7qpe4k --storage-size-gib 100 --wait
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--allowed-source-cidr` | string, repeatable |  | an IPv4 CIDR that may connect; repeat for more, at most 20 (default the VPC's ranges) |
| `--backup-retention-days` | int |  | days automated backups are kept, 1 to 35 (default 7) |
| `--backup-window` | string |  | when the daily backup is taken, HH:MM-HH:MM UTC, at least 30 minutes |
| `--deletion-protection` | boolean |  | refuse deletes until it's turned off |
| `--description` | string |  | what it's for |
| `--engine` | string |  | postgresql, percona or mariadb |
| `--engine-version` | string |  | the engine's version |
| `--instance-type` | string |  | a gp-1 or gs-1 instance type, from ezgh compute instance-types list |
| `--log-export` | string, repeatable |  | send these logs to Obs: error, slow or audit; repeat for more |
| `--maintenance-window` | string |  | when maintenance happens, ddd:HH:MM-ddd:HH:MM UTC, at least 30 minutes |
| `--parameter` | string, repeatable |  | an engine parameter, name=value; repeat for more; names from ezgh databases engine-versions -o json |
| `--storage-iops` | int |  | its storage's IOPS (default the volume type's) |
| `--storage-size-gib` | int |  | its storage, in GiB |
| `--storage-throughput` | int |  | its storage's throughput, in MB/s (default the volume type's) |
| `--subnet` | string |  | the subnet it's in (sbn\_…), with at least 16 free addresses |
| `--tag` | string, repeatable |  | a tag, key=value; repeat for more |
| `--volume-type` | string |  | its storage's volume type (default gp1) |
| `--wait` | boolean |  | wait until it's available, and print it then |
| `--wait-timeout` | duration | `10m0s` | how long `--wait` waits |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/databases-create/index.mdx
