Skip to content

NATS as a Service

NATS is a high-performance messaging system used by OptionsRealTime for real-time data streaming between components.

By default, you need to manually start NATS each time you use OptionsRealTime. This guide shows how to install NATS as a Windows service so it starts automatically.

Double-click Start NATS from the OptionsRealTime desktop folder. You should see:

[INF] Starting nats-server
[INF] Version: 2.10.16
[INF] Starting JetStream
[INF] _ ___ _____ ___ _____ ___ ___ _ __ __
[INF] _ | | __|_ _/ __|_ _| _ \ __| /_\ | \/ |
[INF] | || | _| | | \__ \ | | | / _| / _ \| |\/| |
[INF] \__/|___| |_| |___/ |_| |_|_\___/_/ \_\_| |_|
[INF]
[INF] https://docs.nats.io/jetstream
[INF]
[INF] ---------------- JETSTREAM ----------------
[INF] Max Memory: 1.00 GB
[INF] Max Storage: 50.00 GB
[INF] Store Directory: "jetstream"
[INF] -------------------------------------------
[INF] Listening for client connections on 127.0.0.1:4222
[INF] Server is ready

Keep this window open while using OptionsRealTime. To run NATS automatically at startup, install it as a service.

  1. Open the OptionsRealTime folder on your desktop
  2. Open the Advanced folder

Advanced folder

  1. Right-click Install NATS Service and select Run as administrator
  2. Click Yes when Windows asks to allow changes

You’ll see the installation progress:

Admin privileges detected
Running with admin privileges...
Setting up JetStream directory...
Installing nats-server service...
[SC] CreateService SUCCESS
Service created successfully.
Configuring service to restart on failure...
Starting nats-server service...
Service started successfully
============================================================
nats-server service has been successfully installed and started
============================================================
Configuration: C:\Users\...\OptionsRealTime\nats.config
JetStream Directory: C:\Users\...\OptionsRealTime\jetstream
Client Port: 4222
HTTP Monitoring: http://localhost:8222
The service is configured to:
- Start automatically on system boot
- Restart on failure (5s, 10s, 30s delays)
To verify JetStream is enabled, visit:
http://localhost:8222/jsz

Press any key to close the window.

  1. Press Win + R, type services.msc, press Enter
  2. Find NATS Server in the list
  3. Verify the status shows Running
  4. Verify startup type is Automatic

NATS Service running

That’s it! NATS will now start automatically when Windows boots.

You can control the NATS service from the Services panel:

  • Start — Start the service manually
  • Stop — Stop the service
  • Restart — Stop and start the service

Or from Command Prompt (Run as Administrator):

Terminal window
net start nats-server
net stop nats-server

To remove the NATS service:

  1. Open the OptionsRealTime → Advanced folder
  2. Right-click Remove NATS Service and select Run as administrator

Multiple Accounts →
Add more IBKR accounts to Rover