# Using Utilities

HeavyDB includes the utilities [initdb](#initdb) for database initialization and [generate\_cert](#generate_cert) for generating certificates and private keys for an HTTPS server.

## initdb

Before using HeavyDB, initialize the data directory using `initdb`:

```bash
initdb [-f | --skip-geo] $HEAVYAI_BASE/storage
```

This creates three subdirectories:

* `catalogs`: Stores HeavyDB catalogs
* `data`: Stores HeavyDB data
* `log`: Contains all HeavyDB log files.
* `disk_cache`: Stores the data cached by HEAVY COnnect

The `-f` flag forces `initdb` to overwrite existing data and catalogs in the specified directory.

By default, `initdb` adds a sample table of geospatial data. Use the `--skip-geo` flag if you prefer not to load sample geospatial data.

## generate\_cert

```bash
generate_cert [{-ca} <bool>]
              [{-duration} <duration>]
              [{-ecdsa-curve} <string>]
              [{-host} <host1,host2>]
              [{-rsa-bits} <int>]
              [{-start-date} <string>]
```

This command generates certificates and private keys for an HTTPS server. The options are:

* `[{-ca} <bool>]`: Whether this certificate should be its own Certificate Authority. The default is `false`.
* `[{-duration} <duration>]`: Duration that the certificate is valid for. The default is `8760h0m0s`.
* `[{-ecdsa-curve} <string>]`: ECDSA curve to use to generate a key. Valid values are `P224`, `P256`, `P384`, `P521`.
* `[{-host} <string>]`: Comma-separated hostnames and IPs to generate a certificate for.
* `[{-rsa-bits} <int>]`: Size of RSA key to generate. Ignored if –ecdsa-curve is set. The default is `2048`.
* `[{-start-date} <string>]`: Start date formatted as `Jan 1 15:04:05 2011`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.heavy.ai/installation-and-configuration/services-and-utilities/utilities.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
