loco-server is the binary that runs the BigFred backend. When you start it, it brings up the HTTP and WebSocket server that the web UI connects to, manages a Redis/Valkey sidecar via supervisord for real-time state, and spawns a dcc-bus daemon for each configured command station. For most deployments you run it once on your hub and leave it running.
Basic usage
If you do not set a JWT secret,
loco-server generates a random one at startup and logs a warning. All logged-in sessions will be invalidated whenever the server restarts. Set --jwt-secret (or the BIGFRED_JWT_SECRET environment variable) in any environment where session persistence matters.Flag reference
Environment variables
Setting the JWT secret via the environment is the recommended approach for production deployments:
Configuration file
On hub images,loco-server reads settings from /data/etc/loco-server.conf at startup. The file uses a simple KEY=VALUE format (dotenv style); comments start with # and blank lines are ignored. CLI flags always override values in the file.
/data/etc/loco-server.conf
loco-server also writes a fully-commented reference template to /data/etc/loco-server.conf.defaults. That file documents every supported key with its built-in default. It is not read at runtime — copy keys from it into loco-server.conf to apply changes.
For the full configuration key reference and persistence details, see the Configuration page.
The dcc-bus subcommand
loco-server includes a dcc-bus subcommand that is spawned automatically by supervisord — one instance per command station configured in the database. Each dcc-bus process owns the low-level DCC communication for one station and exchanges drive, function, and CV messages with loco-server over Redis.
You should not need to run
loco-server dcc-bus directly. If a dcc-bus daemon is not starting or is restarting unexpectedly, check the supervisord log files and increase --log-level to debug for more detail.