---
title: "Deploy LiveKit - Voice Agent"
description: "Deploy and Host LiveKit with Railway"
category: "AI/ML"
url: https://railway.com/deploy/livekit
---

# Deploy LiveKit - Voice Agent

Deploy and Host LiveKit with Railway

**[Deploy LiveKit - Voice Agent on Railway](https://railway.com/template/livekit)**

- **Creator:** Mark Chen's Projects
- **Category:** AI/ML
- **Total deploys:** 65

## Template content

### voice-agent

- **Source:** yuting1214/LiveKit-Template

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### livekit-server

- **Source:** yuting1214/LiveKit-Template
- **Public domain:** Yes

### web-frontend

- **Source:** yuting1214/LiveKit-Template
- **Public domain:** Yes

## Documentation

# Deploy and Host LiveKit on Railway

LiveKit is an open-source WebRTC platform for building real-time audio and video applications. It handles media routing, room management, and participant coordination — letting you build voice agents, video calls, and live streaming without managing low-level WebRTC infrastructure.

## About Hosting LiveKit

Hosting LiveKit requires running a media server with WebRTC connectivity, a Redis instance for room state coordination, and typically one or more backend workers that process media streams. On most cloud platforms, this means configuring UDP ports, TURN/STUN servers, and TLS termination — all of which add operational complexity. This template packages the entire stack — LiveKit server, a Python voice agent powered by OpenAI, a web frontend, and Redis — into a single Railway project with pre-configured networking, so you can go from zero to a working voice AI demo in minutes.

## Common Use Cases

- **Voice AI agents** — Build conversational AI assistants that listen and respond with natural speech using OpenAI's STT, LLM, and TTS models
- **Real-time transcription** — Capture and display live speech-to-text for both user and agent, with interim and final transcript states
- **Voice-enabled prototypes** — Quickly validate voice interaction ideas with a self-hosted stack before committing to a managed service

## Dependencies for LiveKit Hosting

- **Redis** — Required by LiveKit server for room state, participant tracking, and agent job dispatch
- **OpenAI API key** — Powers the voice agent's speech recognition, its GPT-5.6 Luna language model, and natural text-to-speech

### Deployment Dependencies

- [LiveKit Server](https://github.com/livekit/livekit) — Open-source WebRTC media server
- [LiveKit Agents (Python)](https://github.com/livekit/agents) — Framework for building real-time AI agents
- [OpenAI API](https://platform.openai.com/) — STT, LLM, and TTS provider for the voice pipeline

### Implementation Details

This template runs LiveKit in **TCP-only mode** since Railway does not support UDP. A Railway TCP proxy (application port `7882`) is used for WebRTC ICE media transport, with an entrypoint script that automatically configures port forwarding via iptables (or haproxy fallback).

The voice agent supports two modes, selected dynamically from the web UI (no restart or environment variable needed) — the frontend creates rooms with a `pipeline-` or `realtime-` prefix and the agent detects the mode from the room name:
- `pipeline` — OpenAI speech-to-text → GPT-5.6 Luna → text-to-speech
- `realtime` — OpenAI Realtime API (speech-to-speech, lower latency)

## Why Deploy LiveKit on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying LiveKit on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/livekit
