Skip to content

Deploying MiroTalk C2C

Introduction

MiroTalk C2C (Cam-to-Cam) is a free, open-source WebRTC-based video chat application designed specifically for one-on-one video conversations. Built with simplicity in mind, C2C enables direct peer-to-peer video calls without the complexity of room management or multi-participant features, making it perfect for private consultations, tutoring sessions, or personal video calls.

The application leverages WebRTC technology for real-time communication, establishing direct connections between participants for optimal latency and privacy. MiroTalk C2C requires no downloads or plugins—users simply share a link and connect through their web browser.

Key highlights of MiroTalk C2C:

  • Peer-to-Peer Architecture: Direct connections between participants for low latency and enhanced privacy
  • No Account Required: Start video calls instantly without registration or sign-up
  • Browser-Based: Works on any modern browser without plugins or downloads
  • End-to-End Encryption: WebRTC’s built-in encryption protects your conversations
  • Screen Sharing: Share your screen during calls for presentations or collaboration
  • Text Chat: Built-in messaging for sharing links and notes during calls
  • Mobile Friendly: Responsive design works on smartphones and tablets
  • Recording: Record video calls locally to your device
  • Customizable: Brand with your own logo and colors
  • Self-Hosted: Full control over your video communication infrastructure

This guide walks through deploying MiroTalk C2C on Klutch.sh using Docker, configuring TURN servers for reliable connectivity, and customizing the application for your needs.

Why Deploy MiroTalk C2C on Klutch.sh

Deploying MiroTalk C2C on Klutch.sh provides several advantages:

Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds MiroTalk C2C without manual server configuration. Push to GitHub, and your video chat service deploys automatically.

HTTPS by Default: WebRTC requires secure contexts. Klutch.sh provides automatic SSL certificates, ensuring your video chat works properly across all browsers.

GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.

Scalable Resources: Allocate CPU and memory based on expected concurrent calls. The signaling server is lightweight, but you can scale as needed.

Environment Variable Management: Securely store TURN server credentials and other sensitive configuration through Klutch.sh’s environment variable system.

Custom Domains: Assign a professional custom domain for your video chat service, perfect for business or consultancy use.

Always-On Availability: Your video chat service remains accessible 24/7 without managing your own infrastructure.

Prerequisites

Before deploying MiroTalk C2C on Klutch.sh, ensure you have:

  • A Klutch.sh account
  • A GitHub account with a repository for your configuration
  • Basic familiarity with Docker and containerization concepts
  • (Optional) TURN server credentials for reliable NAT traversal
  • (Optional) A custom domain for your MiroTalk C2C instance

Understanding WebRTC Architecture

MiroTalk C2C uses WebRTC for real-time communication:

Signaling Server: The Node.js application handles initial connection setup, exchanging session descriptions and ICE candidates between peers.

STUN Servers: Help peers discover their public IP addresses for direct connections. Google’s public STUN servers are used by default.

TURN Servers: Relay traffic when direct peer-to-peer connections fail due to restrictive NATs or firewalls. Optional but recommended for reliability.

Media Streams: Once connected, video and audio flow directly between peers without passing through the server.

Preparing Your Repository

Repository Structure

mirotalk-c2c-deploy/
├── Dockerfile
├── README.md
└── .dockerignore

Creating the Dockerfile

Create a Dockerfile in the root of your repository:

FROM mirotalk/c2c:latest
# Environment variables for configuration
ENV HTTPS=false
ENV HOST=0.0.0.0
ENV PORT=8080
ENV API_KEY_SECRET=${API_KEY_SECRET}
# TURN server configuration (optional but recommended)
ENV TURN_ENABLED=${TURN_ENABLED:-false}
ENV TURN_URLS=${TURN_URLS}
ENV TURN_USERNAME=${TURN_USERNAME}
ENV TURN_CREDENTIAL=${TURN_CREDENTIAL}
# Expose the application port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD curl -f http://localhost:8080/ || exit 1

Environment Variables Reference

VariableRequiredDefaultDescription
API_KEY_SECRETNo-API key for protected endpoints
TURN_ENABLEDNofalseEnable TURN server support
TURN_URLSNo-TURN server URLs (e.g., turn:turn.example.com:3478)
TURN_USERNAMENo-TURN server username
TURN_CREDENTIALNo-TURN server password

Deploying MiroTalk C2C on Klutch.sh

    Generate API Key (Optional)

    If you want to protect API endpoints:

    Terminal window
    openssl rand -hex 32

    Push Your Repository to GitHub

    Terminal window
    git init
    git add Dockerfile .dockerignore README.md
    git commit -m "Initial MiroTalk C2C deployment"
    git remote add origin https://github.com/yourusername/mirotalk-c2c-deploy.git
    git push -u origin main

    Create a New Project on Klutch.sh

    Navigate to the Klutch.sh dashboard and create a new project named “mirotalk-c2c” or “video-chat”.

    Create a New App

    Within your project, create a new app and connect your GitHub repository containing the Dockerfile.

    Configure HTTP Traffic

    In the deployment settings:

    • Select HTTP as the traffic type
    • Set the internal port to 8080

    Set Environment Variables

    Configure your environment variables:

    VariableValue
    API_KEY_SECRETYour generated API key (optional)
    TURN_ENABLEDtrue if using TURN servers
    TURN_URLSYour TURN server URL
    TURN_USERNAMEYour TURN username
    TURN_CREDENTIALYour TURN password

    Deploy Your Application

    Click Deploy to start the build process. Klutch.sh will build the container and provision HTTPS.

    Access MiroTalk C2C

    Once deployment completes, access your video chat at https://your-app-name.klutch.sh.

Using MiroTalk C2C

Starting a Call

  1. Navigate to your MiroTalk C2C URL
  2. Click Start to create a new call
  3. Share the generated link with your call partner
  4. When they join, the video call begins automatically

Call Features

During a call, you can:

  • Toggle Video/Audio: Mute microphone or disable camera
  • Screen Share: Share your screen or application window
  • Text Chat: Send messages without interrupting the call
  • Record: Save the call locally to your device
  • Settings: Adjust video quality and audio devices

TURN Server Configuration

For reliable connectivity across different networks, configure a TURN server:

Using a Public TURN Service

Services like Metered TURN offer free tiers:

TURN_ENABLED=true
TURN_URLS=turn:global.relay.metered.ca:80
TURN_USERNAME=your-username
TURN_CREDENTIAL=your-credential

Self-Hosted TURN

For maximum privacy, deploy your own TURN server using coturn.

Customization

Branding

Customize the appearance by modifying:

  • Logo and favicon
  • Color scheme
  • Welcome message
  • Footer text

API Integration

Use the API to create calls programmatically:

// Generate a call link via API
fetch('https://your-c2c.klutch.sh/api/v1/meeting', {
method: 'POST',
headers: {
'Authorization': 'your-api-key',
'Content-Type': 'application/json'
}
});

Troubleshooting

Video Not Connecting

  • Ensure HTTPS is working (required for WebRTC)
  • Check browser permissions for camera/microphone
  • Configure TURN servers for restrictive networks

Poor Video Quality

  • Check network bandwidth
  • Reduce video resolution in settings
  • Use wired connection when possible

Connection Drops

  • TURN servers help maintain connections
  • Check for network instability
  • Try different browsers

Additional Resources

Conclusion

Deploying MiroTalk C2C on Klutch.sh provides a private, self-hosted video chat solution perfect for one-on-one conversations. With automatic HTTPS, simple deployment, and WebRTC’s peer-to-peer architecture, you can offer secure video calling without depending on third-party services. Whether for personal use, tutoring, consultations, or customer support, MiroTalk C2C delivers reliable video communication under your control.