magnificent-jelly-58282
10/31/2025, 5:25 AMtall-airline-16756
10/31/2025, 5:25 AMtall-airline-16756
10/31/2025, 5:27 AMcloud-init or init_script.sh methods handy for this setup.
• Double-check that the server is accessible through its URL and that you have your API key and secret on hand.
2. Prepare the Agent
• Create an environment configuration file (like a .env) including these details: LIVEKIT_URL=wss://your-domain.com
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret
• Make sure your agent code is all set to connect to the LiveKit server. For instance, if you’re using Python, you can start it with: python main.py dev
3. Deploy the Agent
• Transfer your agent code over to the VM using tools like SCP or Git.
• Run the agent on the VM, making sure it connects smoothly to the LiveKit server with the credentials you’ve provided.
If you have any questions along the way or need help with things like scaling multiple agents, please don’t hesitate to reach out—I’m here to help!
Sources: Deploy to a VM | LiveKit docs | An open source stack for real-time multimodal AI | Deploying to production | LiveKit Docs | README.md | cmd/lk/agent.gomagnificent-jelly-58282
10/31/2025, 5:32 AMtall-airline-16756
10/31/2025, 5:33 AMlk agent create and lk agent deploy commands are tailored specifically for LiveKit Cloud deployments, so they won’t work with self-hosted LiveKit servers. These commands connect directly with LiveKit's cloud infrastructure to manage agents, which doesn’t apply to self-hosted setups.
For self-hosted servers, you’ll need to deploy and manage agents manually, usually using tools like Docker or Kubernetes. This means setting up the agent’s environment configuration yourself and running it on your own infrastructure.
If you'd like, I’m here to help guide you through deploying agents manually or creating a custom workflow that fits your needs—just let me know!
Sources: livekit/livekit_composite | DeepWiki | livekit/livekit_composite | DeepWiki | CLI Tools & Token Management | livekit/livekit_composite | DeepWiki | LiveKit Pricing | cmd/lk/agent.gomagnificent-jelly-58282
10/31/2025, 5:44 AMtall-airline-16756
10/31/2025, 5:44 AMscp, rsync, or Git—whichever feels easiest for you.
2. Configure the Agent
• Once you're on the VM, create an .env file inside the agent directory with these details: LIVEKIT_URL=wss://your-domain.com
LIVEKIT_API_KEY=your_api_key
LIVEKIT_API_SECRET=your_api_secret
3. Install Dependencies
• Head over to the agent directory on the VM.
• If you're using a Python agent, it’s a good idea to create a virtual environment and then run: pip install -r requirements.txt
4. Run the Agent
• Now, start the agent with this command: python main.py dev
• This will connect your agent to your self-hosted LiveKit server smoothly.
5. Networking
• Make sure the VM’s firewall is set to allow traffic on the necessary ports (like port 7880 for signaling and UDP ports for media).
If you run into any bumps or have questions along the way, please don’t hesitate to reach out—I’m here to help!
Sources: README.md | README.md | Running LiveKit locally | LiveKit Docs | Self-hosted SIP server | LiveKit docs | OpenAI and LiveKit partner to turn Advanced Voice into an API