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

# sabaoth postgres create

> Create a PostgreSQL service from the command line

Creates a PostgreSQL service in the effective organization. Because a service is billable, the command asks for confirmation unless you pass `--yes`.

```bash theme={null}
sabaoth postgres create --name <name> --cpu-millicores <n> --memory-mb <n> --storage-gb <n> [options]
```

## Required flags

**--name** `string` *required*

Name for the new service. Must be unique within the organization.

**--cpu-millicores** `integer` *required*

CPU in millicores. `1000` is one vCPU, so `250` is a quarter and `2000` is two.

**--memory-mb** `integer` *required*

Memory in MiB, for example `1024` for 1 GiB.

**--storage-gb** `integer` *required*

Storage in GiB.

## Optional flags

Anything you leave out is left out of the request, and the server applies its own default.

**--postgres-version** `string`

PostgreSQL version. One of `postgres-14`, `postgres-15`, `postgres-16`, `postgres-17` or `postgres-18`.

**--replicas** `integer`

Number of replicas, `1` or more. Each replica is a full copy, so it uses the same CPU, memory and storage again.

**--backup-enabled** `boolean`

Turn scheduled backups on. Use `--no-backup-enabled` to turn them off.

**--backup-retention-days** `integer`

How many days to keep scheduled backups. Your plan sets the maximum; see [Plans and pricing](https://docs.sabaothcloud.com/guides/pricing-plans.md).

**--backup-schedule** `string`

When scheduled backups run, in cron format: minute, hour, day of month, month, day of week. For example, `"0 2 * * *"` is every day at 2:00 AM. Quote it so your shell doesn't expand the `*` characters.

**--yes** `boolean` (default: false)

Skip the confirmation prompt. Required when there's no terminal, for example in CI.

**--org** `string`

Organization to create the service in, instead of the selected one.

**--json** `boolean` (default: false)

Print the result as JSON on stdout.

> [!NOTE]
>
> There is no `--plan` or `--tier` flag. Your organization's subscription decides what you can create, and the server checks your quota.

## Examples

```bash theme={null}
# Half a vCPU, 1 GiB memory, 10 GiB storage, server defaults for everything else
sabaoth postgres create --name orders-db --cpu-millicores 500 --memory-mb 1024 --storage-gb 10

# Pin the version and set a backup schedule
sabaoth postgres create --name orders-db \
  --cpu-millicores 1000 --memory-mb 2048 --storage-gb 20 \
  --postgres-version postgres-17 \
  --backup-enabled --backup-retention-days 14 --backup-schedule "0 2 * * *"

# Non-interactive, for CI
sabaoth postgres create --name preview-db --cpu-millicores 250 --memory-mb 512 --storage-gb 5 --yes --json
```

## Confirmation

The prompt names the organization and every value that will be sent:

```text theme={null}
Create a PostgreSQL cluster in Acme (org_abc):
  Name:      orders-db
  CPU:       500m
  Memory:    1024Mi
  Storage:   10Gi

Anything not listed uses the server default. This provisions billable resources.
Continue? [y/N]
```

Only `y` continues. Any other answer, including just pressing Enter, cancels with `DECLINED` (exit `2`) and nothing is created.

If there's no terminal and you didn't pass `--yes`, the command fails with `CONFIRMATION_REQUIRED` (exit `2`) without sending anything.

## Output

```text theme={null}
Created orders-db (clu_abc), currently provisioning.
Provisioning continues in the background; check with `sabaoth postgres get clu_abc`.
```

With `--json`:

```json theme={null}
{ "id": "clu_abc", "name": "orders-db", "status": "provisioning", "organization_id": "org_abc" }
```

The command returns as soon as the API accepts the request. The service is **not ready yet**. Poll [`sabaoth postgres get`](https://docs.sabaothcloud.com/cli/commands/postgres-get) until `status` is `ready`.

## If the result is unknown

If the request was sent but no response came back (for example, the network dropped), the service may or may not have been created. The CLI **never retries** a create, because a retry could create a second billable service. Instead it fails with `UNKNOWN_MUTATION_OUTCOME`, marked as not retryable.

Run `sabaoth postgres list` to check whether the service exists before trying again.

## Errors

| Code | Exit | Meaning |
| - | - | - |
| `INVALID_RESOURCE_VALUE` | 2 | A resource flag or `--replicas` isn't a whole number of 1 or more. |
| `DECLINED` | 2 | You didn't confirm. Nothing was created. |
| `CONFIRMATION_REQUIRED` | 2 | No terminal to ask for confirmation. Re-run with `--yes`. |
| `CLUSTER_NAME_TAKEN` | 1 | A service with this name already exists in the organization. |
| `CLUSTER_CREATE_NOT_PERMITTED` | 1 | The server refused. Common causes, in order: your account email isn't verified, your role can't create services, the organization has no active subscription, or the request goes over your plan's quota. |
| `UNKNOWN_MUTATION_OUTCOME` | 1 | No response. See [above](#if-the-result-is-unknown). |
| `API_REQUEST_REJECTED` | 1 | The API rejected the request, for example because a value is outside what's allowed. |

## Related

* [Creating services in the dashboard](https://docs.sabaothcloud.com/dashboard/creating-services.md), including the sizes and limits per plan
* [`sabaoth postgres get`](https://docs.sabaothcloud.com/cli/commands/postgres-get)
* [`sabaoth postgres delete`](https://docs.sabaothcloud.com/cli/commands/postgres-delete)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.