Skip to content

Running RT Server

RT Server can be run on both Windows and Linux platforms in headless mode, providing production-ready deployment options with REST API and Web Panel interfaces.

Windows

Installation

RT Server can be installed on Windows using the official installer from rt.cvedia.com.

The Windows installer automatically:

  • Installs RT Server (rtservice.exe) as a Windows service
  • Configures the service for automatic startup on system boot
  • Sets up the service to run in the background without user interaction

After installation, the RT Server service starts automatically and will be accessible via Web Panel at http://localhost:3546.

rtservice.exe - RT Server Process

RT Server on Windows is provided as rtservice.exe which can run as a foreground process or Windows service.

Use rtservice.exe --help for the most up-to-date options:

rtservice.exe [OPTIONS]

OPTIONS:
  -h,     --help              Print this help message and exit
  -s,     --solutions TEXT:DIR [C:/ProgramData/CVEDIA/CVEDIA-RT/files/solutions]
                              Path to the AI solutions folder
  -i,     --instances TEXT:DIR [C:/ProgramData/CVEDIA/CVEDIA-RT/files/instances]
                              Path to the instances folder
  -d,     --daemon            Run as a Windows service
          --auto-discovery, --no-auto-discovery{false} [1]
                              RT auto discovery
          --version           Print version

Logging:
          --log-level TEXT:{verbose,debug,info,warning,error,fatal} [info]  (Env:RT_LOG_LEVEL)
                              Set log level
          --log-max-size INT [52428800]
                              Log file size at which to rotate the log
          --log-max-files INT [3]
                              Number of rotated logs to keep
          --log-file TEXT [cvediart.log]  (Env:RT_LOG_FILE)
                              Set log file
          --log-console       Enable console logging

Webserver:
          --webserver, --no-webserver{false} [1]
                              Enable webserver for REST API, Admin panel and HLS
          --webserver-host TEXT:IPV4 [0.0.0.0]
                              Host to listen on
          --webserver-port INT:INT in [1 - 65535] [3546]
                              Port to listen on

Performance:
          --pin-on-core       Assign a random but fixed CPU core to each instance
          --opencv-num-threads INT:INT in [-1 - 64] [0]
                              Number of threads to use for OpenCV

Plugins:
          --plugin-list       List all loaded plugins

Key Options

  • --daemon: Run as Windows service for automatic startup
  • --webserver-port: Change default Web Panel port (default: 3546)
  • --webserver-host: Set binding interface (default: all interfaces)
  • --log-console: Enable console logging for debugging

Running as Windows Service

To install and run RT Server as a Windows service:

# Install the service
rtservice.exe --daemon

# Start the service manually
net start "CVEDIA RT Service"

# Stop the service
net stop "CVEDIA RT Service"

Linux

RT Server on Linux can be run either natively or in Docker containers.

Native Linux Installation

RT Server can be installed natively on Linux through the official apt repository. This provides better performance and easier system integration compared to Docker.

Installation

Install RT Server using the convenience script:

curl -fsSLo - http://get.cvedia.com | sudo bash
sudo apt install cvedia-rt -y

Running RT Server

Method 1: Using systemd service (recommended for production)

# Start the RT Server service
sudo systemctl start cvedia-rt

# Enable automatic startup on boot
sudo systemctl enable cvedia-rt

# Check service status
sudo systemctl status cvedia-rt

# Stop the service
sudo systemctl stop cvedia-rt

Method 2: Running directly with rtservice binary

# Run RT Server directly
rtservice

# Run with custom configuration
rtservice --webserver-port 8080 --solutions /custom/path/solutions

# Run in background (using nohup)
nohup rtservice > /var/log/cvedia-rt.log 2>&1 &

Native Linux Configuration

The native installation places files at:

  • Installation directory: /opt/cvedia-rt/
  • Configuration: /opt/cvedia-rt/rtconfig.json
  • Solutions: /opt/cvedia-rt/solutions/
  • Instances: /opt/cvedia-rt/instances/

Configure RT Server through /opt/cvedia-rt/rtconfig.json:

{
  "webserver": {
    "enabled": true,
    "port": 3546,
    "host": "0.0.0.0"
  },
  "auto_discovery": {
    "enabled": true,
    "port": 12349
  }
}

Docker Service Mode

Alternatively, RT Server can run within Docker containers using the run.sh script in service mode.

Running in Background (Daemon Mode)

# Run RT Server in background
./run.sh --daemon

# Run with specific API port
./run.sh --daemon --api_port 3546

# Run without exposing any ports
./run.sh --daemon --no_expose

Service Options in run.sh

--api_port <port>: Port to expose API, default: 8080; Use 0 to disable exposing.

--rtsp_port <port>: Port to expose RTSP stream, default: 8554; Use 0 to disable exposing.

--mqtt_port <port>: Port to expose MQTT service, default: 1883; Use 0 to disable exposing; Ignored when --disable_mqtt is set.

-E, --no_expose: Do not expose any service or port; This overrides all other service / port expose options.

--disable_mqtt: Disable internal MQTT service

--use_image_rest_ep: Enables synchronous image rest ingestion endpoint. Requires internal MQTT service.

--intent <value>: Docker intent, possible options are:

run: Run the container (default)

create: Create the container but do not start it

Key Service Parameters

  • --daemon: Run container in background as service
  • --api_port 3546: Expose REST API on port 3546 (default: 8080)
  • --no_expose: Don't expose any ports (security mode)
  • --webserver: Enable web admin panel (enabled by default)

Managing Docker Service

# View running containers
docker ps

# View logs from background RT Server
docker logs cvedia-rt_<container_name>

# Stop background RT Server
docker stop cvedia-rt_<container_name>

# Remove stopped container
docker rm cvedia-rt_<container_name>

Configuration

RT Server behavior can be configured through the global configuration file rtconfig.json. See Global Config for details.

Web Server Configuration

The embedded web server can be configured in rtconfig.json:

{
  "webserver": {
    "enabled": true,
    "port": 3546,
    "host": "0.0.0.0"
  }
}

Auto-Discovery

RT Server includes auto-discovery features that can be configured:

{
  "auto_discovery": {
    "enabled": true,
    "port": 12349
  }
}

Production Considerations

Deployment Method Choice

Native Linux Installation (Recommended for Production)

  • Better performance (no container overhead)
  • Direct system integration with systemd
  • Easier log management and monitoring
  • Direct hardware access
  • Simpler networking configuration

Docker Installation

  • Consistent environment across different systems
  • Easier updates and rollbacks
  • Container isolation and security
  • Complex setups with multiple services

Security

  • RT Server exposes web services by default on port 3546
  • Consider firewall rules to restrict access
  • Use --webserver-host to bind to specific interfaces
  • Disable auto-discovery in production: --no-auto-discovery

Performance

  • Use --pin-on-core to assign CPU cores to instances
  • Configure --opencv-num-threads for optimal OpenCV performance
  • Monitor using Web Panel or REST API endpoints

Monitoring

  • Enable console logging: --log-console
  • Configure log rotation: --log-max-size and --log-max-files
  • Use REST API health endpoints for monitoring
  • Access Web Panel at http://server-ip:3546

Next Steps