This repository contains a Docker-based setup for deploying LiveKit Server on Render. LiveKit is an open-source WebRTC server for real-time audio, video, and data communication.
Dockerfile: Defines the Docker image for LiveKit Server using the officiallivekit/livekit-server:latestimage.livekit.yaml: Configuration file for LiveKit Server, using environment variables for sensitive data.render.yaml: Render blueprint file defining the deployment configuration, environment variables, and ports.
- A Render account
- API keys from LiveKit (get them from LiveKit Cloud or generate your own)
- A Redis instance (Render provides managed Redis)
- A TURN/STUN server (you can deploy coturn on Render or use a managed provider)
-
Clone or fork this repository to your GitHub account.
-
Update
render.yaml:- Replace placeholder values with your actual credentials:
LIVEKIT_API_KEY: Your LiveKit API keyLIVEKIT_API_SECRET: Your LiveKit API secretLIVEKIT_REDIS_ADDRESS: Redis connection URL (e.g.,redis://your-redis-instance:6379)LIVEKIT_REDIS_PASSWORD: Redis passwordLIVEKIT_TURN_HOST: TURN server hostnameLIVEKIT_TURN_PORT: TURN server port (default: 3478)LIVEKIT_TURN_USERNAME: TURN usernameLIVEKIT_TURN_PASSWORD: TURN password
- Replace placeholder values with your actual credentials:
-
Set up Redis on Render:
- Create a new Redis service in your Render dashboard.
- Note the connection URL and password.
-
Set up TURN/STUN:
- Deploy a TURN server (e.g., coturn) as a separate Render service, or use a managed provider like Twilio TURN.
- Configure the credentials in
render.yaml.
-
Deploy on Render:
- Connect your GitHub repository to Render.
- Render will automatically build and deploy using the
render.yamlblueprint. - The service will be available at the generated URL (e.g.,
https://livekit-server.onrender.com).
Once deployed, your LiveKit Server will be running on port 7880 (signaling) and 5349 (TURN).
Use the LiveKit SDKs to connect to your server:
import { Room } from 'livekit-client';
const room = new Room();
await room.connect('wss://your-render-url.onrender.com', token);Generate tokens using your API key and secret. See the LiveKit documentation for details.
- Signaling:
wss://your-render-url.onrender.com - TURN: Configured via environment variables
The livekit.yaml file uses environment variables for configuration. Key settings include:
- API keys for authentication
- Redis for clustering and state management
- TURN/STUN for NAT traversal
- Room limits and timeouts
- WebRTC ICE servers
Refer to the LiveKit Server Configuration for all options.
Render automatically scales your service based on the plan. For high concurrency:
- Use a higher Render plan
- Ensure Redis is properly configured for clustering
- Monitor TURN server capacity
- Check Render logs for deployment issues
- Verify environment variables are set correctly
- Ensure Redis and TURN services are accessible
- Test connectivity using LiveKit's health check endpoint
- Never commit actual API keys or secrets to the repository
- Use Render's environment variable management for sensitive data
- Enable TLS (Render provides free SSL certificates)
- Regularly rotate API keys and TURN credentials
Feel free to submit issues or pull requests to improve this setup.
This setup uses the LiveKit Server, which is open-source. Check LiveKit's licensing for details.