This guide will walk you through setting up Claude Code UI on your local development environment.
Before you begin, ensure you have the following installed on your system:
- Node.js 20.0.0 or later - Download from nodejs.org
- npm 10.0.0 or later (comes with Node.js)
- Git - Download from git-scm.com
- Claude Code CLI - Installation guide
- Cursor CLI - Installation guide
Check that everything is properly installed:
node --version # Should be 20.0.0 or later
npm --version # Should be 10.0.0 or later
git --version # Any recent version is fine
claude --version # If using Claude Code
cursor --version # If using Cursorgit clone https://github.com/your-org/claude-code-ui-nextjs.git
cd claude-code-ui-nextjsnpm installThis will install all required dependencies including:
- Next.js 15
- React 19
- TypeScript
- Tailwind CSS
- v0 components
- And many more
Copy the example environment file and configure it:
cp .env.example .envEdit the .env file with your preferred text editor:
# Required - Basic Configuration
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-generated-secret-here
# Required - AI Provider API Keys (choose one or both)
CLAUDE_API_KEY=your-claude-api-key
CURSOR_API_KEY=your-cursor-api-key
# Optional - Additional providers
OPENAI_API_KEY=your-openai-api-key
# Optional - Database (for production)
DATABASE_URL=postgresql://username:password@localhost:5432/claude-code-uiFor NEXTAUTH_SECRET, generate a secure random string:
openssl rand -base64 32Or use an online generator: generate-secret.vercel.app
- Visit Anthropic Console
- Create an account or sign in
- Generate an API key
- Add it to your
.envfile asCLAUDE_API_KEY
- Install Cursor IDE
- Sign up for Cursor Pro (if needed)
- Get your API key from Cursor settings
- Add it to your
.envfile asCURSOR_API_KEY
- Visit OpenAI Platform
- Create an account and add billing
- Generate an API key
- Add it to your
.envfile asOPENAI_API_KEY
For development, the app can work without a database. For production or full features:
- Install PostgreSQL locally or use a cloud service
- Create a database named
claude_code_ui - Update
DATABASE_URLin.env - Run database migrations:
npx prisma migrate devFor local development, you can use SQLite:
# Update .env
DATABASE_URL="file:./dev.db"
# Run migrations
npx prisma migrate devnpm run devThe application will be available at:
- Frontend: http://localhost:3000
- API: http://localhost:3000/api
- Open http://localhost:3000 in your browser
- You should see the Claude Code UI landing page
- Click "Get Started" to test authentication
- Try creating a new project or session
-
Run Claude Code in a project directory:
cd /path/to/your/project claude -
Verify it works in the terminal first
-
The web UI will automatically detect Claude Code sessions
- Open Cursor IDE
- Open a project in Cursor
- Use Cursor CLI commands to verify setup
- The web UI will integrate with Cursor sessions
Create a workspace directory for your projects:
mkdir ~/claude-code-workspace
cd ~/claude-code-workspace
# Example projects
mkdir my-next-app
mkdir my-python-api
mkdir my-documentationIf port 3000 is busy:
# Use a different port
PORT=3001 npm run dev
# Or kill the process using port 3000
lsof -ti:3000 | xargs kill -9On macOS/Linux, you might need to fix permissions:
sudo chown -R $(whoami) ~/.npm
sudo chown -R $(whoami) /usr/local/lib/node_modulesClear cache and reinstall:
rm -rf node_modules package-lock.json
npm installEnsure your .env file is in the project root and restart the dev server:
# Stop the server (Ctrl+C)
npm run devIf you encounter issues:
- Check the Troubleshooting Guide
- Search existing issues
- Create a new issue
- Join our Discord community
Once you have Claude Code UI running:
- Environment Configuration - Configure all environment variables
- Development Setup - Set up your development environment
- First Project - Create your first project
- API Reference - Explore the API capabilities
This installation guide is for development. For production deployment:
- Use Vercel Deployment Guide for easy cloud deployment
- Use Self-Hosted Guide for custom infrastructure
- Follow Security Best Practices
🎉 Congratulations! You now have Claude Code UI running locally. Start building amazing AI-powered applications!