# Configuration

Every setting is an environment variable with a safe default; the hub needs none of them to run.
Set them in `compose.yaml` (Docker), `/etc/openkedai/openkedai.env` (Linux installer), or the
platform's settings page, then restart the hub.

## The basics

| Variable | Default | What it does |
| --- | --- | --- |
| `PORT` | `8080` | The one port for the back office, the API and live updates |
| `OPENKEDAI_HOST` | `0.0.0.0` | Interface to listen on; `127.0.0.1` behind a reverse proxy on the same machine |
| `OPENKEDAI_DATA_DIR` | `./data` (`/data` in the image) | The one data folder: shops, plugins, backups |
| `OPENKEDAI_HUB_NAME` | the machine's name | The name devices show for this hub |
| `OPENKEDAI_PUBLIC_URL` | this machine's network addresses | Address(es) devices should use, comma-separated, e.g. `https://pos.example.my`. On Render, Railway and Fly it comes from the platform |
| `OPENKEDAI_SETUP_CODE` | made on first start, kept, and printed in the log | The hub owner's key for adding shops. Set it only to a long random value |
| `OPENKEDAI_MDNS` | `on` (`off` on Render, Railway and Fly) | Announce the hub on the shop's network so devices find it |
| `OPENKEDAI_LOG_LEVEL` | `info` | `debug`, `info`, `warn` or `error`; logs are JSON lines on stdout |

## Backups

See [Backups](https://docs.openkedai.com/self-hosting/backups/).

| Variable | Default |
| --- | --- |
| `OPENKEDAI_BACKUP_INTERVAL_HOURS` | `24`; `0` turns snapshots off |
| `OPENKEDAI_BACKUP_KEEP` | `7` |
| `OPENKEDAI_BACKUP_S3_URL` | not set: no copies leave the hub |
| `OPENKEDAI_BACKUP_S3_ACCESS_KEY_ID`, `OPENKEDAI_BACKUP_S3_SECRET_ACCESS_KEY` | needed with the URL |
| `OPENKEDAI_BACKUP_S3_REGION` | from the URL for AWS and Backblaze, else `us-east-1` |
| `OPENKEDAI_BACKUP_S3_PREFIX` | `openkedai/` |

## Plugins

See [Plugins](https://docs.openkedai.com/plugins/).

| Variable | Default |
| --- | --- |
| `OPENKEDAI_PLUGINS_DIR` | `<data>/plugins` |
| `OPENKEDAI_PLUGINS` | none: installed plugin packages or paths, comma-separated |
| `OPENKEDAI_PLUGINS_DISABLED` | none: plugin ids not to start, comma-separated |

## Rarely needed

| Variable | Default |
| --- | --- |
| `OPENKEDAI_WEB_DIR` | the built back office next to the server |
| `NODE_OPTIONS=--enable-source-maps` | off: readable stack traces, at about 75 MB more memory |
