straight-jelly-92105
11/01/2025, 3:25 PMtall-airline-16756
11/01/2025, 3:26 PMtall-airline-16756
11/01/2025, 3:26 PMport option in WorkerOptions. This keeps everything nicely organized.
2. Kill Conflicting Processes: Sometimes, another process might be using that port. On Linux or macOS, you can find it with lsof -i :8081 or netstat -tulpn | grep 8081, and then stop it using kill <pid>. This frees up the port for your worker.
3. Use Dynamic Port Assignment: For development purposes, setting the port to 0 lets your operating system pick an available port automatically, which can save you some hassle.
4. Graceful Shutdown: Make sure your workers shut down properly by calling worker.close() in your shutdown routine. This helps release the port cleanly so it’s ready to use next time.
5. Check for Duplicate Workers: Double-check that you’re not accidentally starting multiple workers on the same port at the same time — that’s a common cause of this error.
6. Container Environments: If you’re using Docker or Kubernetes, ensure each worker has its own unique or dynamically assigned HTTP port to avoid conflicts.
I hope these tips help you resolve the issue! If you run into any trouble or have more questions, please don’t hesitate to reach out — I’m happy to assist you further.
Sources: Deploying to custom environments | LiveKit Docs | livekit-agents/livekit/agents/worker.py | agents/src/http_server.tsstraight-jelly-92105
11/01/2025, 3:29 PMtall-airline-16756
11/01/2025, 3:29 PMport value in the WorkerOptions for each agent.
If you're working with containerized setups like Docker or Kubernetes, there's some handy flexibility—you can assign ports dynamically or let orchestration tools handle the port assignments for you automatically.
Feel free to reach out if you'd like a hand with setting this up—I’m here to help!