Skip to main content

Configure the broker before it starts

Pass configuration at process start so containers, packages, and CI pipelines come up the same way every time. Typical jobs:
  • Point the data directory at a persistent volume
  • Import broker or user JSON on first boot
  • Load a LoT notebook project from git or disk
  • Install a license file before MQTT accepts connections
Think of startup options as a recipe card. You tell the broker where its data lives and which project to load; it applies that recipe and then stays up as a service or container.
For install commands (Docker, APT, DNF, Windows), start with Installation. For COREFLUX_* variables, secrets, and .env files, see Environment Variables & Secrets.

Command-line options

Configuration

Set COREFLUX_DATA_PATH or CONFIG_PATH in the process environment, then start the binary. -p / --path is applied late in startup, so --config can write into the default data directory instead of the path you intended.

Projects and licenses

Load LoT (Language of Things) from a project (git URL, local folder, or a project already stored on this broker). That is the supported way to ship Actions, Models, Routes, and Rules at boot. A project loaded with --project (or -loadProject at runtime) is remembered across restarts. On the next start, if you do not pass --project, the broker re-activates that project. -unloadProject clears it. --project always wins over the remembered project.

Other options


Basic usage

Starting with configuration files

Force overwrite existing configuration

By default, if configuration already exists in the data directory, startup JSON is ignored. Use force flags to overwrite:
Force flags overwrite existing configurations. Back up your current configuration before using them.

Loading a project at startup

Package Actions, Models, Routes, and Rules in a LoT notebook project and load it with --project. That is the supported bootstrap path for LoT at startup.

Configuration files

Broker configuration (JSON)

The broker configuration file defines MQTT service settings:
For every supported field (ports, TLS/mTLS, sessions, performance, data paths, ops, durability), see Broker Configuration.

Users configuration (JSON)

The users configuration file defines MQTT users and their permissions:

Container deployment

Official images use CONFIG_PATH=/etc/project. Persist that directory so configuration, secrets, and projects survive image updates. The published image is coreflux/coreflux-mqtt-broker.
Same pattern as Installation: named volume at /etc/project, MQTT on 1883, WebSocket on 5000, ops on 9100.
Import JSON on first boot by mounting files and passing --config / --users (add --config-force / --users-force only when you intend to replace existing state):
Probe liveness with curl http://localhost:9100/health. The image has no shell, so do not use exec healthchecks.

Service installation

Prefer the install method from Installation. Use --install only for portable binaries.
APT and DNF packages already register coreflux-broker.service, install under /opt/coreflux-broker, and set COREFLUX_DATA_PATH=/var/lib/coreflux.
To add startup flags (for example --project), override the unit:
Then sudo systemctl daemon-reload && sudo systemctl restart coreflux-broker.

Best practices

Use COREFLUX_DATA_PATH or CONFIG_PATH so --config and --users land in the same directory the broker uses at runtime. Docker images already set CONFIG_PATH=/etc/project.
-cf and -uf overwrite existing configuration. Back up first.
Load Actions, Models, Routes, and Rules with --project, not with ad-hoc .lot file flags at process start.
Always mount a volume at /etc/project in Docker and Kubernetes. Without it, configuration, secrets, and projects disappear when the container is recreated.

Troubleshooting

  1. Confirm COREFLUX_DATA_PATH / CONFIG_PATH matches the volume you mounted.
  2. If files already exist in that directory, add --config-force / --users-force only if you intend to replace them.
  3. Check logs for validation errors.
On Windows: netstat -ano | findstr :1883Stop the other listener or change the broker port in configuration.
The package service user is coreflux, with state under /var/lib/coreflux. The service user needs read access to certificates and write access to the data directory.

Next Steps

Broker Configuration

Ports, TLS, sessions, ops, and every JSON field.

Environment Variables & Secrets

Data path, COREFLUX_* variables, .env, and encrypted secrets.
Last modified on August 28, 2026