Skip to content

Production deployment

  • A Linux server with Docker and Docker Compose.
  • A domain name (for example visio.example.org) pointing to that server.
  • An HTTPS certificate: browsers refuse camera and microphone access without HTTPS (except on localhost).
  • These ports open in the firewall:
Port Protocol Purpose
443 (or your proxy’s port) TCP Web page and WebSocket signalling, through the HTTPS proxy.
10000-10100 (RTC_MIN_PORT-RTC_MAX_PORT) UDP and TCP Audio and video streams to the SFU server. UDP is the normal path; TCP is a fallback when the network blocks UDP. Only the first NUM_WORKERS ports are actually used, but the whole range is published.
  1. Clone the repository and create the configuration file:

    Terminal window
    git clone https://codeberg.org/Militant/militant-visio.git
    cd militant-visio
    cp .env.example .env
  2. In .env, set at least DOMAIN=visio.example.org. If the server is behind NAT, or the domain does not point straight to it, also set ANNOUNCED_IP to its public IP address.

  3. Start: make up.

  4. Put an HTTPS proxy in front of port 3000. It must forward WebSocket connections (path /socket.io/). An example Nginx configuration is provided in docker/nginx.conf; add TLS termination to it or place it behind your own HTTPS access.

  5. Check: curl https://visio.example.org/health must return {"status":"ok","mediasoup":"running"}.

The SFU server has to tell browsers where to send their streams:

  • if ANNOUNCED_IP is set, it is used as is;
  • otherwise, if DOMAIN is not localhost, the domain’s IPv4 address is resolved at startup;
  • otherwise, no address is announced: this only works locally.

Some networks (companies, universities, mobile connections) block UDP. A TURN server, such as Coturn, then lets the streams through. Two modes are supported:

  • Ephemeral credentials (recommended): WEBRTC_TURN_URLS and WEBRTC_TURN_AUTH_SECRET, with the same secret as static-auth-secret in Coturn (use-auth-secret).
  • Static credentials: WEBRTC_TURN_URLS, TURN_USERNAME and TURN_CREDENTIAL.

Example WEBRTC_TURN_URLS:

turn:turn.example.org:3478?transport=udp,turn:turn.example.org:3478?transport=tcp,turns:turn.example.org:5349?transport=tcp