
Deploy Vercel AI Chatbot
A full-featured, hackable Next.js AI chatbot built by Vercel
chatbot
vercel/ai-chatbot
Just deployed
redis
redis:8.2.1
Just deployed
/data
postgres
railwayapp-templates/postgres-ssl:17
Just deployed
/var/lib/postgresql/data
Deploy and Host Vercel AI Chatbot on Railway
Vercel AI Chatbot is an open-source Next.js app that showcases the Vercel AI SDK with a streaming chat UI. It supports multiple LLM providers, tool/function calling, and server actions. Use it as a production-ready starter to build chatbots, assistants, or agentic interfaces with minimal boilerplate.
About Hosting Vercel AI Chatbot
This Railway template provisions everything needed to run the Vercel AI Chatbot as a persistent web service. Railway automatically builds the Next.js app, sets up environment variables, and exposes a HTTPS domain. The template also attaches Redis (for rate-limiting, caching, or session state) and Postgres (for conversation history, analytics, or settings). You’ll configure a few environment variables, including authentication secrets and API gateway keys, and deploy. Nixpacks detects Node.js and installs dependencies; your app scales vertically and horizontally as traffic grows, without managing servers, SSL, or Dockerfiles.
Common Use Cases
- Customer support or FAQ copilots embedded on a website
- Internal knowledge assistants for docs, runbooks, or BI queries
- Lead capture/chat concierge with form handoff and CRM sync
Dependencies for Vercel AI Chatbot Hosting
- Runtime: Node.js 18+ (or 20+), Next.js, Vercel AI SDK, pnpm/npm
- Services: Redis and Postgres (provisioned by this template)
Deployment Dependencies
- Vercel AI Chatbot repo: https://github.com/vercel/ai-chatbot
- Railway docs: https://docs.railway.app
- Redis on Railway: https://docs.railway.app/databases/redis
- Postgres on Railway: https://docs.railway.app/databases/postgresql
- Vercel AI Gateway: https://vercel.com/ai-gateway
- Vercel Blob Store: https://vercel.com/docs/storage/vercel-blob
Implementation Details
Recommended environment variables (set on the Web Service):
# Redis (injected by Railway when Redis is attached)
REDIS_URL="${{redis.REDIS_URL}}"
# Postgres (injected by Railway when Postgres is attached)
POSTGRES_URL="${{postgres.DATABASE_PUBLIC_URL}}"
# Auth and security
AUTH_SECRET="${{secret()}}"
AUTH_TRUST_HOST="${{RAILWAY_PUBLIC_DOMAIN}}"
# Vercel AI Gateway (required for non-Vercel deployments)
AI_GATEWAY_API_KEY="YOUR_AI_GATEWAY_KEY"
# Blob store (for file handling, optional)
BLOB_READ_WRITE_TOKEN="YOUR_BLOB_TOKEN"
Build & Start (auto-detected by Nixpacks; override if needed):
# Install
pnpm install --frozen-lockfile
# Build Next.js
pnpm run build
# Start (Node server or Next start)
pnpm start
# or
pnpm run start
Health checks & ports
Railway will expose PORT
. Ensure your server listens on process.env.PORT
(Next.js does this automatically with next start
).
Why Deploy Vercel AI Chatbot 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 Vercel AI Chatbot 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.
Template Content
chatbot
vercel/ai-chatbotAI_GATEWAY_API_KEY
AI Gateway API Key (required for non-Vercel deployments). https://vercel.com/ai-gateway
BLOB_READ_WRITE_TOKEN
Instructions to create a Vercel Blob Store here: https://vercel.com/docs/storage/vercel-blob
redis
redis:8.2.1