Skip to content

MiroTalk DOCS - Self Hosting

docs

Description

Welcome to the MiroTalk documentation hub! Here you'll find comprehensive guides and references for all MiroTalk projects, including P2P, SFU, C2C, BRO, WEB, and more. This documentation covers everything you need for self-hosting, integration, configuration, scaling, security, and advanced features.

Whether you're deploying a simple peer-to-peer video call, scaling up with SFU for large meetings, enabling live broadcasts, or embedding widgets, these docs provide step-by-step instructions, best practices, and troubleshooting tips for every scenario.

Explore the sections relevant to your use case and enjoy full control over your real-time communication platform!

Live demo: https://docs.mirotalk.com

Requirements

  • Server Selection:
  • OS: Ubuntu 22.04 LTS.
  • Mandatory MkDocs
  • Domain or Subdomain Name (e.g., YOUR.DOMAIN.NAME) with a DNS A record pointing to your server's IPv4 address.

Installation

To install MkDocs, you can use one of this method:

Using pip

Bash
pip install mkdocs

Using apt

Bash
sudo apt update
sudo apt install mkdocs

Using snap

Bash
sudo apt update
sudo apt install snapd
sudo snap install mkdocs

Quick start

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/

Configuring Nginx & Certbot

nginx

To serve the documentation with encrypted communications (HTTPS), install Nginx and Certbot:

Bash
# Install Nginx
sudo apt-get install nginx

# Install Certbot (SSL certificates)
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

# Configure Nginx
sudo vim /etc/nginx/sites-enabled/default

Add the following:

Bash
# HTTP — redirect all traffic to HTTPS
server {
    listen 80;
    listen [::]:80;
    server_name YOUR.DOMAIN.NAME;

    return 301 https://$host$request_uri;
}
Bash
# Test Nginx configuration
sudo nginx -t

# Enable HTTPS with Certbot (follow the prompts)
sudo certbot certonly --nginx

# Add Let's Encrypt configuration to Nginx
sudo vim /etc/nginx/sites-enabled/default

Add the following:

Bash
# MiroTalk DOCS - HTTPS — proxy all requests to the Node app
server {
    # Enable HTTP/2
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name YOUR.DOMAIN.NAME;

    # Use the Let’s Encrypt certificates
    ssl_certificate /etc/letsencrypt/live/YOUR.DOMAIN.NAME/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/YOUR.DOMAIN.NAME/privkey.pem;

    # Directory where the website is located
    root /var/www/site;
    index index.html;

    # Disable caching for HTML files to always serve the latest content
    location ~* \.html$ {
        add_header Cache-Control "no-cache, no-store, must-revalidate";
        add_header Pragma "no-cache";
        add_header Expires "0";
        try_files $uri $uri/ =404;
    }

    location / {
        try_files $uri $uri/ =404;
    }
}
Bash
# Test Nginx configuration again
sudo nginx -t

# Restart nginx
service nginx restart
service nginx status

# Set up auto-renewal for SSL certificates
sudo certbot renew --dry-run --cert-name YOUR.DOMAIN.NAME

# Show certificates
sudo certbot certificates

Check Your MiroTalk DOCS instance: https://YOUR.DOMAIN.NAME


Apache Virtual Host (Alternative to Nginx)

apache

If you prefer Apache, configure it with the equivalent settings provided in this guide.

Bash
# Edit the apache sites
vim /etc/apache2/sites-enabled/YOUR.DOMAIN.NAME.conf

Add the following:

Bash
# HTTP — redirect all traffic to HTTPS
<VirtualHost *:80>
    ServerName YOUR.DOMAIN.NAME
    Redirect permanent / https://YOUR.DOMAIN.NAME
</VirtualHost>

# MiroTalk DOCS - HTTPS — proxy all requests to the site Dir
<VirtualHost *:443>
    ServerName YOUR.DOMAIN.NAME

    # SSL Configuration
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/YOUR.DOMAIN.NAME/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/YOUR.DOMAIN.NAME/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf

    # Enable HTTP/2 support
    Protocols h2 http/1.1

    DirectoryIndex index.html

    <Directory "/var/www/site">
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorDocument 404 /404.html

    # Disable caching for HTML files to always serve the latest content
    <FilesMatch "\.html$">
        Header set Cache-Control "no-cache, no-store, must-revalidate"
        Header set Pragma "no-cache"
        Header set Expires "0"
    </FilesMatch>

    <Location />
        Options FollowSymLinks
        AllowOverride All
    </Location>
</VirtualHost>

Updating Your Instance

To keep your MiroTalk DOCS instance up to date, create an update script:

Bash
cd
# Create a file docsUpdate.sh
vim docsUpdate.sh

Add the following:

Bash
#!/bin/bash

cd mirotalk-docs
git pull
mkdocs build
sudo chown -R www-data:www-data /root/mirotalk-docs/site
sudo rm -r /var/www/site/*
sudo mv /root/mirotalk-docs/site /var/www/

Make the script executable

Bash
chmod +x docsUpdate.sh

To update your MiroTalk DOCS instance to the latest version, run the script:

Bash
./docsUpdate.sh

Changelogs

Stay informed about project updates by following the commits of the MiroTalk DOCS project here