1.3 KiB
1.3 KiB
CoTURN Setup Guide
Set up CoTURN with Docker for NAT traversal and media relay in WebRTC applications.
Installation Steps
1. Prepare Docker Compose
- Copy the template:
cp docker-compose.template.yml docker-compose.yml - Edit
docker-compose.ymlto fit your environment. - Use Let's Encrypt and Certbot for SSL certificates. Replace
YOUR.DOMAINindocker-compose.ymlwith your actual domain name.- Learn more about Let's Encrypt: Click here.
- Learn more about Certbot: Click here.
2. Configure TURN Server
-
Copy the template:
cp turnserver.template.conf turnserver.conf -
Edit
turnserver.conf:- Replace
YOUR.DOMAIN.NAMEwith your domain. - Replace
YOUR.USERNAMEandYOUR.PASSWORDwith your credentials.
Example:
server-name=example.com realm=example.com user=username:password - Replace
3. Verify Files
Ensure turnserver.conf and docker-compose.yml are in the same directory.
4. Start the Server
Run:
docker-compose up -d
5. Check Logs (Optional)
Check logs to verify the server:
docker-compose logs -f
Notes
- Open ports (e.g., 3478, 5349 for TURN) on your firewall.
- Use secure credentials.
- Test with a WebRTC application.