---
title: "ezgh caches create"
description: "Create a cache."
---

> 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 caches 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 caches create <name> --engine e --engine-version v --instance-type t --subnet s [flags] [--wait]
```

Create a cache in a subnet of your VPC. `ezgh caches engine-versions` lists the engines (valkey, memcached) and versions. Valkey is memory only (`--mode` memory, the default) or persistent (`--mode` persistent, with `--storage-size-gib`); Memcached is memory only. `--standby` adds a standby that takes over if the cache fails. The subnet needs 2 free addresses, 3 with a standby. The default user's password is written to a new Secret in the project, which `ezgh caches users get <cache> default` names. It takes minutes: `--wait` waits until it's available and prints it.

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

## Examples

```sh
ezgh caches create wp-cache --engine valkey --engine-version 9.1 --instance-type gp-1.large \
  --subnet sbn_2m9x0a7qpe4k --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) |
| `--deletion-protection` | boolean |  | refuse deletes until it's turned off |
| `--description` | string |  | what it's for |
| `--engine` | string |  | valkey or memcached |
| `--engine-version` | string |  | the engine's version, from ezgh caches engine-versions |
| `--instance-type` | string |  | a gp-1 or gs-1 instance type, from ezgh compute instance-types list |
| `--maintenance-window` | string |  | when maintenance happens, ddd:HH:MM-ddd:HH:MM UTC, at least 30 minutes |
| `--mode` | string |  | memory or persistent (Valkey only; default memory) |
| `--parameter` | string, repeatable |  | an engine parameter, name=value; repeat for more; names from ezgh caches engine-versions |
| `--plaintext-port` | boolean | `true` | Memcached only: also serve port 11212 without TLS (`--plaintext-port=false` turns it off) |
| `--standby` | boolean |  | add a standby that takes over if the cache fails |
| `--storage-size-gib` | int |  | a persistent cache's storage, in GiB |
| `--subnet` | string |  | the subnet it's in (sbn\_…) |
| `--tag` | string, repeatable |  | a tag, key=value; repeat for more |
| `--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/caches-create/index.mdx
