### Quick Start Installation and Run Source: https://docs.mirotalk.com/mirotalk-cme/self-hosting Clones the repository, copies configuration files, installs dependencies, and starts the server. This is the foundational setup for running the service locally. ```Bash # Clone this repo git clone https://github.com/miroslavpejic85/call-me.git # Go to dir call-me cd call-me # Copy the config file cp public/config.template.js public/config.js # Copy .env.template to .env cp .env.template .env # Install dependencies npm install # Start the server npm start ``` -------------------------------- ### Quick start installation Source: https://docs.mirotalk.com/mirotalk-c2c/self-hosting Commands to clone the repository, configure the environment, install dependencies, and start the server. ```bash # Clone the repository git clone https://github.com/miroslavpejic85/mirotalkc2c.git # Navigate to the project directory cd mirotalkc2c # Copy and customize the environment template cp .env.template .env # Install dependencies npm ci # Start the server npm start ``` -------------------------------- ### Install dependencies and start server Source: https://docs.mirotalk.com/mirotalk-sfu/self-hosting Install project dependencies and start the MiroTalk SFU server. ```bash # Install dependencies (first run may take a few minutes) npm ci # Start the server npm start ``` -------------------------------- ### Install Dependencies and Start Server Source: https://docs.mirotalk.com/mirotalk-admin/self-hosting Install the required project dependencies and launch the server. Ensure ADMIN_DASHBOARD_ENABLED is set to true in the .env file before starting. ```bash # Install dependencies npm ci # Start the server npm start ``` -------------------------------- ### Quick Start Installation Commands Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Commands to clone the repository, prepare the environment, install dependencies, and start the MiroTalk BRO server. ```bash # Clone the repository git clone https://github.com/miroslavpejic85/mirotalkbro.git # Navigate to the project directory cd mirotalkbro # Copy and customize the environment template cp .env.template .env # Install dependencies npm ci # Start the server npm start ``` -------------------------------- ### Apache Installation and SSL Setup Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Initial setup for Apache using Certbot and opening the configuration file. ```bash # Install Apache with Certbot apt install python3-certbot-apache -y # Set up SSL certbot --apache --non-interactive --agree-tos -d YOUR.DOMAIN.NAME -m your.email.address # Edit the Apache site configuration sudo vim /etc/apache2/sites-enabled/YOUR.DOMAIN.NAME.conf ``` -------------------------------- ### Install and start vsftpd Source: https://docs.mirotalk.com/utility/ftp Updates package lists, installs vsftpd, and starts/enables the FTP service. ```bash # Update package lists sudo apt update # Install the FTP server sudo apt install vsftpd # Start and enable the FTP service sudo systemctl start vsftpd sudo systemctl enable vsftpd ``` -------------------------------- ### Install and Start MiroTalk BRO with PM2 Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Commands to install PM2, start the server process, save the configuration, and enable auto-start on system boot. ```bash npm install -g pm2 pm2 start app/server.js --name mirotalkbro pm2 save pm2 startup ``` -------------------------------- ### Install PM2 and Start MiroTalk WEB Source: https://docs.mirotalk.com/mirotalk-web/self-hosting Commands to install PM2 globally, start the MiroTalk WEB server, save the process list, and enable auto-start on boot. ```bash # Install PM2 npm install -g pm2 # Start the server pm2 start backend/server.js --name mirotalkweb # Save the process list pm2 save # Enable auto-start on boot pm2 startup ``` -------------------------------- ### Clone and set up backend Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Clones the repository, copies configuration templates, installs dependencies, and starts the server. ```bash git clone https://github.com/miroslavpejic85/mirotalk-admin.git cd mirotalk-admin cp backend/config/index.template.js backend/config/index.js cp .env.template .env npm ci npm start ``` -------------------------------- ### Install and setup MiroTalk Admin with Docker Source: https://docs.mirotalk.com/mirotalk-admin/self-hosting Commands to install Docker, clone the repository, and prepare configuration files. ```bash sudo apt install -y docker.io sudo apt install -y docker-compose git clone https://github.com/miroslavpejic85/mirotalk-admin.git cd mirotalk-admin cp backend/config/index.template.js backend/config/index.js cp .env.template .env ``` -------------------------------- ### Using PM2 Process Manager Source: https://docs.mirotalk.com/mirotalk-cme/self-hosting Install PM2 globally, start the server, save the process list, and configure startup to persist after reboot. ```Bash npm install -g pm2 pm2 start app/server.js pm2 save pm2 startup ``` -------------------------------- ### GET /users Python Example Source: https://docs.mirotalk.com/mirotalk-cme/api Initializes the requests library for API interaction. ```python import requests # pip3 install requests ``` -------------------------------- ### GET /stats - JavaScript Example Source: https://docs.mirotalk.com/mirotalk-sfu/api JavaScript example using node-fetch to call the GET /stats endpoint. Requires npm i node-fetch. Uses dynamic import for fetch, sends the API key in the authorization header, and prints the response or error. ```JavaScript "use strict"; // npm i node-fetch async function getStats() { try { // Use dynamic import with await const { default: fetch } = await import("node-fetch"); const API_KEY_SECRET = "YOUR_API_KEY_SECRET"; const MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/stats"; const response = await fetch(MIROTALK_URL, { method: "GET", headers: { authorization: API_KEY_SECRET, "Content-Type": "application/json", }, }); const data = await response.json(); if (data.error) { console.log("Error:", data.error); } else { if (data) { const formattedData = JSON.stringify(data, null, 2); console.log(formattedData); } } } catch (error) { console.error("Error fetching data:", error); } } getStats(); ``` -------------------------------- ### Quick Start: Clone and Setup MiroTalk WEB Source: https://docs.mirotalk.com/mirotalk-web/self-hosting Commands to clone the MiroTalk WEB repository, navigate into the project directory, and copy the environment and config templates. Replace placeholder values in the copied files with your actual domain names. ```bash # Clone the repository git clone https://github.com/miroslavpejic85/mirotalkwebrtc.git # Navigate to the project directory cd mirotalkwebrtc # Copy and customize the environment template cp .env.template .env # Copy and customize the config template cp backend/config.template.js backend/config.js ``` -------------------------------- ### Setup MiroTalk BRO with Docker Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Commands to install Docker dependencies, clone the repository, and prepare the environment and compose files. ```bash sudo apt install -y docker.io sudo apt install -y docker-compose git clone https://github.com/miroslavpejic85/mirotalkbro.git cd mirotalkbro cp .env.template .env cp docker-compose.template.yml docker-compose.yml ``` -------------------------------- ### Manage Process with PM2 Source: https://docs.mirotalk.com/mirotalk-admin/self-hosting Install PM2 globally and use it to start the MiroTalk Admin server as a managed process. ```bash # Install PM2 npm install -g pm2 # Start the server pm2 start backend/server.js --name mirotalk-admin ``` -------------------------------- ### Start MediaMTX Source: https://docs.mirotalk.com/mirotalk-bro/rtmp Starts MediaMTX with its configuration file. ```bash mediamtx mediamtx.yml ``` -------------------------------- ### Install mkcert and generate local certificates on Linux Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Downloads and installs the mkcert binary, installs the local CA, and creates a certificate for localhost and 127.0.0.1. On Fedora/RHEL install nss-tools first; on Arch use nss and mkcert. Ensure libnss3-tools or nss-tools is installed before running mkcert -install for Firefox trust. ```bash # install the mkcert binary (pick the latest release for your arch) curl -fsSLo /tmp/mkcert "https://dl.filippo.io/mkcert/latest?for=linux/amd64" sudo install -m 0755 /tmp/mkcert /usr/local/bin/mkcert mkcert -install mkdir -p backend/ssl/dev cd backend/ssl/dev mkcert -key-file key.pem -cert-file cert.pem localhost 127.0.0.1 ::1 ``` -------------------------------- ### Install MkDocs using snap Source: https://docs.mirotalk.com/mirotalk-docs/self-hosting Install MkDocs using the snap package manager. This method requires installing snapd first. ```bash sudo apt update sudo apt install snapd sudo snap install mkdocs ``` -------------------------------- ### Install Coturn Source: https://docs.mirotalk.com/scripts/about Downloads and executes the Coturn installation script. ```bash # Install Coturn wget -qO coturn-install.sh https://docs.mirotalk.com/scripts/coturn/coturn-install.sh \ && chmod +x coturn-install.sh \ && ./coturn-install.sh ``` -------------------------------- ### Install Docker, Compose, and FFmpeg prerequisites Source: https://docs.mirotalk.com/mirotalk-sfu/rtmp Bash commands to install Docker Engine, Docker Compose, and FFmpeg on Ubuntu. ```Bash sudo apt update sudo apt install -y docker.io docker-compose ffmpeg ``` -------------------------------- ### GET /users PHP Example Source: https://docs.mirotalk.com/mirotalk-cme/api Fetches a list of connected users using cURL. Optionally append ?room=Support or ?details=true to the URL. ```php ``` -------------------------------- ### Clone and set up project for PM2 Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Clones the repository and sets up configuration files without starting the server. ```bash git clone https://github.com/miroslavpejic85/mirotalk-admin.git cd mirotalk-admin cp backend/config/index.template.js backend/config/index.js cp .env.template .env npm ci ``` -------------------------------- ### Install Docker and Docker Compose Source: https://docs.mirotalk.com/mirotalk-cme/self-hosting Commands to install Docker and Docker Compose on a Linux system using apt. ```bash # Install docker $ sudo apt install -y docker.io # Instal docker-compose $ sudo apt install -y docker-compose ``` -------------------------------- ### GET /stats Python Example Source: https://docs.mirotalk.com/mirotalk-cme/api Fetches server statistics using the requests library in Python. ```python import requests # pip3 install requests # Aggregate server statistics: version, uptime, total users, rooms and active calls url = "https://YOUR-DOMAIN-NAME/api/v1/stats" authorization = "YOUR_API_KEY_SECRET" headers = { 'Authorization': authorization, 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### GET /users JavaScript Example Source: https://docs.mirotalk.com/mirotalk-cme/api Fetches a list of connected users using the Fetch API. Optionally append ?room=Support or ?details=true to the URL. ```javascript 'use strict'; // Optionally append ?room=Support or ?details=true const url = 'https://YOUR-DOMAIN-NAME/api/v1/users'; const authorization = 'YOUR_API_KEY_SECRET'; fetch(url, { method: 'GET', headers: { Authorization: authorization, 'Content-Type': 'application/json', }, }) .then((response) => response.json()) .then((data) => console.log(data)) .catch((error) => console.error('Error:', error)); ``` -------------------------------- ### GET /stats - PHP Example Source: https://docs.mirotalk.com/mirotalk-sfu/api PHP example using cURL to call the GET /stats endpoint. Sends the API key in the authorization header, prints the HTTP status code, and outputs the JSON response formatted with JSON_PRETTY_PRINT. ```PHP response.json()) .then((data) => console.log(data)) .catch((error) => console.error('Error:', error)); ``` -------------------------------- ### GET /api/v1/rooms - Bash Example Source: https://docs.mirotalk.com/mirotalk-cme/api Bash example using curl to list active rooms with user counts and active call counts. Requires the API key secret in the Authorization header. ```Bash #!/bin/bash # List active rooms with user counts and active call counts url="https://YOUR-DOMAIN-NAME/api/v1/rooms"; authorization="YOUR_API_KEY_SECRET" response=$(curl -s -X GET "$url" -H "Authorization: $authorization" -H "Content-Type: application/json") echo "$response" ``` -------------------------------- ### Start Coturn with Docker Compose Source: https://docs.mirotalk.com/coturn/installation Start the Coturn container defined in docker-compose.yml. ```Bash docker-compose up -d ``` -------------------------------- ### Process management with PM2 Source: https://docs.mirotalk.com/mirotalk-c2c/self-hosting Commands to install PM2, start the MiroTalk C2C server as a background process, and configure it to auto-start on boot. ```bash # Install PM2 npm install -g pm2 # Start the server pm2 start backend/server.js --name mirotalkc2c # Save the process list pm2 save # Enable auto-start on boot pm2 startup ``` -------------------------------- ### POST /meeting - JavaScript Example Source: https://docs.mirotalk.com/mirotalk-p2p/api This example creates a new meeting using JavaScript with node-fetch. It uses async/await to handle the request and prints either the meeting or an error. This example requires npm i node-fetch as noted in the comment. ```javascript "use strict"; // npm i node-fetch try { // Dynamically import 'node-fetch' with 'await' const { default: fetch } = await import("node-fetch"); const API_KEY_SECRET = "YOUR_API_KEY_SECRET"; const MIROTALK_URL = "https://p2p.mirotalk.com/api/v1/meeting"; const response = await fetch(MIROTALK_URL, { method: "POST", headers: { authorization: API_KEY_SECRET, "Content-Type": "application/json", }, }); const data = await response.json(); if (data.error) { console.log("Error:", data.error); } else { console.log("Meeting:", data.meeting); } } catch (error) { console.error("Error fetching data:", error); } ``` -------------------------------- ### GET /api/v1/connected - Bash Example Source: https://docs.mirotalk.com/mirotalk-cme/api Bash example using curl to check connected users. Optionally append &room=Support to scope to a specific room; defaults to the public room. Requires the API key secret in the Authorization header. ```Bash #!/bin/bash # Optionally scope to a room: append &room=Support (defaults to the public room) url="https://YOUR-DOMAIN-NAME/api/v1/connected?user=call-me"; authorization="YOUR_API_KEY_SECRET" response=$(curl -s -X GET "$url" -H "Authorization: $authorization" -H "Content-Type: application/json") echo "$response" ``` -------------------------------- ### Manage server with PM2 Source: https://docs.mirotalk.com/mirotalk-sfu/self-hosting Use PM2 to install, start, save, and enable auto-start for the MiroTalk SFU server process. ```bash # Install PM2 npm install -g pm2 # Start the server pm2 start app/src/Server.js --name mirotalksfu # Save the process list pm2 save # Enable auto-start on boot pm2 startup ``` -------------------------------- ### List available Node.js versions Source: https://docs.mirotalk.com/utility/nvm Lists all available Node.js versions for installation. ```bash nvm ls-remote ``` -------------------------------- ### Start MiroTalk Source: https://docs.mirotalk.com/mirotalk-bro/rtmp Starts the MiroTalk application. ```bash npm start ``` -------------------------------- ### Start server with PM2 Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Starts the backend server using PM2 with the name 'mirotalk-admin'. ```bash pm2 start backend/server.js --name mirotalk-admin ``` -------------------------------- ### Python Join Example Source: https://docs.mirotalk.com/mirotalk-bro/api Uses the requests library to POST to the /join endpoint. Requires pip3 install requests. Prints the status code and the join URL from the JSON response. ```Python # pip3 install requests import requests import json API_KEY_SECRET = "YOUR_API_KEY_SECRET" MIROTALK_URL = "https://bro.mirotalk.com/api/v1/join" headers = { "authorization": API_KEY_SECRET, "Content-Type": "application/json", } data = { "room": "test" } response = requests.post( MIROTALK_URL, headers=headers, json=data, ) print("Status code:", response.status_code) data = json.loads(response.text) print("join:", data["join"]) ``` -------------------------------- ### Start Docker Containers Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Commands to pull the latest image and start the containers. ```bash docker-compose pull docker-compose up ``` -------------------------------- ### GET /api/v1/rooms - Python Example Source: https://docs.mirotalk.com/mirotalk-cme/api Python example using the requests library to list active rooms with user counts and active call counts. Requires the API key secret in the Authorization header. ```Python import requests # pip3 install requests # List active rooms with user counts and active call counts url = "https://YOUR-DOMAIN-NAME/api/v1/rooms" authorization = "YOUR_API_KEY_SECRET" headers = { 'Authorization': authorization, 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### GET /meetings - Python Example Source: https://docs.mirotalk.com/mirotalk-p2p/api This example fetches the list of active meetings using Python requests. It uses the API key secret for authorization and expects a JSON response. If the request is successful, it prints the data. ```python # pip3 install requests import requests import json API_KEY_SECRET = "YOUR_API_KEY_SECRET" MIROTALK_URL = "https://p2p.mirotalk.com/api/v1/meetings" headers = { "authorization": API_KEY_SECRET, "Content-Type": "application/json", } response = requests.get( MIROTALK_URL, headers=headers ) print("Status code:", response.status_code) if response.status_code == 200: data = response.json() pretty_printed_data = json.dumps(data, indent=4) print(data) else: print("Failed to retrieve data. Error:", response.text) ``` -------------------------------- ### Install Docker and Clone Repository Source: https://docs.mirotalk.com/mirotalk-p2p/self-hosting Commands to install Docker dependencies and clone the MiroTalk repository. ```bash sudo apt install -y docker.io sudo apt install -y docker-compose # Clone the repository git clone https://github.com/miroslavpejic85/mirotalk.git # Navigate to the project directory cd mirotalk # Copy and customize the environment template cp .env.template .env # Copy and customize the config template cp app/src/config.template.js app/src/config.js # Copy and customize the Docker Compose template cp docker-compose.template.yml docker-compose.yml ``` -------------------------------- ### GET /api/v1/connected - Python Example Source: https://docs.mirotalk.com/mirotalk-cme/api Python example using the requests library to check connected users. Optionally append &room=Support to scope to a specific room; defaults to the public room. Requires the API key secret in the Authorization header. ```Python import requests # Optionally scope to a room: append &room=Support (defaults to the public room) url = "https://YOUR-DOMAIN-NAME/api/v1/connected?user=call-me" authorization = "YOUR_API_KEY_SECRET" headers = { 'Authorization': authorization, 'Content-Type': 'application/json' } response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Install MiroTalk WEB Source: https://docs.mirotalk.com/scripts/about Downloads and executes the MiroTalk WEB installation script. ```bash # Install MiroTalk WEB wget -qO web-install.sh https://docs.mirotalk.com/scripts/web/web-install.sh \ && chmod +x web-install.sh \ && ./web-install.sh ``` -------------------------------- ### Install MiroTalk BRO Source: https://docs.mirotalk.com/scripts/about Downloads and executes the MiroTalk BRO installation script. ```bash # Install MiroTalk BRO wget -qO bro-install.sh https://docs.mirotalk.com/scripts/bro/bro-install.sh \ && chmod +x bro-install.sh \ && ./bro-install.sh ``` -------------------------------- ### GET /stats JavaScript Example Source: https://docs.mirotalk.com/mirotalk-cme/api Fetches server statistics including version, uptime, total users, rooms, and active calls using the Fetch API. ```javascript 'use strict'; // Aggregate server statistics: version, uptime, total users, rooms and active calls const url = 'https://YOUR-DOMAIN-NAME/api/v1/stats'; const authorization = 'YOUR_API_KEY_SECRET'; fetch(url, { method: 'GET', headers: { Authorization: authorization, 'Content-Type': 'application/json', }, }) .then((response) => response.json()) .then((data) => console.log(data)) .catch((error) => console.error('Error:', error)); ``` -------------------------------- ### Use an installed Node.js version Source: https://docs.mirotalk.com/utility/nvm Switches to a specific installed version of Node.js and verifies the current version. ```bash nvm use X.X.X ``` ```bash nvm use v22.21.1 ``` ```bash node -v ``` -------------------------------- ### Docker Compose configuration example Source: https://docs.mirotalk.com/mirotalk-admin/self-hosting Example configuration for the mirotalkadmin service within docker-compose.yml. ```yaml services: mirotalkadmin: image: mirotalk/admin:latest container_name: mirotalkadmin hostname: mirotalkadmin restart: unless-stopped ports: - '${ADMIN_PORT}:${ADMIN_PORT}' volumes: - ./frontend:/app/frontend:ro - ./backend:/app/backend:ro - ./.env:/app/.env:ro ``` -------------------------------- ### Install Certbot for Apache Source: https://docs.mirotalk.com/mirotalk-admin/self-hosting Installs the Certbot Apache plugin on the server. ```bash apt install python3-certbot-apache -y ``` -------------------------------- ### Using Docker Source: https://docs.mirotalk.com/mirotalk-cme/self-hosting Docker deployment command for running MiroTalk CME. The provided command is minimal but serves as a starting point for containerized setup. ```Bash docker ... ``` -------------------------------- ### Install Certbot and Generate SSL Certificates Source: https://docs.mirotalk.com/mirotalk-cme/self-hosting Install the Certbot Apache plugin and run the command to automatically configure SSL for your domain. Replace YOUR.DOMAIN.NAME and your.email.address with your actual domain and email. ```bash apt install python3-certbot-apache -y certbot --apache --non-interactive --agree-tos -d YOUR.DOMAIN.NAME -m your.email.address ``` -------------------------------- ### Install Nginx and Certbot Source: https://docs.mirotalk.com/mirotalk-docs/self-hosting Commands to install the Nginx web server and the Certbot tool for managing SSL certificates via snap. ```bash sudo apt-get install nginx ``` ```bash sudo apt install snapd sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot ``` -------------------------------- ### Install mkcert and generate local certificates on Windows (PowerShell) Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Installs mkcert via Chocolatey or Scoop, then generates a certificate for localhost and 127.0.0.1. Firefox on Windows uses its own trust store; restart Firefox after mkcert -install. Chrome and Edge use the Windows trust store and work immediately. ```powershell # Easiest path: Chocolatey choco install mkcert # …or Scoop: # scoop bucket add extras; scoop install mkcert mkcert -install mkdir backend\ssl\dev cd backend\ssl\dev mkcert -key-file key.pem -cert-file cert.pem localhost 127.0.0.1 ::1 ``` -------------------------------- ### Install Redirect Snippets Source: https://docs.mirotalk.com/mirotalk-docs/self-hosting Command to install the permanent compatibility redirects configuration file. ```bash sudo install -m 0644 /root/mirotalk-docs/deploy/nginx/redirects.conf /etc/nginx/snippets/mirotalk-docs-redirects.conf ``` -------------------------------- ### Install PM2 globally Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Installs PM2 globally for process management. ```bash npm install -g pm2 ``` -------------------------------- ### Install mkcert prerequisites on Linux (Debian/Ubuntu) Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Install the NSS tools required by mkcert on Debian/Ubuntu. After this, run the mkcert commands shown for macOS to generate a trusted certificate for local development. ```bash sudo apt update sudo apt install -y libnss3-tools ``` -------------------------------- ### Install MiroTalk Whisper Source: https://docs.mirotalk.com/scripts/about Downloads and executes the MiroTalk Whisper installation script. ```bash # Install MiroTalk Whisper wget -qO whisper-install.sh https://docs.mirotalk.com/scripts/whisper/whisper-install.sh \ && chmod +x whisper-install.sh \ && ./whisper-install.sh ``` -------------------------------- ### Install MiroTalk P2P Source: https://docs.mirotalk.com/scripts/about Downloads and executes the MiroTalk P2P installation script. ```bash # Install MiroTalk P2P wget -qO p2p-install.sh https://docs.mirotalk.com/scripts/p2p/p2p-install.sh \ && chmod +x p2p-install.sh \ && ./p2p-install.sh ``` -------------------------------- ### Install NVM via curl Source: https://docs.mirotalk.com/utility/nvm Installs NVM using the curl command. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash ``` -------------------------------- ### Install MkDocs using pip Source: https://docs.mirotalk.com/mirotalk-docs/self-hosting Install MkDocs using the Python package manager pip. This is one of the three installation methods provided. ```bash pip install mkdocs ``` -------------------------------- ### Install requests library Source: https://docs.mirotalk.com/mirotalk-p2p/api Install the required Python requests library before running the API integration script. ```bash pip3 install requests ``` -------------------------------- ### Start Docker services with MediaMTX overlay Source: https://docs.mirotalk.com/mirotalk-bro/rtmp Use this command to start MiroTalk with the MediaMTX service. Without the overlay file, RTMP ingest is unavailable. ```bash docker compose -f docker-compose.yml -f docker-compose-mediamtx.yml up -d ``` -------------------------------- ### Install System Dependencies Source: https://docs.mirotalk.com/mirotalk-sfu/self-hosting Installs essential system packages, including build tools, git, and FFmpeg, required for the MiroTalk SFU environment. ```bash # Run all apt commands in non-interactive mode (no prompts) export DEBIAN_FRONTEND=noninteractive # Update package lists apt-get update -y # Install required system packages apt-get install -y \ build-essential \ git \ curl \ wget \ unzip \ tzdata \ software-properties-common \ ffmpeg # Install Python 3.8 and pip add-apt-repository -y ppa:deadsnakes/ppa apt-get update -y apt-get install -y python3.8 python3-pip ``` -------------------------------- ### Clone and Prepare Project Files Source: https://docs.mirotalk.com/mirotalk-sfu/self-hosting Commands to clone the repository and initialize configuration files from templates. ```bash git clone https://github.com/miroslavpejic85/mirotalksfu.git cd mirotalksfu cp app/src/config.template.js app/src/config.js cp .env.template .env cp docker-compose.template.yml docker-compose.yml ``` -------------------------------- ### Start MongoDB Container Source: https://docs.mirotalk.com/mirotalk-web/self-hosting Runs the MongoDB container using the npm script 'mongo:up'. ```bash npm run mongo:up ``` -------------------------------- ### Install MiroTalk SFU Source: https://docs.mirotalk.com/scripts/about Downloads and executes the MiroTalk SFU installation script. ```bash # Install MiroTalk SFU wget -qO sfu-install.sh https://docs.mirotalk.com/scripts/sfu/sfu-install.sh \ && chmod +x sfu-install.sh \ && ./sfu-install.sh ``` -------------------------------- ### Example receiver output Source: https://docs.mirotalk.com/mirotalk-cme/webhook Sample log output from the example receiver, showing events as they occur. The server listens on http://localhost:9099/webhooks/call-me by default and can be overridden with PORT, WEBHOOK_PATH, and WEBHOOK_SECRET. ```text Call-Me webhook receiver listening on http://localhost:9099/webhooks/call-me Signature verification: enabled [2026-07-18T10:00:00.000Z] user.joined room=Support user=user1 [2026-07-18T10:00:05.000Z] user.joined room=Support user=user2 [2026-07-18T10:00:07.000Z] call.started room=Support caller=user1 callee=user2 [2026-07-18T10:02:29.000Z] call.ended room=Support caller=user1 callee=user2 duration=142s [2026-07-18T10:02:30.000Z] user.left room=Support user=user2 ``` -------------------------------- ### Install MkDocs using apt Source: https://docs.mirotalk.com/mirotalk-docs/self-hosting Install MkDocs using the apt package manager on Ubuntu. This method requires updating the package list first. ```bash sudo apt update sudo apt install mkdocs ``` -------------------------------- ### JavaScript Join Meeting Example Source: https://docs.mirotalk.com/mirotalk-sfu/api Demonstrates how to join a meeting room using the fetch API in JavaScript. ```javascript "use strict"; // npm i node-fetch try { // Use dynamic import with await const { default: fetch } = await import("node-fetch"); const API_KEY = "YOUR_API_KEY_SECRET"; const MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join"; const response = await fetch(MIROTALK_URL, { method: "POST", headers: { authorization: API_KEY, "Content-Type": "application/json", }, body: JSON.stringify({ room: "test", roomPassword: false, name: "mirotalksfu", avatar: false, // https://sfu.mirotalk.com/images/admin.png audio: false, video: false, chat: false, screen: false, hide: false, notify: true, duration: 'unlimited', // HH:MM:SS (e.g. 00:30:00) or unlimited // Token configuration is required if the host system is protected, user authentication is needed, or a room presenter is specified. token: { username: "username", password: "password", presenter: true, expire: "1h", }, }), }); const data = await response.json(); if (data.error) { console.log("Error:", data.error); } else { console.log("join:", data.join); } } catch (error) { console.error("Error fetching data:", error); } ``` -------------------------------- ### Install Nginx and Certbot Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Commands to install the Nginx web server and the Certbot tool for managing Let's Encrypt SSL certificates. ```bash sudo apt-get install -y nginx # Install Certbot (SSL certificates) sudo apt install -y snapd sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot ``` -------------------------------- ### Python Join Example Source: https://docs.mirotalk.com/mirotalk-c2c/api Python example to join a MiroTalk C2C room via the API. Requires the `requests` library and an API key secret. Replace `c2c.mirotalk.com` with your domain. ```python import requests import json API_KEY_SECRET = "YOUR_API_KEY_SECRET" MIROTALK_URL = "https://c2c.mirotalk.com/api/v1/join" headers = { "authorization": API_KEY_SECRET, "Content-Type": "application/json", } data = { "room": "test", "name": "mirotalkc2c", } response = requests.post( MIROTALK_URL, headers=headers, json=data, ) print("Status code:", response.status_code) data = json.loads(response.text) print("join:", data["join"]) ``` -------------------------------- ### Quick start: clone, build, and deploy MiroTalk docs Source: https://docs.mirotalk.com/mirotalk-docs/self-hosting Clone the MiroTalk docs repository, build the site with MkDocs, set ownership for the web server, and move the site to the web root. ```bash # Clone the repository git clone https://github.com/miroslavpejic85/mirotalk-docs.git # Navigate to the project directory cd mirotalk-docs # Build the site mkdocs build # Set proper ownership for the web server sudo chown -R www-data:www-data /root/mirotalk-docs/site # Move the site folder to the web root sudo mv /root/mirotalk-docs/site /var/www/ ``` -------------------------------- ### POST /meeting - Python Example Source: https://docs.mirotalk.com/mirotalk-p2p/api This Python example creates a new meeting using the requests library with a POST request. It checks for an error in the response and outputs the meeting or error message. ```python # pip3 install requests import requests import json API_KEY_SECRET = "YOUR_API_KEY_SECRET" MIROTALK_URL = "https://p2p.mirotalk.com/api/v1/meeting" headers = { "authorization": API_KEY_SECRET, "Content-Type": "application/json", } data = { # "expire": "1h", # "maxParticipants": 2, # "autoJoin": False, # "lockRoom": False, "meetingTitle": "MiroTalk P2P sample", } response = requests.post( MIROTALK_URL, headers=headers, json=data, ) if response.status_code == 200: meeting_data = response.json() if meeting_data.get("error"): print("Error:", meeting_data["error"]) else: print("Meeting:", meeting_data["meeting"]) else: print("Request failed with status code:", response.status_code) print("Error:", response.text) ``` -------------------------------- ### Install FFmpeg and MediaMTX on macOS Source: https://docs.mirotalk.com/mirotalk-bro/rtmp Installs FFmpeg and MediaMTX using Homebrew on macOS. ```bash brew install ffmpeg mediamtx ``` -------------------------------- ### PHP Join Meeting Example Source: https://docs.mirotalk.com/mirotalk-sfu/api Demonstrates how to join a meeting room using cURL in PHP. ```php "test", "roomPassword" => false, "name" => "mirotalksfu", "avatar" => false, // https://sfu.mirotalk.com/images/admin.png "audio" => false, "video" => false, "screen" => false, "chat" => false, "hide" => false, "notify" => true, "duration" => "unlimited", // HH:MM:SS (e.g. 00:30:00) or unlimited // Token configuration is required if the host system is protected, user authentication is needed, or a room presenter is specified "token" => array( "username" => "username", "password" => "password", "presenter" => true, "expire" => "1h", ), ); $data_string = json_encode($data); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); $response = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo "Status code: $httpcode \n"; $data = json_decode($response); echo "join: ", $data->{'join'}, "\n"; ``` -------------------------------- ### Prepare directories for Node Media Server Source: https://docs.mirotalk.com/mirotalk-sfu/rtmp Create the app/rtmp directory and navigate to the node-media-server directory. ```Bash mkdir -p app/rtmp cd rtmpServers/node-media-server ``` -------------------------------- ### GET /api/v1/vapidPublicKey - Bash Example Source: https://docs.mirotalk.com/mirotalk-cme/api Bash example using curl to retrieve the public VAPID key. This endpoint does not require the API secret. ```Bash #!/bin/bash url="https://YOUR-DOMAIN-NAME/api/v1/vapidPublicKey" curl -s -X GET "$url" -H "Content-Type: application/json" ``` -------------------------------- ### Prepare Nginx RTMP directories Source: https://docs.mirotalk.com/mirotalk-sfu/rtmp Create app/rtmp and navigate to the nginx-rtmp directory. ```Bash mkdir -p app/rtmp cd rtmpServers/nginx-rtmp ``` -------------------------------- ### GET /stats PHP Example Source: https://docs.mirotalk.com/mirotalk-cme/api Fetches server statistics using the cURL library in PHP. ```php ``` -------------------------------- ### Bash Join Example Source: https://docs.mirotalk.com/mirotalk-c2c/api Bash example to join a MiroTalk C2C room using curl. Requires an API key secret. Replace `c2c.mirotalk.com` with your domain. ```bash #!/bin/bash API_KEY_SECRET="YOUR_API_KEY_SECRET" MIROTALK_URL="https://c2c.mirotalk.com/api/v1/join" curl $MIROTALK_URL \ --header "authorization: $API_KEY_SECRET" \ --header "Content-Type: application/json" \ --data '{"room":"test","name":"mirotalkc2c"}' \ --request POST ``` -------------------------------- ### GET /api/v1/rooms - PHP Example Source: https://docs.mirotalk.com/mirotalk-cme/api PHP example using cURL to list active rooms with user counts and active call counts. Requires the API key secret in the Authorization header. ```PHP ``` -------------------------------- ### Configure .env File Source: https://docs.mirotalk.com/mirotalk-sfu/self-hosting Example configuration for the .env file. Ensure SFU_ANNOUNCED_IP is set to your server's public IP or domain. ```bash ENVIRONMENT=production SFU_ANNOUNCED_IP=Your-Server-Public-IPv4-or-Domain SFU_MIN_PORT=40000 SFU_MAX_PORT=40100 # With 40000-40100 (~100 ports), supports about ~50 participants SFU_NUM_WORKERS=4 # Optional: if unset, defaults to CPU core count (`nproc`) ``` -------------------------------- ### Update docker-compose to latest version on Linux Source: https://docs.mirotalk.com/utility/docker-compose Removes the existing docker-compose installation, downloads the latest version (v5.4.0 in this example) for Linux x86_64, makes it executable, moves it to /usr/bin, and verifies the installed version. ```bash # Remove any existing installation of docker-compose sudo apt remove docker-compose # Download the latest version of docker-compose (v5.4.0 in this case) for Linux (x86_64 architecture) wget https://github.com/docker/compose/releases/download/v5.4.0/docker-compose-linux-x86_64 # Make the downloaded docker-compose file executable chmod +x docker-compose-linux-x86_64 # Move the docker-compose binary to /usr/bin to make it globally accessible sudo mv docker-compose-linux-x86_64 /usr/bin/docker-compose # Verify the installed version of docker-compose docker-compose --version ``` -------------------------------- ### GET /meetings - Bash Example Source: https://docs.mirotalk.com/mirotalk-p2p/api This Bash script uses curl to send a GET request to the meetings endpoint, including the API key secret and content type headers. It outputs the raw response. ```bash #!/bin/bash API_KEY_SECRET="YOUR_API_KEY_SECRET" MIROTALK_URL="https://p2p.mirotalk.com/api/v1/meetings" curl $MIROTALK_URL \ --header "authorization: $API_KEY_SECRET" \ --header "Content-Type: application/json" \ --request GET ``` -------------------------------- ### Docker Compose Configuration Source: https://docs.mirotalk.com/mirotalk-bro/self-hosting Example configuration for docker-compose.yml defining the service, ports, and volume mappings. ```yaml services: mirotalkbro: image: mirotalk/bro:latest container_name: mirotalkbro hostname: mirotalkbro user: '1000:1000' restart: unless-stopped ports: - '${PORT}:${PORT}' - '${MEDIASOUP_RTC_MIN_PORT}-${MEDIASOUP_RTC_MAX_PORT}:${MEDIASOUP_RTC_MIN_PORT}-${MEDIASOUP_RTC_MAX_PORT}/udp' - '${MEDIASOUP_RTC_MIN_PORT}-${MEDIASOUP_RTC_MAX_PORT}:${MEDIASOUP_RTC_MIN_PORT}-${MEDIASOUP_RTC_MAX_PORT}/tcp' volumes: - .env:/src/.env:ro - ./app/:/src/app/:ro - ./public/:/src/public/:ro ``` -------------------------------- ### Configure Node Media Server files Source: https://docs.mirotalk.com/mirotalk-sfu/rtmp Copy configuration templates to create config.js and docker-compose.yml. ```Bash cp src/config.template.js src/config.js cp docker-compose.template.yml docker-compose.yml ``` -------------------------------- ### Python GET /meetings request Source: https://docs.mirotalk.com/mirotalk-sfu/api Retrieves a list of meetings using the requests library. Requires the requests package to be installed. ```python import requests import json API_KEY_SECRET = "YOUR_API_KEY_SECRET" MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/meetings" headers = { "authorization": API_KEY_SECRET, "Content-Type": "application/json", } response = requests.get( MIROTALK_URL, headers=headers ) print("Status code:", response.status_code) if response.status_code == 200: data = response.json() pretty_printed_data = json.dumps(data, indent=4) print(data) else: print("Failed to retrieve data. Error:", response.text) ``` -------------------------------- ### Python: Create a meeting with POST /meeting Source: https://docs.mirotalk.com/mirotalk-c2c/api Python example for creating a meeting via the POST /meeting endpoint. The code is incomplete in the source, showing only the opening lines. ```Python ``` -------------------------------- ### Run example webhook receiver server Source: https://docs.mirotalk.com/mirotalk-cme/webhook Run the dependency-free Node.js server from the project root. The first command runs without signature verification; the second enables it by setting WEBHOOK_SECRET to match Call-Me's secret. ```bash # From the project root (no npm install needed) node webhook/server.js # Or with signature verification (must match Call-Me's WEBHOOK_SECRET) WEBHOOK_SECRET='your-shared-secret' node webhook/server.js ``` -------------------------------- ### Prepare environment files for Docker Source: https://docs.mirotalk.com/mirotalk-admin/quick-start Clones the repository and copies configuration templates including docker-compose.yml. ```bash git clone https://github.com/miroslavpejic85/mirotalk-admin.git cd mirotalk-admin cp backend/config/index.template.js backend/config/index.js cp .env.template .env cp docker-compose.template.yml docker-compose.yml ``` -------------------------------- ### Python Join Example Source: https://docs.mirotalk.com/mirotalk-sfu/api Uses the requests library to POST to the /api/v1/join endpoint. Requires pip install requests. The response contains a 'join' field with the meeting URL. ```Python # pip3 install requests import requests import json API_KEY_SECRET = "YOUR_API_KEY_SECRET" MIROTALK_URL = "https://sfu.mirotalk.com/api/v1/join" headers = { "authorization": API_KEY_SECRET, "Content-Type": "application/json", } data = { "room": "test", "roomPassword": "false", "name": "mirotalksfu", "avatar": "false", # https://sfu.mirotalk.com/images/admin.png "audio": "false", "video": "false", "screen": "false", "chat": "false", "hide": "false", "notify": "true", "duration": "unlimited", # HH:MM:SS (e.g. 00:30:00) or unlimited # Token configuration is required if the host system is protected, user authentication is needed, or a room presenter is specified "token": { "username": "username", "password": "password", "presenter": "true", "expire": "1h", } } response = requests.post( MIROTALK_URL, headers=headers, json=data, ) print("Status code:", response.status_code) data = json.loads(response.text) print("join:", data["join"]) ``` -------------------------------- ### Configure Ngrok in .env file Source: https://docs.mirotalk.com/mirotalk-bro/ngrok Sets NGROK_ENABLED to true and specifies the Ngrok authentication token. Replace 'YourNgrokAuthToken' with your actual token. ```bash NGROK_ENABLED=true NGROK_AUTH_TOKEN=YourNgrokAuthToken ``` -------------------------------- ### Install PM2 Source: https://docs.mirotalk.com/mirotalk-web/self-hosting Command to install PM2 process manager. ```bash npm install pm2 -g ``` -------------------------------- ### Install MiroTalk dependencies Source: https://docs.mirotalk.com/mirotalk-bro/rtmp Installs npm dependencies for the MiroTalk project. ```bash npm install ```