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 repo
$ git clone https://github.com/miroslavpejic85/mirotalk-docs.git

# Go to Docs dir
$ cd mirotalk-docs

# Start to build site
$ mkdocs build

# Enable a web server to access and serve files from that directory
$ sudo chown -R www-data:www-data /root/mirotalk-docs/site

# Move the site folder in /var/www/
$ sudo mv /root/mirotalk-docs/site /var/www/

Configuring Nginx & Certbot

nginx

In order to have encrypted communications (https), we going to 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 instruction)
$ 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;

    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

# 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

    <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