Skip to main content

Overview

Ansa can be self-hosted using Docker. This gives you full control over your data and infrastructure.

Prerequisites

  • Docker and Docker Compose
  • An LLM API key (Anthropic or OpenAI)
  • A domain with SSL (for production)

Quick Start

1

Clone the repository

2

Create environment file

Edit .env and add your API keys:
3

Start services

This starts:
  • API on port 3001
  • Dashboard on port 3000
  • Widget on port 3002
  • PostgreSQL with pgvector
4

Run migrations

Configuration

Environment Variables

Production Setup

For production deployments:
  1. Use a reverse proxy (nginx, Caddy, Traefik) for SSL termination
  2. Set proper URLs in your .env:
  3. Use a managed database for better reliability
  4. Enable backups for your PostgreSQL data

Example nginx Configuration

Updating

To update to the latest version:

Troubleshooting

Make sure PostgreSQL is running and healthy:
Check that the widget URL is accessible and CORS is configured properly. The API allows requests from DASHBOARD_URL and WIDGET_URL.
Verify your RESEND_API_KEY and EMAIL_FROM are set correctly. Check the API logs for email errors: