Skip to content

NATS Configuration

C:\Users\<username>\AppData\Local\OptionsRealTime\nats.config
# NATS Server Configuration for OptionsRealTime
host: 127.0.0.1
port: 4222
http: 127.0.0.1:8222
max_payload: 67000000
jetstream {
store_dir: "C:/Users/<username>/AppData/Local/OptionsRealTime/jetstream"
max_memory_store: 1GB
max_file_store: 50GB
sync_interval: "2m"
}
SettingDefaultDescription
host127.0.0.1IP address to bind. Use 0.0.0.0 for multi-machine setups.
port4222Main NATS port for client connections
http127.0.0.1:8222HTTP monitoring endpoint
max_payload67000000Maximum message size in bytes (~64MB)
SettingDefaultDescription
store_dir<install>/jetstreamAbsolute path to JetStream data storage
max_memory_store1GBMaximum memory for stream storage
max_file_store50GBMaximum disk space for stream storage
sync_interval2mHow often to sync data to disk

No changes needed. The default 127.0.0.1 binding only allows local connections.

See the Multi-Machine Setup guide for complete step-by-step instructions, including firewall configuration.

For larger historical data needs:

jetstream {
max_memory_store: 2GB
max_file_store: 100GB
}
  • Absolute paths required: The store_dir must be an absolute path (e.g., C:/Users/.../jetstream), not relative. This ensures consistent behavior whether NATS runs as a service or manually.

  • 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 NATS:

    • If running as service: Use Remove NATS Service then Install NATS Service (both as Administrator)
    • If running manually: Close the NATS window and double-click Start NATS
ProblemSolution
Remote machine can’t connectSee Multi-Machine Setup — includes firewall fix
JetStream data not persistingVerify store_dir is an absolute path
Out of disk space errorsIncrease max_file_store or clear old streams
Service won’t startRun Start NATS manually to see the error message