NATS Configuration
OptionsRealTime uses NATS as its messaging server. Rover starts NATS automatically by default — most users never need to interact with NATS directly. This page documents the underlying nats.config file, useful when troubleshooting startup issues, customizing storage limits, or running against a centrally-managed NATS server in an institutional deployment.
File Location
Section titled “File Location”<install dir>\nats.configThe installer generates this file with absolute paths on first install. Subsequent installs preserve the existing file.
Default Configuration
Section titled “Default Configuration”# NATS Server Configuration for OptionsRealTimehost: 0.0.0.0port: 4222http: 0.0.0.0:8222max_payload: 67000000
websocket { host: 0.0.0.0 port: 9222 no_tls: true}
jetstream { store_dir: "C:/Users/<username>/AppData/Local/OptionsRealTime/jetstream" max_memory_store: 1GB max_file_store: 50GB sync_interval: "2m"}Configuration Options
Section titled “Configuration Options”Network Settings
Section titled “Network Settings”| Setting | Default | Description |
|---|---|---|
host | 0.0.0.0 | IP address to bind. 0.0.0.0 listens on all interfaces. |
port | 4222 | Main NATS port for client connections |
http | 0.0.0.0:8222 | HTTP monitoring endpoint |
max_payload | 67000000 | Maximum message size in bytes (~64MB) |
WebSocket Settings
Section titled “WebSocket Settings”| Setting | Default | Description |
|---|---|---|
websocket.host | 0.0.0.0 | IP address for WebSocket connections |
websocket.port | 9222 | WebSocket port — used by browser clients |
websocket.no_tls | true | TLS disabled for LAN use |
JetStream Settings
Section titled “JetStream Settings”| Setting | Default | Description |
|---|---|---|
store_dir | <install>/jetstream | Absolute path to JetStream data storage |
max_memory_store | 1GB | Maximum memory for stream storage |
max_file_store | 50GB | Maximum disk space for stream storage |
sync_interval | 2m | How often to sync data to disk |
Common Scenarios
Section titled “Common Scenarios”Single Machine (Default)
Section titled “Single Machine (Default)”No changes needed. The default configuration works for single machine use, with Rover automatically managing the NATS lifecycle.
Multi-Machine Setup
Section titled “Multi-Machine Setup”See the Multi-Machine Setup guide for complete instructions, including firewall configuration.
Increase Storage Limits
Section titled “Increase Storage Limits”jetstream { max_memory_store: 2GB max_file_store: 100GB}Important Notes
Section titled “Important Notes”-
Absolute paths required — The
store_dirmust be an absolute path, not relative. The installer generates it as an absolute path automatically. -
Forward slashes — Use forward slashes (
/) in paths, not backslashes. -
Config preserved on upgrade — The installer will not overwrite an existing
nats.config. Your customizations are preserved. -
Restart required — After editing
nats.config, restart Rover. Rover picks up the new config when it spawns NATS on the next launch.
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| Remote machine can’t connect | See Multi-Machine Setup — includes firewall configuration |
| Browser shows no data | Verify the websocket block is present and port 9222 is open |
| JetStream data not persisting | Verify store_dir is an absolute path |
| Out of disk space errors | Increase max_file_store or clear old streams |
| Rover reports NATS won’t start | Check <InstallDir>\logs\nats.log for the underlying error. Common causes include another program using port 4222 or antivirus blocking nats-server.exe |