i have a very critical question, is it necessary t...
# ask-ai
p
i have a very critical question, is it necessary to have a public domain for WebRTC and SIP? is there any way to use it without a public domain?
t
Thanks for reaching out, Yasser. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To keep your WebRTC and SIP deployments with LiveKit secure, having a public domain is really important. This is because a domain with a valid SSL certificate from a trusted authority is needed to ensure safe communication. Think of the domain as the main address your LiveKit SDKs connect to (like
wss://livekit.yourhost.com
), which helps set up those secure WebSocket connections for signaling. Now, while you might technically get LiveKit running without a public domain in some limited local or development setups, it won’t support the secure, production-ready WebRTC or SIP features. That’s because trusted SSL certificates aren’t available for private or local addresses. Plus, many corporate firewalls expect traffic to go through recognized domains and ports for WebRTC. If you want to chat more about this or need a hand setting up your public domain, just let me know—I’m here to help! Sources: Deploying LiveKit | LiveKit Docs | Configuring firewalls | LiveKit Docs
p
so technically it is possible to run both sip server and web rtc using only a public ip of the vm
t
Yes, you can definitely run both a SIP server and WebRTC using just the public IP address of your VM. For WebRTC, you’d just need to set
use_external_ip: true
in the
rtc
section of your LiveKit configuration. This way, LiveKit uses STUN to find and share the public IP for ICE connections, making things smoother. For SIP, your server can also share its public IP so remote SIP peers can connect easily. The SIP URI would use the public IP and the SIP port (like
<public-ip-address>:5060
). Again, setting
use_external_ip: true
makes sure the SIP server advertises the right IP. That said, while this setup works great for testing or smaller projects, I’d recommend using a domain name for secure, production-ready deployments—especially if you want SSL certificates for WebSocket connections. It helps keep everything safe and sound. Sources: config-sample.yaml | Self-hosting the Ingress Service | LiveKit Docs | test/integration/livekit_test.go | Self-hosted SIP server | LiveKit Docs | Deploying LiveKit | LiveKit Docs
p
this will work without any domain required?
t
Yes, you can definitely use this setup without a domain! Just use the public IP address of your VM for both WebRTC and SIP. That said, this method is usually best for testing or non-production use since it doesn’t support secure communication with SSL certificates, which need a domain. If you’re thinking about using this in a live environment, I’d suggest setting up a domain to keep things more secure and compatible. Let me know if you need a hand with that!
p
with you suggest using a domain? if it will work without a domain? and regarding the SSL is it the only way for security? is there any work arounds?
t
Hey there! While you can technically run LiveKit without a domain, I really recommend using one for a secure setup. SSL/TLS is super important for keeping WebRTC and SIP signaling safe, as it makes sure your WebSocket connections and SIP trunking are secure. Without a domain, getting a trusted SSL certificate isn’t possible, and that’s key for production-level security. There aren’t any official workarounds for using LiveKit in production without a domain. You might find some temporary options, like allowing cleartext traffic, but those are really just for development and aren’t secure enough for real use. Also, LiveKit does offer end-to-end encryption (E2EE) for media tracks, which is great, but it works alongside TLS—it doesn’t replace it. If you want, I’m here to help you set up a domain or get an SSL certificate—just give me a shout, and we’ll get it sorted together! Sources: Deploying LiveKit | LiveKit Docs | Configuring firewalls | LiveKit Docs | Deploying LiveKit | LiveKit Docs | app/src/debug/res/xml/network_security_config.xml | End-to-end encryption | LiveKit Docs