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

# Environment Variables

> Environment variables for Chartbrew

The table below shows the `production` variables. Most `development` variables have the same naming, but they are appended with `_DEV` (example: `CB_DB_NAME` -> `CB_DB_NAME_DEV`).

The runtime cache Redis overrides and BullMQ dashboard credentials are exceptions and use the non-suffixed names in all environments.

| Variable                                                                      |                       Default value                       | Description                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------- | :-------------------------------------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| CB\_DB\_NAME <br /> CB\_DB\_NAME\_DEV <br /> `required`                       |                        `chartbrew`                        | The name of the database                                                                                                                                                                                                               |
| CB\_DB\_USERNAME <br /> CB\_DB\_USERNAME\_DEV <br /> `required`               |                         No default                        | The username of the user that has access to the database                                                                                                                                                                               |
| CB\_DB\_PASSWORD <br /> CB\_DB\_PASSWORD\_DEV                                 |                         No default                        | The password associated with the database user                                                                                                                                                                                         |
| CB\_DB\_HOST <br /> CB\_DB\_HOST\_DEV <br /> `required`                       |                        `localhost`                        | The host address where the database is located                                                                                                                                                                                         |
| CB\_DB\_PORT <br /> CB\_DB\_PORT\_DEV                                         |                           `3306`                          | The port of the hosting address                                                                                                                                                                                                        |
| CB\_DB\_DIALECT <br /> CB\_DB\_DIALECT\_DEV <br /> `required`                 |                          `mysql`                          | Which database to use between `mysql` and `postgres`                                                                                                                                                                                   |
| CB\_DB\_CERT <br /> CB\_DB\_CERT\_DEV                                         |                         No default                        | If your DB requires an SSL connection, use this variable to provide the string value of the certificate                                                                                                                                |
| CB\_ENCRYPTION\_KEY <br /> CB\_ENCRYPTION\_KEY\_DEV <br /> `required`         |    A key will be generate for you during the first run    | A secure 32 bytes string which is used to encrypt the data in the database. [Click here](#generate-the-encryption-key) to see how you can generate a key.                                                                              |
| CB\_BULLMQ\_USERNAME <br /> `required`                                        |                        `chartbrew`                        | The username used for HTTP Basic Auth on the BullMQ admin dashboard at `/apps/queues`                                                                                                                                                  |
| CB\_BULLMQ\_PASSWORD <br /> `required`                                        | A password will be generated for you during the first run | The password used for HTTP Basic Auth on the BullMQ admin dashboard at `/apps/queues`. Set this explicitly when running Chartbrew with Docker or another environment-based deployment                                                  |
| CB\_OPENAI\_API\_KEY <br /> CB\_OPENAI\_API\_KEY\_DEV                         |                         No default                        | The API key for the OpenAI API                                                                                                                                                                                                         |
| CB\_OPENAI\_MODEL <br /> CB\_OPENAI\_MODEL\_DEV                               |                       `gpt-5.4-mini`                      | The model to use for the OpenAI API                                                                                                                                                                                                    |
| CB\_REDIS\_HOST <br /> CB\_REDIS\_HOST\_DEV                                   |                        `localhost`                        | The host address where the Redis server is located                                                                                                                                                                                     |
| CB\_REDIS\_PORT <br /> CB\_REDIS\_PORT\_DEV                                   |                           `6379`                          | The port of the Redis server                                                                                                                                                                                                           |
| CB\_REDIS\_PASSWORD <br /> CB\_REDIS\_PASSWORD\_DEV                           |                         No default                        | The password for the Redis server, if required                                                                                                                                                                                         |
| CB\_REDIS\_DB <br /> CB\_REDIS\_DB\_DEV                                       |                            `0`                            | The Redis database number to use                                                                                                                                                                                                       |
| CB\_REDIS\_CA <br /> CB\_REDIS\_CA\_DEV                                       |                         No default                        | The string value of the certificate                                                                                                                                                                                                    |
| CB\_REDIS\_CLUSTER\_NODES <br /> CB\_REDIS\_CLUSTER\_NODES\_DEV               |                         No default                        | The list of Redis cluster nodes. Format: `host:port,host:port,host:port`                                                                                                                                                               |
| CB\_RUNTIME\_REDIS\_HOST                                                      |                         No default                        | Optional dedicated Redis host for the runtime chart and dataset cache. If not set, Chartbrew falls back to `CB_REDIS_HOST`                                                                                                             |
| CB\_RUNTIME\_REDIS\_PORT                                                      |                         No default                        | Optional dedicated Redis port for the runtime chart and dataset cache. If not set, Chartbrew falls back to `CB_REDIS_PORT`                                                                                                             |
| CB\_RUNTIME\_REDIS\_PASSWORD                                                  |                         No default                        | Optional dedicated Redis password for the runtime chart and dataset cache. If not set, Chartbrew falls back to `CB_REDIS_PASSWORD`                                                                                                     |
| CB\_RUNTIME\_REDIS\_DB                                                        |                         No default                        | Optional dedicated Redis database number for the runtime chart and dataset cache. If not set, Chartbrew falls back to `CB_REDIS_DB`                                                                                                    |
| CB\_RUNTIME\_REDIS\_CA                                                        |                         No default                        | Optional CA certificate string for the runtime chart and dataset cache Redis connection. If not set, Chartbrew falls back to `CB_REDIS_CA`                                                                                             |
| CB\_RUNTIME\_REDIS\_CLUSTER\_NODES                                            |                         No default                        | Optional list of Redis cluster nodes for the runtime chart and dataset cache. Format: `host:port,host:port,host:port`. If not set, Chartbrew falls back to `CB_REDIS_CLUSTER_NODES`                                                    |
| CB\_RUNTIME\_CACHE\_DEBUG                                                     |                          `false`                          | Enables debug logging for the runtime chart and dataset cache, including cache hits, misses, and key selection                                                                                                                         |
| CB\_API\_HOST <br /> CB\_API\_HOST\_DEV <br /> `required`                     |                        `localhost`                        | The address where the `server` app is running from. This variable is used internally by the `server` app. <br /> **This value is overwritten by the PORT variable (if set)**                                                           |
| CB\_API\_PORT <br /> CB\_API\_PORT\_DEV <br /> `required`                     |                           `4019`                          | The port where the `server` app is running from. This variable is used internally by the `server` app                                                                                                                                  |
| VITE\_APP\_CLIENT\_HOST <br /> VITE\_APP\_CLIENT\_HOST\_DEV <br /> `required` |                  `http://localhost:4018`                  | The full address where the `client` app is running from. This variable is used in the `client` app and it's populated during the building process.<br /><br />`Note` The app needs to be restarted/rebuilt when this value is changed. |
| VITE\_APP\_CLIENT\_PORT <br /> VITE\_APP\_CLIENT\_PORT\_DEV <br /> `required` |                           `4018`                          | The port where the `client` app is running from. This variable is used in the `client` app and it's populated during the building process.<br /><br />`Note` The app needs to be restarted/rebuilt when this value is changed.         |
| VITE\_APP\_API\_HOST <br /> VITE\_APP\_API\_HOST\_DEV <br /> `required`       |                  `http://localhost:4019`                  | The full address where the `server` app is running. This variable is used by the `client` app.<br /><br />`Note` The app needs to be restarted/rebuilt when this value is changed.                                                     |
| CB\_MAIL\_HOST <br /> CB\_MAIL\_HOST\_DEV                                     |                      `smtp.gmail.com`                     | The server host of the email provider                                                                                                                                                                                                  |
| CB\_MAIL\_USER <br /> CB\_MAIL\_USER\_DEV                                     |                         No default                        | The username used to log in on the email server                                                                                                                                                                                        |
| CB\_MAIL\_PASS <br /> CB\_MAIL\_PASS\_DEV                                     |                         No deafult                        | The password used to log in on the email server                                                                                                                                                                                        |
| CB\_MAIL\_PORT <br /> CB\_MAIL\_PORT\_DEV                                     |                           `465`                           | The port used to connect to the email server                                                                                                                                                                                           |
| CB\_MAIL\_SECURE <br /> CB\_MAIL\_SECURE\_DEV                                 |                           `true`                          | `true` - Use SSL to connect to the email server <br /><br />`false` - Use TLS to connect to the email server                                                                                                                           |
| CB\_ADMIN\_MAIL <br /> CB\_ADMIN\_MAIL\_DEV                                   |                    `hello@example.com`                    | The email address used to send the emails from                                                                                                                                                                                         |
| CB\_RESTRICT\_TEAMS <br /> CB\_RESTRICT\_TEAMS\_DEV                           |                            `0`                            | `0` - New users will have their own team created on sign-up. <br /><br />`1` - New users don't have a team on signup and can't create their own.                                                                                       |
| CB\_RESTRICT\_SIGNUP <br /> CB\_RESTRICT\_SIGNUP\_DEV                         |                            `0`                            | `0` - Anyone can create accounts from the signup page <br /><br />`1` - New users can only sign up using invite links                                                                                                                  |
| CB\_GOOGLE\_CLIENT\_ID <br /> CB\_GOOGLE\_CLIENT\_ID\_DEV                     |                         No default                        | Google app Client ID generated from the <a href="https://console.cloud.google.com/" target="_blank" rel="noreferrer noopener">Console</a> <br /><br />(Needed for Google integrations)                                                 |
| CB\_GOOGLE\_CLIENT\_SECRET <br /> CB\_GOOGLE\_CLIENT\_SECRET\_DEV             |                         No default                        | Google app Client Secret generated from the <a href="https://console.cloud.google.com/" target="_blank" rel="noreferrer noopener">Console</a> <br /><br />(Needed for Google integrations)                                             |
| CB\_BACKEND\_WORKERS <br /> CB\_BACKEND\_WORKERS\_DEV                         |                            `4`                            | Some background tasks in Chartbrew will use workers to spread work on multiple threads. Still testing, but for best performance, set this to the number of threads your CPU has                                                        |
| CB\_OPENAI\_API\_KEY <br /> CB\_OPENAI\_API\_KEY\_DEV                         |                         No default                        | The API key for the OpenAI API                                                                                                                                                                                                         |
| CB\_OPENAI\_MODEL <br /> CB\_OPENAI\_MODEL\_DEV                               |                       `gpt-5.4-mini`                      | The model to use for the OpenAI API                                                                                                                                                                                                    |
| VITE\_APP\_SLACK\_CLIENT\_ID                                                  |                         No default                        | The client ID of the Slack app is used in both server and client apps                                                                                                                                                                  |
| CB\_SLACK\_CLIENT\_SECRET                                                     |                         No default                        | The client secret of the Slack app is used in both server and client apps                                                                                                                                                              |
| CB\_SLACK\_SIGNING\_SECRET                                                    |                         No default                        | The signing secret of the Slack app is used in both server and client apps                                                                                                                                                             |
| CB\_ALLOW\_PRIVATE\_NETWORK\_CALLS                                            |                          `false`                          | `false` - API calls to private networks are not allowed <br /><br />`true` - Allow calls to private networks                                                                                                                           |

### Generate the encryption key

You will need a 32 bytes AES encryption key for the `CB_ENCRYPTION_KEY` variable. Chartbrew generates both `CB_ENCRYPTION_KEY` and `CB_ENCRYPTION_KEY_DEV` for you during the first run, but if you wish to have control over the value, you can generate it yourself.

Run the following command to generate a valid key:

```sh theme={null}
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
```
