# Configuration

You can configure CKBox On-Premises using environment variables. Below you will find available environment variables with descriptions.

<a id="secret-keys">

## Secret keys

The `license_key` variable is used to verify that you own the rights to run CKBox On-Premises. To get your `license_key` please [contact us](https://ckeditor.com/contact/). If you leave this option empty or provide an invalid key, CKBox On-Premises will not launch.

The `environments_management_secret_key` variable should be a hard to guess string, preferably generated by an external password generator. It will be used to access the [Cloud Services Management Panel](../cs-onpremises/management.md).

<a id="sql-database">

## SQL Database

<a id="mysql-database">

### MySQL database

To configure the MySQL database you should first set the `database_driver` variable to `mysql`.

Then, you can provide:

* `database_host` and `database_port` to configure the database address.
* `database_user` and `database_password` to configure the database user.
* `database_database` to set the database that should be used by CKBox On-Premises.

If your database connection should be encrypted, use the `database_ssl_ca`, `database_ssl_key` and `database_ssl_cert` configurations.

<a id="postgres-database">

### Postgres database

To configure the Postgres database instead of MySQL, you should first set the `database_driver` variable to `postgres`.

Then, you can provide:

* `database_host` and `database_port` to configure the database address.
* `database_user` and `database_password` to configure the database user.
* `database_database` and `database_schema` to point which schema should be used by the On-Premises server.

If your database connection should be encrypted, use the `database_ssl_ca`, `database_ssl_key` and `database_ssl_cert` configurations.

<a id="redis-database">

## Redis database

Besides the SQL database, you need to configure the Redis database using:

* `redis_host` and `redis_port` to configure the database address.
* `redis_password` and `redis_user` to configure the database credentials. Both configuration options are optional.

You can also provide `redis_db` if you don’t want to use the default database number, which is set to `1`.

If you have a problem with connecting to IPv6, try setting `redis_ip_family` to `6`.

If your database connection should be encrypted, use the `redis_tls_ca`, `redis_tls_key`, and `redis_tls_cert` configurations, or set `redis_tls_enable` to `true` if you don’t use a custom certificate.

<a id="connecting-to-redis-cluster">

## Connecting to Redis Cluster

To set up a connection with a Redis Cluster, nodes need to be provided as the `REDIS_CLUSTER_NODES` variable.

```bash
REDIS_CLUSTER_NODES		- required (for Redis Cluster connection)
REDIS_IP_FAMILY			- optional (required only when using an IPv6 domain in `REDIS_CLUSTER_NODES`)
```

The `REDIS_CLUSTER_NODES` variable needs to contain a list of nodes in the dedicated format, which consists of:

```bash
"IP:PORT:[optional PASSWORD],IP:PORT:[optional PASSWORD]"
```

To understand the connection string format, check the examples below:

```yaml
# IPv6
REDIS_CLUSTER_NODES: "[0:0:0:0:0:0:0:1]:7000,[0:0:0:0:0:0:0:1]:7001,[0:0:0:0:0:0:0:1]:7002"

# IPv6 with a password
REDIS_CLUSTER_NODES: "[0:0:0:0:0:0:0:1]:7000:password1,[0:0:0:0:0:0:0:1]:7001:password2,[0:0:0:0:0:0:0:1]:7002:password3"

# Domain name
REDIS_CLUSTER_NODES: "example.redis.server.com:7000,example.redis.server.com:7001,example.redis.server.com:7002"

# Domain name with IPv6 support
REDIS_IP_FAMILY: 6
REDIS_CLUSTER_NODES: "example.ipv6.redis.server.com:7000,example.ipv6.redis.server.com:7001,example.ipv6.redis.server.com:7002"

# Domain name with a password
REDIS_CLUSTER_NODES: "example.redis.server.com:7000:password1,example.redis.server.com:7001:password2,example.redis.server.com:7002:password3"
```

<a id="storage">

## Storage

<a id="s3-storage">

### S3 storage

To configure S3 as your files storage you should first set the `storage_driver` variable to `s3`.

Then, you can provide:

* `storage_access_key_id` and `storage_secret_access_key` to authorize the service.
* `storage_bucket` to set the bucket where the files should be stored.

If you use an S3 compatible server, you can set the address with `storage_endpoint` variable.

<a id="azure-blob-storage">

### Azure Blob Storage

To configure Azure Blob Storage as your files storage you should first set the `storage_driver` variable to `azure`.

Then, you can provide:

* `storage_account_name` and `storage_account_key` authorize to the service.
* `storage_container` to set the container where the files should be stored.

<a id="filesystem">

### Filesystem

To configure the filesystem as your files storage you should first set the `storage_driver` variable to `filesystem`.

Then you can provide the path to the directory where the files should be stored using the `storage_location` variable.

<a id="sql-storage">

### SQL storage

To configure MySQL or Postgres as your files storage, you should set the `storage_driver` variable to `database`. When using SQL as a storage driver, the application will use the configuration provided in the `database_*` variables.

<a id="file-upload-limits">

## File upload limits

You can limit the maximum size of uploaded files globally using the `max_file_size_in_bytes_limit` variable. The value should be provided in bytes.

For example, to limit the maximum uploaded file size to 50 MB:

```bash
MAX_FILE_SIZE_IN_BYTES_LIMIT=52428800
```

If this variable is not set, CKBox On-Premises will not enforce a global file size limit.

<a id="openai">

## OpenAI

To enable [AI-powered features](../../../../ckbox/latest/features/ai-features.md), you need to provide an OpenAI API key using the `openai_api_key` variable.

Optionally, you can set `openai_model` to choose the OpenAI model used for generating embeddings. Defaults to `gpt-5-nano`.

---

Full index of the Cloud Services documentation: [llms.txt](../../../llms.txt)
