How to self host the livekit server, SIP server an...
# ask-ai
m
How to self host the livekit server, SIP server and host my agents on there? Where can i get a detailed step by step guide?
t
Thanks for reaching out, Milind. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you get started with self-hosting the LiveKit server, SIP server, and agents. Let’s walk through the steps together: 1. Self-host LiveKit Server • First, download the latest release from GitHub or grab the pre-built binaries that match your platform. • Run the server using
livekit-server
. To make sure it’s accessible on your network, bind it to
0.0.0.0
by adding
--bind 0.0.0.0
. • For a production setup, you’ll want to set up TLS, clustering, and Redis. You can find all the details in the deployment guide. If you need any tips on this, just ask! 2. Self-host SIP Server • Using Docker Compose can make this easier. Here’s an example configuration for you:
Copy code
version: '3'
services:
  livekit:
    image: livekit/livekit-server
    ports:
      - "7880:7880"
    environment:
      - LIVEKIT_KEYS=devkey:secret
      - REDIS_ADDRESS=redis:6379
  sip:
    image: livekit/sip
    ports:
      - "5060:5060/udp"
      - "10000-20000:10000-20000/udp"
    environment:
      - SIP_CONFIG_BODY={...}
    depends_on:
      - redis
  redis:
    image: redis:6
• If you prefer, you can install and run the SIP server directly on your machine. Just configure
config.yaml
with your API key, secret, and Redis details, then start it with
sip --config=config.yaml
. Feel free to reach out if you want help setting this up! 3. Self-host Agents • Make sure you have Node.js (v20 or higher) installed, then clone the example repository like this:
git clone https://github.com/livekit-examples/node-agents-examples.git
• Next, configure your environment variables in
.env.local
(things like your API key, secret, and SIP URI). • Finally, run the agent using
npm run agent
. The agent will automatically join rooms whenever a SIP call comes in. Don’t forget to check your firewall and TLS settings for a smooth and secure production environment. If you hit any bumps or want to dive deeper into specific configurations, I’m here to guide you every step of the way! Sources: Running LiveKit locally | LiveKit Docs | Self-hosted SIP server | LiveKit docs | README.md | packages/sip--um-actually/README.md