---
title: "Deploy Vercel AI Chatbot"
description: "A full-featured, hackable Next.js AI chatbot built by Vercel"
category: "Other"
url: https://railway.com/deploy/vercel-ai-chatbot
---

# Deploy Vercel AI Chatbot

A full-featured, hackable Next.js AI chatbot built by Vercel

**[Deploy Vercel AI Chatbot on Railway](https://railway.com/template/vercel-ai-chatbot)**

- **Creator:** Şükrü
- **Category:** Other
- **Total deploys:** 6

## Template content

### chatbot https://i.ibb.co/YFFp27HF/14985020.png

- **Source:** vercel/ai-chatbot
- **Public domain:** Yes

### 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"`

### postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

## Documentation

# Deploy and Host Vercel AI Chatbot on Railway

[Vercel AI Chatbot](https://github.com/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):

```bash
# 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 &amp; Start (auto-detected by Nixpacks; override if needed):**

```bash
# 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 &amp; 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.



## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/vercel-ai-chatbot
