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
.env and add your API keys:3
Start services
- 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:- Use a reverse proxy (nginx, Caddy, Traefik) for SSL termination
- Set proper URLs in your
.env: - Use a managed database for better reliability
- Enable backups for your PostgreSQL data
Example nginx Configuration
Updating
To update to the latest version:Troubleshooting
Database connection errors
Database connection errors
Make sure PostgreSQL is running and healthy:
Widget not loading
Widget not loading
Check that the widget URL is accessible and CORS is configured properly.
The API allows requests from
DASHBOARD_URL and WIDGET_URL.Email not sending
Email not sending
Verify your
RESEND_API_KEY and EMAIL_FROM are set correctly.
Check the API logs for email errors: