This guide helps you run VTChat locally using Docker Compose with minimal configuration.
- Docker and Docker Compose installed
- At least one AI API key (OpenAI, Anthropic, or Google Gemini)
git clone https://github.com/vinhnx/vtchat.git
cd vtchat# Copy the simplified environment file
cp apps/web/.env.example apps/web/.env.local
# Edit with your AI API key (required)
# At minimum, you need:
# - BETTER_AUTH_SECRET (generate a random 32-char key)
# - At least one AI API key (OPENAI_API_KEY, ANTHROPIC_API_KEY, or GEMINI_API_KEY)# Generate a secure 32-character secret
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
# Copy the output to BETTER_AUTH_SECRET in your .env.local# Run the setup validator
./validate-setup.sh# Start PostgreSQL + VTChat app
docker-compose up --build
# Or run in background
docker-compose up -d --build- App: http://localhost:3000
- Health Check: http://localhost:3000/api/health
If you prefer not to use Docker:
# macOS with Homebrew
brew install postgresql@15
brew services start postgresql@15
# Create database
createdb vtchat_dev
# Update DATABASE_URL in .env.local
DATABASE_URL=postgresql://yourusername@localhost:5432/vtchat_devbun install
cd apps/web
bun devFor basic functionality without Creem payments:
# Required
DATABASE_URL=postgresql://vtchat:vtchat_password@localhost:5432/vtchat_dev
BETTER_AUTH_SECRET=your-32-char-random-key
BETTER_AUTH_URL=http://localhost:3000
NEXT_PUBLIC_BASE_URL=http://localhost:3000
# At least one AI provider
OPENAI_API_KEY=sk-your-key-here
# OR
ANTHROPIC_API_KEY=sk-ant-your-key-here
# OR
GEMINI_API_KEY=your-key-hereBefore troubleshooting, run the setup validator:
./validate-setup.shThis will check for common configuration issues.
If you encounter lobe-icons build issues:
# Clear node_modules and reinstall
rm -rf node_modules apps/web/node_modules package-lock.json
bun installFor social authentication, use these redirect URIs:
- GitHub:
http://localhost:3000/api/auth/callback/github - Google:
http://localhost:3000/api/auth/callback/google
# Check if PostgreSQL is running
docker-compose ps
# View logs
docker-compose logs postgres
docker-compose logs vtchatIf the Docker build fails:
# Clear Docker cache
docker system prune -f
# Rebuild without cache
docker-compose build --no-cacheIf port 5432 or 3000 are already in use:
# Stop conflicting services
docker-compose down
# Or change ports in docker-compose.yml
# ports:
# - "5433:5432" # Change host port for PostgreSQL
# - "3001:3000" # Change host port for VTChat# Stop containers
docker-compose down
# Stop and remove volumes (⚠️ deletes database data)
docker-compose down -vdocker-compose.yml- Container orchestrationDockerfile.dev- Development container setupapps/web/.env.example- Environment templatescripts/init-db.sql- Database initialization