---
title: "Create a warehouse"
description: "Choose shards, replicas, the Keeper mode, a size and storage, decide who can connect, and set the backup and maintenance windows."
---

> 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.

# Create a warehouse

## Before you start

A warehouse needs a [subnet](/private-networks/vpcs) of a VPC. It's reached only from inside the VPC:
there's no public address. To connect from your laptop, use
[`ezgh warehouse connect`](/warehouse/connect#from-your-laptop).

Its first user's password goes to a new [Secret](/secrets) in the project, written as you, so creating
a warehouse also needs `secrets.secrets.create` and `secrets.versions.create` in the project.

## Create

### Console

1. Open **Warehouse** and choose **Create warehouse**.
2. Pick a name, a ClickHouse version, and the number of shards and replicas.
3. Pick an instance type, storage and a subnet.
4. Set backups, the maintenance window and deletion protection, then choose **Create warehouse**.
### CLI

```sh
ezgh warehouse warehouses create analytics --engine-version 26.8 --shards 2 --replicas 2 \
  --instance-type gp-1.large --storage-size-gib 500 --subnet sbn_2m9x0a7qpe4k --wait
```

A create takes minutes, and `--wait` waits until the warehouse is `available`. The warehouse exists
from the start, `creating`, with its ID (`whs_…`). Its `endpoint` is `null` until its name resolves.

The warehouse comes with the `default` database and one user, `app`, with the `admin` preset, whose
password is in a Secret. See [Users and grants](/warehouse/users).

## Settings

| Setting | |
| --- | --- |
| `engineVersion` | `ezgh warehouse warehouses engine-versions` lists them. [Upgrades](/warehouse/upgrades) move to a newer one. |
| `shards` | 1 to 8. See [Sharding](/warehouse/sharding). Can grow later. |
| `replicas` | Copies of each shard, 1 to 3. Each shard keeps serving through the loss of one node with 2 or 3 replicas. Can grow later. |
| `keeper` | [The Keeper mode](#keeper-mode). |
| `instanceType` | The size of each node, with at least 8 GiB of memory; every node has the same one. Can change later. |
| `storage` | Each node's storage: `sizeGiB`, and optionally `iops` and `throughputMBps`. Can grow later. |
| `subnet` | The subnet it's in. Fixed. |
| `allowedSourceCidrs` | [Who can connect](#who-can-connect). |
| `plaintextPort` | Whether ports 8123 (HTTP) and 9000 (native) also serve without TLS. See [Connect](/warehouse/connect#plaintext-ports). |
| `backups` | `enabled`, `retentionDays` (1–35, 7 by default) and `windowUtc`. See [Backups](/warehouse/backups). |
| `maintenance.windowUtc` | The [maintenance window](#maintenance). |
| `deletionProtection` | Refuses deletes of the warehouse and of its databases while on. |

## Keeper mode

ClickHouse Keeper coordinates a warehouse's replicas and its `Replicated` databases. `keeper` says
where it runs:

| Warehouse | `keeper` |
| --- | --- |
| 1 shard × 1 replica | `null` |
| 2 nodes (1 × 2 or 2 × 1) | `dedicated` |
| 3 or more nodes | `dedicated` (the default), or `colocated` when the instance type has at least 8 vCPUs and 32 GiB of memory and isn't a shared vCPU type (`gs-1`) |

`dedicated` runs Keeper apart from your data. `colocated` runs it alongside your data. The mode can change later; see
[Scaling](/warehouse/scaling#keeper-mode).

## Storage

Each node keeps its shard's data on its own storage. A warehouse is `storage_low` when more than 85% of
a node's storage is used, and the project's [notifications](/notifications) say so. Grow it while it
serves:

```sh
ezgh warehouse warehouses update whs_4k2m9x0a7qpe --storage-size-gib 1000 --wait
```

Storage only grows. When a node's storage is full, inserts to it fail.

## Who can connect

By default, any address in the warehouse's VPC can connect to its client ports. `allowedSourceCidrs`
narrows that to the ranges you list:

```sh
ezgh warehouse warehouses update whs_4k2m9x0a7qpe --allowed-source-cidr 10.0.1.0/24 \
  --allowed-source-cidr 10.0.2.0/24 --wait
```

The client's [firewall](/compute/firewalls) also has to allow its outbound connection. A firewall
rule can name the warehouse as its peer (`whs_4k2m9x0a7qpe`) in place of its addresses.

## Maintenance

Patch releases and other maintenance happen in the warehouse's maintenance window
(`maintenance.windowUtc`, such as `sun:06:00-sun:07:00`), one node at a time.

## Delete

```sh
ezgh warehouse warehouses delete whs_4k2m9x0a7qpe --wait
```

Deleting a warehouse deletes its data, its databases and its backups. It's refused while
`deletionProtection` is on.

Source: https://docs.ezghcloud.com/warehouse/create/index.mdx
