Skip to main content
This guide helps you set up a local environment to run Honcho for development, testing, or self-hosting.

Overview

By the end of this guide, you’ll have:
  • A local Honcho server running on your machine
  • A PostgreSQL database with pgvector extension
  • Basic configuration to connect your applications
  • A working environment for development or testing

Prerequisites

Before you begin, ensure you have the following installed:

Required Software

Database Options

You’ll need a PostgreSQL database with the pgvector extension. Choose one:
  • Local PostgreSQL - Install locally or use Docker
  • Supabase - Free cloud PostgreSQL with pgvector
  • Railway - Simple cloud PostgreSQL hosting
  • Your own PostgreSQL server
The easiest way to get started is using Docker Compose, which handles both the database and Honcho server.

1. Clone the Repository

2. Set Up Environment Variables

Copy the example environment file and configure it:
Edit .env and set your API keys (if using LLM features):

3. Start the Services

4. Verify It’s Working

Check that both services are running:
Test the Honcho API:
You should see a response indicating the service is healthy.

Manual Setup

For more control over your environment, you can set up everything manually.

1. Clone and Install Dependencies

2. Set Up PostgreSQL

Option A: Local PostgreSQL Installation

Install PostgreSQL and pgvector on your system: macOS (using Homebrew):
Ubuntu/Debian:
Windows: Download from postgresql.org

Option B: Docker PostgreSQL

3. Enable Extensions

Connect to PostgreSQL and enable pgvector:

4. Configure Environment

Create a .env file with your settings:
Edit .env with your configuration:

5. Run Database Migrations

6. Start the Server

The server will be available at http://localhost:8000.

Cloud Database Setup

If you prefer to use a managed PostgreSQL service:
  1. Create a Supabase project at supabase.com
  2. Enable pgvector extension in the SQL editor:
  3. Get your connection string from Settings > Database
  4. Update your .env file with the connection string

Railway

  1. Create a Railway project at railway.app
  2. Add a PostgreSQL service
  3. Enable pgvector in the PostgreSQL console
  4. Get your connection string from the service variables
  5. Update your .env file

Verify Your Setup

Once your Honcho server is running, verify everything is working:

1. Health Check

2. API Documentation

Visit http://localhost:8000/docs to see the interactive API documentation.

3. Test with SDK

Create a simple test script:

Connect Your Application

Now that Honcho is running locally, you can connect your applications:

Update SDK Configuration

Next Steps

Troubleshooting

Common Issues

Database Connection Errors
  • Ensure PostgreSQL is running
  • Verify the connection string format: postgresql+psycopg://...
  • Check that pgvector extension is installed
API Key Issues
  • Verify your OpenAI and Anthropic API keys are valid
  • Check that the keys have sufficient credits/quota
Port Already in Use
  • Pass a different port to FastAPI or stop other services using port 8000
Docker Issues
  • Ensure Docker is running
  • Check container logs: docker compose logs
  • Restart containers: docker compose down && docker compose up -d
Migration Errors
  • Ensure the database exists and pgvector is enabled
  • Check database permissions
  • Run migrations manually: uv run alembic upgrade head

Getting Help

Production Considerations

When self-hosting for production, consider:
  • Security: Enable authentication, use HTTPS, secure your database
  • Scaling: Use connection pooling, consider load balancing
  • Monitoring: Set up logging, error tracking, health checks
  • Backups: Regular database backups, disaster recovery plan
  • Updates: Keep Honcho and dependencies updated