answerLoopsanswerLoopsDocs

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.

This is the fast path: one machine, Docker, and the minimum configuration. The self-hosting guide covers everything after it, including every environment variable, channel setup, production deployment, and upgrades.

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.

Before you start

You need Node.js, Docker with Compose, pnpm, an AI provider key, and a Google OAuth client. The prerequisites page has the required versions and a list of accounts to set up first. For the Google client, follow OAuth setup.

The flow at a glance

Here is the whole flow in one picture; each step is spelled out below.

Install flow: clone the repo, copy .env.example to .env, then start Docker Compose, which runs the app, the bot, and Postgres. Open the app in your browser at localhost port 3000.

1. Clone the repo

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

2. Configure environment

cp .env.example .env

Edit .env 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>

# Google sign-in (the sign-in page shows no button without these)
AUTH_GOOGLE_ID=<your-google-oauth-client-id>
AUTH_GOOGLE_SECRET=<your-google-oauth-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.

To generate the two secrets, see Generating secrets. The full environment variables reference lists every option.

3. Start with Docker

Once your .env 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. For published images, pinning a version, logs, and database access, see Docker setup.

This is the development stack: it mounts the source and runs pnpm dev, which is the quickest way to try answerLoops. For a deployment that stays up, follow the production guide.

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 Google. 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