Skip to content

Production Setup

This guide covers production deployment considerations for License Monitor and License Server Detail, including system requirements, network configuration, and security hardening.

Before deploying to production, ensure you have:

  • Completed development/staging testing
  • Configured all required environment variables
  • Set up SSL/TLS certificates
  • Planned network topology and firewall rules
  • Identified backup and disaster recovery requirements
ComponentMinimumRecommended
CPU1 core2+ cores
Memory256 MB512 MB
Disk100 MB500 MB (with logs)
OSLinux (glibc 2.17+), Windows 10+, macOS 11+Linux (Ubuntu 22.04+, RHEL 8+)
Network100 Mbps1 Gbps
ComponentMinimumRecommended
CPU2 cores4+ cores
Memory1 GB2 GB
Disk500 MB2 GB (with Convex)
RuntimeBun 1.3+ or Node.js 20+Bun 1.3+
Network100 Mbps1 Gbps
┌─────────────────────────────────────────────────────────────────────┐
│ DMZ / Public │
│ ┌─────────────────────────────────────────────────────────────────┐│
│ │ Load Balancer / Reverse Proxy ││
│ │ (nginx, HAProxy, or cloud LB) ││
│ └──────────────────────────────┬──────────────────────────────────┘│
└─────────────────────────────────┼───────────────────────────────────┘
│ HTTPS (443)
┌─────────────────────────────────────────────────────────────────────┐
│ Application Tier │
│ ┌─────────────────────────────────────────────────────────────────┐│
│ │ License Server Detail ││
│ │ (Next.js Dashboard) ││
│ │ Port: 3000 ││
│ └──────────────────────────────┬──────────────────────────────────┘│
└─────────────────────────────────┼───────────────────────────────────┘
│ HTTP/HTTPS (8080)
┌─────────────────────────────────────────────────────────────────────┐
│ Monitoring Tier │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │License Monitor│ │License Monitor│ │License Monitor│ │
│ │ Server 1 │ │ Server 2 │ │ Server 3 │ │
│ │ Port: 8080 │ │ Port: 8080 │ │ Port: 8080 │ │
│ └───────┬──────┘ └───────┬──────┘ └───────┬──────┘ │
└──────────┼─────────────────┼─────────────────┼──────────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────────────────────────────────────────────────────┐
│ License Server Tier │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ FlexLM │ │ RLM │ │ sesinetd │ │
│ │ Server │ │ Server │ │ Server │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
ComponentPortProtocolDirectionPurpose
License Server Detail3000TCPInboundWeb dashboard
License Monitor API8080TCPInboundREST/WebSocket/SSE
Okta Authentication443TCPOutboundOAuth callbacks
Convex Backend443TCPOutboundReal-time database
License ServersVariesTCPOutboundLicense queries
  1. Configure environment variables

    Terminal window
    # Create production config
    cat > /etc/license-monitor/config.toml << 'EOF'
    [command_mode]
    command = "lmstat -a"
    interval_seconds = 300
    [api]
    enabled = true
    bind_address = "127.0.0.1"
    bind_port = 8080
    allow_public_bind = false
    rate_limit_requests = 100
    rate_limit_window_seconds = 60
    cors_origins = ["https://dashboard.example.com"]
    [daemon]
    log_file = "/var/log/license-monitor/license_monitor.log"
    log_level = "warn"
    [update]
    channel = "stable"
    auto_check = false
    require_signature = true
    EOF
  2. Set up log directory

    Terminal window
    sudo mkdir -p /var/log/license-monitor
    sudo chown license-monitor:license-monitor /var/log/license-monitor
  3. Configure log rotation

    Terminal window
    cat > /etc/logrotate.d/license-monitor << 'EOF'
    /var/log/license-monitor/*.log {
    daily
    rotate 14
    compress
    delaycompress
    missingok
    notifempty
    create 0640 license-monitor license-monitor
    postrotate
    systemctl reload license-monitor > /dev/null 2>&1 || true
    endscript
    }
    EOF
  4. Verify binary integrity

    Terminal window
    # Verify SHA-256 checksum
    sha256sum /usr/local/bin/license_monitor
    # Compare with published checksum from release
  5. Test configuration

    Terminal window
    /usr/local/bin/license_monitor --config /etc/license-monitor/config.toml --debug
  1. Configure environment variables

    Terminal window
    # Create .env.production
    cat > .env.production << 'EOF'
    # Public variables
    NEXT_PUBLIC_API_BASE_URL=https://api.example.com
    NEXT_PUBLIC_API_TIMEOUT_MS=15000
    NEXT_PUBLIC_LOG_LEVEL=info
    # Server-side secrets (use secrets manager in production)
    LICENSE_MONITOR_API_KEY=${LICENSE_MONITOR_API_KEY}
    LICENSE_MONITOR_BASE_URL=http://license-monitor:8080
    AUTH_OKTA_ID=${AUTH_OKTA_ID}
    AUTH_OKTA_SECRET=${AUTH_OKTA_SECRET}
    AUTH_OKTA_ISSUER=https://your-org.okta.com/oauth2/default
    AUTH_SECRET=${AUTH_SECRET}
    NEXTAUTH_URL=https://dashboard.example.com
    EOF
  2. Build for production

    Terminal window
    bun install --production
    bun run build
  3. Verify build output

    Terminal window
    # Check for build errors
    ls -la .next/
    # Verify static assets
    ls -la .next/static/
  4. Configure process manager

    See Systemd Services or Windows Services.

  5. Set up health monitoring

    Terminal window
    # Health check endpoint
    curl -f https://dashboard.example.com/api/health || exit 1
  • Valid SSL/TLS certificate (Let’s Encrypt, commercial CA, or internal PKI)
  • TLS 1.2 or higher (TLS 1.3 recommended)
  • Strong cipher suites
# nginx example
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 1d;
ssl_stapling on;
ssl_stapling_verify on;
EndpointPurposeExpected Response
/api/healthApplication health200 OK with JSON status
/api/pingBasic connectivity200 OK
/api/statusDetailed status200 OK with metrics
# Example health check script
#!/bin/bash
HEALTH_URL="http://localhost:8080/api/health"
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" "$HEALTH_URL")
if [ "$RESPONSE" != "200" ]; then
echo "Health check failed: HTTP $RESPONSE"
exit 1
fi
echo "Health check passed"
exit 0

Configure log shipping to your centralized logging solution:

Terminal window
# Example: Forward to syslog
logger -t license-monitor -p local0.info "Application started"
ComponentBackup FrequencyRetention
Configuration filesDaily30 days
Log filesDaily14 days
Convex databaseReal-time (managed)Per plan
SSL certificatesOn renewal1 year
  1. License Monitor Recovery

    Terminal window
    # Restore configuration
    cp /backup/license-monitor/config.toml /etc/license-monitor/
    # Restart service
    systemctl restart license-monitor
  2. License Server Detail Recovery

    Terminal window
    # Restore environment
    cp /backup/license-server-detail/.env.production .
    # Rebuild and restart
    bun run build && pm2 restart all
# config.toml - Performance settings
[api]
max_connections = 100
rate_limit_requests = 100
rate_limit_window_seconds = 60
[command_mode]
interval_seconds = 300 # Adjust based on load
Terminal window
# Environment variables for performance
NODE_OPTIONS="--max-old-space-size=2048"
NEXT_PUBLIC_API_RETRY_MAX_ATTEMPTS=2
NEXT_PUBLIC_API_CIRCUIT_FAILURES=3