Self-Hosting Guide
Deploy your own characterhub instance with customizable branding, themes, and authentication.
What You Get
- Curated prompt library with 100+ community-tested prompts
- Custom branding, logos, and themes
- Multiple auth providers (GitHub, Google, Azure, credentials)
- AI-powered semantic search and generation (optional)
- Multi-language support (11 locales)
- MIT-licensed software with separately licensed prompt content
Using Documentation AI-Agents
DeepWiki
DeepWiki provides AI-powered documentation and insights for this repository.
- AI-generated documentation from source code
- Interactive codebase exploration
- Architecture diagrams and component relationships
- Available as an MCP server
Context7
Context7 is an AI-powered chat interface for exploring and understanding this repository.
- Chat with the codebase using natural language
- Get answers with code references
- Understand implementation details quickly
- Available as an MCP server
Manually
Prerequisites
- Node.js 24.x
- PostgreSQL database
- npm
Recommended Database
characterhub requires PostgreSQL. For a hosted database, we recommend Neon for serverless Postgres, connection pooling, and database branching.
Quick Start
# Clone the repository
git clone https://github.com/f/characterhub.git
cd characterhub
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Run migrations
npm run db:migrate
# Start development server
npm run dev
Environment Variables
Create a .env file based on .env.example:
Core (Required)
| Variable | Description |
|---|---|
| DATABASE_URL | PostgreSQL connection string. Add ?connection_limit=5&pool_timeout=10 for serverless. |
| CAP_SERVER_URL | Public site URL used for canonical links |
| AUTH_SECRET | Random secret for Auth.js session encryption |
OAuth Providers (Optional)
| Variable | Description |
|---|---|
| GITHUB_CLIENT_ID | GitHub OAuth App client ID |
| GITHUB_CLIENT_SECRET | GitHub OAuth App client secret |
| GOOGLE_CLIENT_ID | Google OAuth client ID |
| GOOGLE_CLIENT_SECRET | Google OAuth client secret |
| AZURE_AD_CLIENT_ID | Azure AD application client ID |
| AZURE_AD_CLIENT_SECRET | Azure AD application client secret |
| AZURE_AD_TENANT_ID | Azure AD tenant ID |
Storage Providers (Optional)
| Variable | Description |
|---|---|
| ENABLED_STORAGE | url | s3 | r2 | do-spaces |
| S3_BUCKET | S3 bucket name |
| S3_REGION | S3 region (e.g., us-east-1) |
| S3_ACCESS_KEY_ID | S3 access key |
| S3_SECRET_ACCESS_KEY | S3 secret key |
| S3_ENDPOINT | Custom endpoint for S3-compatible services (MinIO, etc.) |
| R2_BUCKET | Cloudflare R2 bucket name, e.g. chub-images-local or chub-images-prd |
| R2_ACCOUNT_ID | Cloudflare account ID for the R2 S3-compatible endpoint |
| R2_ACCESS_KEY_ID | Cloudflare R2 access key |
| R2_SECRET_ACCESS_KEY | Cloudflare R2 secret key |
| R2_ENDPOINT | Optional R2 endpoint override |
| DO_SPACES_* | DigitalOcean Spaces: BUCKET, REGION, ACCESS_KEY_ID, SECRET_ACCESS_KEY, CDN_ENDPOINT |
AI Features (Optional)
| Variable | Description |
|---|---|
| OPENAI_API_KEY | OpenAI API key for AI search and generation |
| OPENAI_BASE_URL | Custom base URL for OpenAI-compatible APIs |
| OPENAI_EMBEDDING_MODEL | Embedding model (default: text-embedding-3-small) |
| OPENAI_GENERATIVE_MODEL | Generative model (default: gpt-5.5) |
Analytics (Optional)
| Variable | Description |
|---|---|
| GOOGLE_TAG_MANAGER_ID | Google Tag Manager container ID (e.g., GTM-XXXXXXX) |
Configuration (prompts.config.ts)
Customize your instance by editing prompts.config.ts:
Branding
| Option | Type | Description |
|---|---|---|
| name | string | Your app name displayed in header and footer |
| logo | string | Path to logo for light mode |
| logoDark | string | Path to logo for dark mode |
| favicon | string | Path to favicon |
| description | string | App description for SEO and homepage |
Theme
| Option | Values | Description |
|---|---|---|
| radius | none | sm | md | lg | Border radius for UI components |
| variant | flat | default | brutal | UI style variant |
| density | compact | default | comfortable | Spacing density |
| colors.primary | hex or oklch | Primary brand color (e.g., #6366f1) |
Authentication
| Option | Values | Description |
|---|---|---|
| providers | array | credentials, github, google, azure |
| allowRegistration | boolean | Allow public sign-up (credentials provider only) |
Internationalization
| Option | Type | Description |
|---|---|---|
| locales | string[] | Supported locales: en, tr, es, zh, ja, ar, pt, fr, it, de, ko |
| defaultLocale | string | Default language |
Features
| Option | Default | Description |
|---|---|---|
| privatePrompts | true | Allow users to create private prompts |
| changeRequests | true | Enable version control with change requests |
| categories | true | Enable prompt categories |
| tags | true | Enable prompt tags |
| aiSearch | false | AI-powered semantic search (requires OPENAI_API_KEY) |
| aiGeneration | false | AI-powered generation features (requires OPENAI_API_KEY) |
White-Label Mode
Set useCloneBranding = true at the top of the config to:
- Display your branding name and description on the homepage
- Use your logo as the hero background watermark
- Hide characterhub achievements (GitHub stars, Forbes, etc.)
- Hide sponsor section and "Become a Sponsor" CTA
- Hide "Clone on GitHub" button
// prompts.config.ts
const useCloneBranding = true;
Production Deployment
npm run build
npm run start
Deploy to Vercel, Railway, Render, or any Node.js hosting platform. Make sure to set all environment variables in your hosting provider's dashboard.
Support
For issues and questions, please open a GitHub Issue. For the complete documentation, see the SELF-HOSTING.md file in the repository.