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
- Stage a signed license or enrollment token before MQTT accepts connections
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, Connectors, 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.
To activate a license at start, set COREFLUX_ACTIVATION_CODE in the process environment or pass --load-license. Register at portal.coreflux.org for a 30-day Growth-type license. See Licensing and Enrollment.
Other options
Basic usage
Starting with configuration files
- Linux
- Windows
Force overwrite existing configuration
By default, if configuration already exists in the data directory, startup JSON is ignored. Use force flags to overwrite:Loading a project at startup
Package Actions, Models, Connectors, 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 useCONFIG_PATH=/etc/project. Persist that directory so configuration, secrets, and projects survive image updates. The published image is coreflux/coreflux-mqtt-broker.
- Docker
- Docker Compose
- Kubernetes
Same pattern as Installation: named volume at Import JSON on first boot by mounting files and passing Probe liveness with
/etc/project, MQTT on 1883, WebSocket on 5000, ops on 9100.--config / --users (add --config-force / --users-force only when you intend to replace existing state):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.
- Linux packages
- Windows
- Portable Linux
APT and DNF packages already register To add startup flags (for example Then Then reload and restart:A container, or a broker you start without the APT or DNF package, needs that capability on the process, or a port of 1024 or above.
coreflux-broker.service, install under /opt/coreflux-broker, and set COREFLUX_DATA_PATH=/var/lib/coreflux.--project), override the unit:sudo systemctl daemon-reload && sudo systemctl restart coreflux-broker.Ports below 1024
The service runs as the unprivileged usercoreflux. The unit grants CAP_NET_BIND_SERVICE, so the broker can bind ports below 1024. A package upgrade replaces the unit file. Drop-in files under /etc/systemd/system/coreflux-broker.service.d/ are kept.An older package does not grant that capability. Add it in a drop-in:Best practices
Set the data path in the environment
Set the data path in the environment
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.Use force flags only when you mean to reset
Use force flags only when you mean to reset
-cf and -uf overwrite existing configuration. Back up first.Ship LoT as a project
Ship LoT as a project
Load Actions, Models, Connectors, and Rules with
--project, not with ad-hoc .lot file flags at process start.Persist the data volume
Persist the data volume
Always mount a volume at
/etc/project in Docker and Kubernetes. Without it, configuration, secrets, projects, the signed license (config/license.jws), and enrollment credentials disappear when the container is recreated. See Licensing and Enrollment.Troubleshooting
Configuration not applied
Configuration not applied
- Confirm
COREFLUX_DATA_PATH/CONFIG_PATHmatches the volume you mounted. - If files already exist in that directory, add
--config-force/--users-forceonly if you intend to replace them. - Check logs for validation errors.
Port already in use
Port already in use
netstat -ano | findstr :1883Stop the other listener or change the broker port in configuration.Broker exits at start with code 78 (a LoT state file cannot be used)
Broker exits at start with code 78 (a LoT state file cannot be used)
Before it loads anything, the broker checks its LoT files in
{data directory}/bin/ (actions.lot, models.lot, routes.lot, rules.lot, project-entity-ownership.json, Python.Scripts). It exits with code 78 when it can’t write to bin/, can’t open one of these files for reading and writing, or can’t copy a file with an earlier name to its new name. It prints each file with the reason. It does not start empty, because a broker without its rules or actions would allow and run different things than you configured.- Read the message in the console or the log. It names every file the broker cannot use.
- Give the user the broker runs as read and write access to those files. The container image runs as user
10001, so on a mounted volume runchown -R 10001 <volume path>. - If the broker should start without a file, move that file aside and start again.
Permission denied on Linux
Permission denied on Linux
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.If the broker cannot bind a port below 1024, the process is missing CAP_NET_BIND_SERVICE. Current APT and DNF units grant it. On an older package, add the drop-in under Ports below 1024. A container or a manual run needs that capability, or a port of 1024 or above.Next Steps
Broker Configuration
Ports, TLS, sessions, ops, and every JSON field.
Licensing and Enrollment
Activation codes, signed licenses, enrollment, and
GET /license.
