answerLoopsanswerLoops Docs

Self-Host Quickstart

Run answerLoops on your own infrastructure with Docker.

Use this guide to operate answerLoops on infrastructure you manage. You will configure the application, database, authentication, model services, and channel connections. External model providers and connected platforms still process relevant content; review those services separately from the application’s hosting location.

If you'd rather skip all of this, the cloud quickstart gets you the same product with none of the infrastructure.

Using Claude Code? Install the answerloops-setup skill and have your agent run this guide for you — it checks prerequisites, scaffolds .env, and confirms the instance is actually healthy before handing back.

No agent? Run npx @answerloops/agent-sdk setup directly — same checks, same steps, plain Node CLI, no Claude Code required.

Prerequisites

1. Clone the repo

git clone https://github.com/answerLoops/answerLoops.git
cd answerLoops

2. Configure environment

cp .env.local.example .env.local

Edit .env.local with at minimum:

# Required
DATABASE_URL=postgresql://community:community@postgres:5432/community
AUTH_URL=http://localhost:3000
AUTH_SECRET=<run: openssl rand -hex 32>
ENCRYPTION_KEY=<run: openssl rand -hex 32>

# At least one OAuth provider
AUTH_GITHUB_ID=<your-github-client-id>
AUTH_GITHUB_SECRET=<your-github-client-secret>

# AI (required for deflection and KB search)
OPENAI_API_KEY=<your-openai-api-key>

This project uses Auth.js v5. The env vars are AUTH_URL and AUTH_SECRET — not NEXTAUTH_URL / NEXTAUTH_SECRET.

See the full environment variables reference for all options.

3. Start with Docker

Once your .env.local has real values (not the ones above), this one command does the rest:

docker compose up --build

This starts:

  • app on http://localhost:3000
  • bot (Discord/Slack listener) connecting to the app
  • postgres on localhost:5432 (data persisted in a named volume)

Drizzle migrations run automatically on first start — no manual migration step.

Never run docker compose down -v — this deletes your database volume and all data. Use docker compose down (no -v) to stop without data loss.

4. Create your account

Open http://localhost:3000 and sign in with GitHub, Discord, or Google OAuth. On first login you'll see the onboarding wizard:

  1. Connect your community — Discord 1-click invite, Slack token, or skip
  2. Seed your knowledge base — drag-drop docs files or paste a URL
  3. Configure AI — verify your API key and pick a model
  4. Go live — checklist summary with links to Tickets and KB

5. Verify it works

# Health check
curl http://localhost:3000/api/health
# → {"ok":true}

# Confirm tables were created
docker compose exec postgres psql -U community -d community -c "\dt"

Next steps

On this page