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.

Sponsored by

Neon

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)

VariableDescription
DATABASE_URLPostgreSQL connection string. Add ?connection_limit=5&pool_timeout=10 for serverless.
CAP_SERVER_URLPublic site URL used for canonical links
AUTH_SECRETRandom secret for Auth.js session encryption

OAuth Providers (Optional)

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth App client ID
GITHUB_CLIENT_SECRETGitHub OAuth App client secret
GOOGLE_CLIENT_IDGoogle OAuth client ID
GOOGLE_CLIENT_SECRETGoogle OAuth client secret
AZURE_AD_CLIENT_IDAzure AD application client ID
AZURE_AD_CLIENT_SECRETAzure AD application client secret
AZURE_AD_TENANT_IDAzure AD tenant ID

Storage Providers (Optional)

VariableDescription
ENABLED_STORAGEurl | s3 | r2 | do-spaces
S3_BUCKETS3 bucket name
S3_REGIONS3 region (e.g., us-east-1)
S3_ACCESS_KEY_IDS3 access key
S3_SECRET_ACCESS_KEYS3 secret key
S3_ENDPOINTCustom endpoint for S3-compatible services (MinIO, etc.)
R2_BUCKETCloudflare R2 bucket name, e.g. chub-images-local or chub-images-prd
R2_ACCOUNT_IDCloudflare account ID for the R2 S3-compatible endpoint
R2_ACCESS_KEY_IDCloudflare R2 access key
R2_SECRET_ACCESS_KEYCloudflare R2 secret key
R2_ENDPOINTOptional R2 endpoint override
DO_SPACES_*DigitalOcean Spaces: BUCKET, REGION, ACCESS_KEY_ID, SECRET_ACCESS_KEY, CDN_ENDPOINT

AI Features (Optional)

VariableDescription
OPENAI_API_KEYOpenAI API key for AI search and generation
OPENAI_BASE_URLCustom base URL for OpenAI-compatible APIs
OPENAI_EMBEDDING_MODELEmbedding model (default: text-embedding-3-small)
OPENAI_GENERATIVE_MODELGenerative model (default: gpt-5.5)

Analytics (Optional)

VariableDescription
GOOGLE_TAG_MANAGER_IDGoogle Tag Manager container ID (e.g., GTM-XXXXXXX)

Configuration (prompts.config.ts)

Customize your instance by editing prompts.config.ts:

Branding

OptionTypeDescription
namestringYour app name displayed in header and footer
logostringPath to logo for light mode
logoDarkstringPath to logo for dark mode
faviconstringPath to favicon
descriptionstringApp description for SEO and homepage

Theme

OptionValuesDescription
radiusnone | sm | md | lgBorder radius for UI components
variantflat | default | brutalUI style variant
densitycompact | default | comfortableSpacing density
colors.primaryhex or oklchPrimary brand color (e.g., #6366f1)

Authentication

OptionValuesDescription
providersarraycredentials, github, google, azure
allowRegistrationbooleanAllow public sign-up (credentials provider only)

Internationalization

OptionTypeDescription
localesstring[]Supported locales: en, tr, es, zh, ja, ar, pt, fr, it, de, ko
defaultLocalestringDefault language

Features

OptionDefaultDescription
privatePromptstrueAllow users to create private prompts
changeRequeststrueEnable version control with change requests
categoriestrueEnable prompt categories
tagstrueEnable prompt tags
aiSearchfalseAI-powered semantic search (requires OPENAI_API_KEY)
aiGenerationfalseAI-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.