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

LLM Setup

Honcho uses LLMs for memory extraction, summarization, dialectic chat, and dreaming. The server will fail to start without a provider configured. If you keep the built-in defaults, you only need one API key: all text-generation features default to openai / gpt-5.4-mini, and embeddings default to openai / text-embedding-3-small. Any OpenAI-compatible endpoint works too — OpenRouter, Together, Fireworks, Ollama, vLLM, or LiteLLM. Models must support tool calling (function calling). After copying .env.template to .env, the default setup is:
If you want a different model or an OpenAI-compatible proxy, uncomment and edit the relevant *_MODEL_CONFIG__TRANSPORT, *_MODEL_CONFIG__MODEL, and *_MODEL_CONFIG__OVERRIDES__BASE_URL lines in the Deriver, Dialectic, Summary, and Dream sections. For example:
For recommended model tiers per feature, using multiple providers, or direct vendor API keys, see the Configuration Guide.
Community quick-start: elkimek/honcho-self-hosted provides a one-command installer with pre-configured model tiers, interactive provider setup, and Hermes Agent integration.
Docker Compose handles the database, Redis, and Honcho server. The compose file builds the image from source (there is no pre-built image on Docker Hub). This requires Docker with BuildKit enabled — see Troubleshooting if the build fails. The compose file is production-oriented by default (ports bound to 127.0.0.1, restart policies, caching enabled). For development, uncomment the source mounts and monitoring services inside the file.

1. Clone the Repository

2. Set Up Environment Variables

Copy the example environment file and configure it:
Edit .env and configure your LLM provider — see LLM Setup above. The database connection is set in the compose file. Auth is disabled by default (AUTH_USE_AUTH=false).

3. Start the Services

The first build takes a few minutes (compiling from source). Subsequent starts are fast. This starts four services: api (port 8000), deriver (background worker), database (PostgreSQL with pgvector, port 5432), and redis (port 6379). All ports are bound to 127.0.0.1. Redis caching is enabled by default. For development, uncomment the source mount and monitoring sections inside docker-compose.yml to enable live reload, Prometheus, and Grafana.

4. Verify

Migrations run automatically on startup.
For a full end-to-end test, see Verify Your Setup below.

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:
Least-privilege database roles. Honcho runs CREATE EXTENSION IF NOT EXISTS vector before migrations and again at startup, so if the role in DB_CONNECTION_URI can’t create extensions, both fail with a privilege error — IF NOT EXISTS doesn’t help, because Postgres checks the privilege first.Run the statement above once as a superuser (or rds_superuser) and the application role needs no extension privileges. See Troubleshooting if you hit this.

4. Configure Environment

Create a .env file with your settings:
Edit .env — configure your LLM provider (see LLM Setup above) and set the database connection:

5. Run Database Migrations

6. Start the Server

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

7. Start the Background Worker (Deriver)

In a separate terminal, start the deriver background worker:
The deriver is essential for Honcho’s core functionality. It processes incoming messages to extract observations, build peer representations, generate session summaries, and run dream consolidation. Without it, messages will be stored but no memory or reasoning will occur.

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

Note: /health only confirms the process is running. It does not check database or LLM connectivity.

2. Smoke Test (database + API)

This confirms the database connection, migrations, and API are all working:
If you get back a workspace object with an id, your database is connected and migrations ran correctly.

3. API Documentation

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

4. Test with SDK

Connect Your Application

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

Update SDK Configuration

Next Steps

Troubleshooting

Running into issues? See the Troubleshooting Guide for detailed solutions to common problems including:
  • Startup failures (missing API keys, database issues)
  • Runtime errors (“An unexpected error occurred” on every request)
  • Deriver not processing messages
  • Database connection and migration issues
  • Docker and Redis problems
Quick checks:
  • Verify the server is running: curl http://localhost:8000/health
  • Check logs: docker compose logs api (Docker) or check terminal output (manual setup)
  • Ensure migrations ran: uv run alembic upgrade head

Production Considerations

The default compose file is already production-oriented — ports bound to 127.0.0.1, restart policies, caching enabled.

Security

  • Set AUTH_USE_AUTH=true and generate a JWT secret with python scripts/generate_jwt_secret.py
  • Use HTTPS via a reverse proxy in front of Honcho. Example with Caddy (automatic TLS):
    Or with nginx:
  • Secure your database with strong credentials and restrict network access
  • The production compose binds PostgreSQL and Redis to 127.0.0.1 only — they are not accessible from the network

Scaling the Deriver

  • Increase DERIVER_WORKERS (default: 1) for higher message throughput
  • You can also run multiple deriver processes across machines — they coordinate via the database queue
  • Monitor deriver logs for processing backlog

Caching

  • The production compose enables Redis caching by default (CACHE_ENABLED=true)
  • For the development compose, enable manually: CACHE_ENABLED=true
  • Configure CACHE_URL to point to your Redis instance (or use a managed Redis service)

Database Migrations

  • Always run uv run alembic upgrade head after updating Honcho before starting the server
  • Check current migration status with uv run alembic current

LLM Providers

Monitoring

  • Enable Prometheus metrics with METRICS_ENABLED=true. The API exposes /metrics on port 8000, the deriver on port 9090 (internal to its container — not published to the host by default).
  • Enable Sentry error tracking with SENTRY_ENABLED=true
  • The development compose includes Prometheus (host port 9090) and Grafana (host port 3000) for scraping and dashboards. Uncomment those services to enable them.

Backups

  • Set up regular PostgreSQL backups:

Deploying on Fly.io

The API can be deployed on Fly.io. Follow the Fly.io getting-started docs to set up your account and install flyctl. A sample fly.toml is included in the repo for convenience.
The included fly.toml does not provision a PostgreSQL database. Stand one up separately (Fly Postgres, Supabase, Neon, or another managed provider) and set DB_CONNECTION_URI to point at it.
Once flyctl is set up, from the repo root:
  • Back up your .env or config.toml configuration files