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└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM mirotalk/c2c:latest
# Environment variables for configurationENV HTTPS=falseENV HOST=0.0.0.0ENV PORT=8080ENV 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 portEXPOSE 8080
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD curl -f http://localhost:8080/ || exit 1Environment Variables Reference
| Variable | Required | Default | Description |
|---|---|---|---|
API_KEY_SECRET | No | - | API key for protected endpoints |
TURN_ENABLED | No | false | Enable TURN server support |
TURN_URLS | No | - | TURN server URLs (e.g., turn:turn.example.com:3478) |
TURN_USERNAME | No | - | TURN server username |
TURN_CREDENTIAL | No | - | TURN server password |
Deploying MiroTalk C2C on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 8080
Generate API Key (Optional)
If you want to protect API endpoints:
openssl rand -hex 32Push Your Repository to GitHub
git initgit add Dockerfile .dockerignore README.mdgit commit -m "Initial MiroTalk C2C deployment"git remote add origin https://github.com/yourusername/mirotalk-c2c-deploy.gitgit push -u origin mainCreate 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:
Set Environment Variables
Configure your environment variables:
| Variable | Value |
|---|---|
API_KEY_SECRET | Your generated API key (optional) |
TURN_ENABLED | true if using TURN servers |
TURN_URLS | Your TURN server URL |
TURN_USERNAME | Your TURN username |
TURN_CREDENTIAL | Your 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
- Navigate to your MiroTalk C2C URL
- Click Start to create a new call
- Share the generated link with your call partner
- 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=trueTURN_URLS=turn:global.relay.metered.ca:80TURN_USERNAME=your-usernameTURN_CREDENTIAL=your-credentialSelf-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 APIfetch('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
- MiroTalk C2C GitHub Repository
- MiroTalk C2C Demo
- WebRTC Official Documentation
- Klutch.sh Deployments
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.