Skip to content

CLI & Server Options

Complete reference for all configuration options and CLI commands.

The MikroRoom CLI provides installation and management commands.

Download and install the latest MikroRoom version.

Terminal window
mikroroom install

Downloads from https://releases.mikroroom.com/mikroroom_latest.zip.

Initialize MikroRoom in the current directory.

Terminal window
mikroroom init

Creates:

  • mikroroom.config.json - Frontend configuration
  • app/ - Web application files (if available)

Start the MikroRoom server.

Terminal window
# Basic start
mikroroom start
# With custom port
PORT=8080 mikroroom start
# Pass arguments to Node.js
mikroroom start --inspect

Upgrade to the latest version.

Terminal window
mikroroom upgrade

Checks for updates and installs if available.

Show installed version.

Terminal window
mikroroom version
# Output: MikroRoom v1.0.0

Remove MikroRoom from your system.

Terminal window
mikroroom uninstall

Removes installation files but preserves your configuration.

Open documentation in your browser.

Terminal window
mikroroom docs

Configure the server via .env file or environment variables.

Server port number.

  • Type: Number
  • Default: 3000
  • Example: PORT=8080
Terminal window
PORT=8080 npm start

Enable HTTPS server.

  • Type: Boolean (true or false)
  • Default: false
  • Requires: SSL_CERT_PATH and SSL_KEY_PATH
Terminal window
USE_HTTPS=true

Path to SSL certificate file.

  • Type: String (file path)
  • Required when: USE_HTTPS=true
  • Example: /etc/letsencrypt/live/yourdomain.com/fullchain.pem
Terminal window
SSL_CERT_PATH=/path/to/cert.pem

Path to SSL private key file.

  • Type: String (file path)
  • Required when: USE_HTTPS=true
  • Example: /etc/letsencrypt/live/yourdomain.com/privkey.pem
Terminal window
SSL_KEY_PATH=/path/to/key.pem

TURN server URL for NAT traversal.

  • Type: String (URL)
  • Format: turn:hostname:port or turns:hostname:port
  • Example: turn:turn.example.com:3478
Terminal window
TURN_SERVER_URL=turn:turn.yourdomain.com:3478

TURN server authentication username.

  • Type: String
  • Required with: TURN_SERVER_URL
Terminal window
TURN_SERVER_USERNAME=mikroroom

TURN server authentication password.

  • Type: String
  • Required with: TURN_SERVER_URL
  • Security: Keep secret, don’t commit to git
Terminal window
TURN_SERVER_CREDENTIAL=your-secure-password

Maximum number of pre-created empty rooms.

  • Type: Number
  • Default: 10
  • Range: 1-1000
Terminal window
MAX_LATENT_ROOMS=20

Hours before empty pre-created rooms are cleaned up.

  • Type: Number (hours)
  • Default: 24
  • Range: 1-168 (1 week)
Terminal window
LATENT_ROOM_MAX_AGE_HOURS=48

Configure via static/mikroroom.config.json or dist/app/mikroroom.config.json.

WebSocket URL for signaling server.

  • Type: String (WebSocket URL)
  • Required: Yes
  • Format: ws:// or wss://
{
"apiUrl": "wss://api.yourdomain.com/ws"
}

Examples:

  • Development: "ws://localhost:3000/ws"
  • Production: "wss://yourdomain.com/ws"
  • Separate API: "wss://api.yourdomain.com/ws"

Array of STUN/TURN servers for WebRTC.

  • Type: Array of ICE server objects
  • Optional: Yes (uses default STUN if omitted)
{
"iceServers": [
{ "urls": "stun:stun.cloudflare.com:3478" },
{
"urls": "turn:turn.yourdomain.com:3478",
"username": "mikroroom",
"credential": "password"
}
]
}

ICE Server Object:

  • urls (string or array): STUN/TURN server URLs
  • username (string, optional): Authentication username
  • credential (string, optional): Authentication password

Common STUN servers:

  • stun:stun.cloudflare.com:3478
  • stun:stun.l.google.com:19302
  • stun:stun1.l.google.com:19302

Available scripts for development and production.

Terminal window
# Watch mode (auto-rebuild on changes)
npm run dev
# Watch client only
npm run dev:client
# Watch server only
npm run dev:server
Terminal window
# Full production build
npm run build
# Development build (no minification)
npm run build:dev
# Build client only
npm run build:client
# Build server only
npm run build:server
Terminal window
# Run all tests
npm test
# Tests with coverage
npm run test:coverage
# Check code style
npm run lint
# Fix code style issues
npm run lint:fix
# TypeScript type checking
npm run typecheck
Terminal window
# Create release bundles
npm run release
# Clean build artifacts
npm run clean
Terminal window
# Start production server
npm start
# Build Docker image
npm run docker:build
# Run Docker container
npm run docker:run

.env:

Terminal window
PORT=3000

mikroroom.config.json:

{
"apiUrl": "ws://localhost:3000/ws"
}

.env:

Terminal window
PORT=8080

mikroroom.config.json:

{
"apiUrl": "wss://meet.yourdomain.com/ws"
}

.env:

Terminal window
PORT=443
USE_HTTPS=true
SSL_CERT_PATH=/etc/letsencrypt/live/yourdomain.com/fullchain.pem
SSL_KEY_PATH=/etc/letsencrypt/live/yourdomain.com/privkey.pem
TURN_SERVER_URL=turn:turn.yourdomain.com:3478
TURN_SERVER_USERNAME=mikroroom
TURN_SERVER_CREDENTIAL=strong-password-here
MAX_LATENT_ROOMS=20
LATENT_ROOM_MAX_AGE_HOURS=48

mikroroom.config.json:

{
"apiUrl": "wss://meet.yourdomain.com/ws",
"iceServers": [
{ "urls": "stun:stun.cloudflare.com:3478" },
{
"urls": "turn:turn.yourdomain.com:3478",
"username": "mikroroom",
"credential": "strong-password-here"
}
]
}

.env (Server runs on HTTP internally):

Terminal window
PORT=3000
TURN_SERVER_URL=turn:turn.yourdomain.com:3478
TURN_SERVER_USERNAME=mikroroom
TURN_SERVER_CREDENTIAL=password

mikroroom.config.json (Public-facing is HTTPS):

{
"apiUrl": "wss://meet.yourdomain.com/ws",
"iceServers": [
{ "urls": "stun:stun.cloudflare.com:3478" },
{
"urls": "turn:turn.yourdomain.com:3478",
"username": "mikroroom",
"credential": "password"
}
]
}
  • Never commit .env to git (already in .gitignore)
  • Use strong passwords for TURN credentials
  • Rotate credentials regularly
  • Use environment-specific .env files
  • Use TLS 1.2+ only
  • Keep certificates up to date
  • Use Let’s Encrypt for auto-renewal
  • Configure HSTS headers

Built-in rate limits:

  • WebSocket: 10 connections/minute per IP
  • Room creation: 10 requests/minute per IP

For additional protection, use:

  • Reverse proxy rate limiting (Nginx, Cloudflare)
  • CDN with DDoS protection
  • IP allowlisting for admin endpoints
Terminal window
# Increase memory limit
NODE_OPTIONS="--max-old-space-size=4096" npm start
# Enable debugging
node --inspect dist/api/mikroroom.mjs
ecosystem.config.js
module.exports = {
apps: [{
name: 'mikroroom',
script: './dist/api/mikroroom.mjs',
instances: 'max',
exec_mode: 'cluster',
env: {
NODE_ENV: 'production',
PORT: 3000
}
}]
}

Start with PM2:

Terminal window
pm2 start ecosystem.config.js