Self-hosting is live
Aelira is open source at github.com/Aelira-AI/aelira-core (MIT + AGPL), released as v0.9.5 stable. This page is a summary — the deployment guide in the repository is the authoritative reference and is kept current with the code. Operational hardening is ongoing and tracked in public issues.
Self-Hosting Guide
Deploy Aelira on your own infrastructure for complete control over your data. Perfect for universities with FERPA requirements.
Why Self-Host?
Data Privacy
Your documents never leave your infrastructure. Essential for FERPA compliance.
AI On-Premise
Run Ollama locally. No data sent to OpenAI, Google, or any external AI provider.
Full Control
Customize configuration, integrate with existing systems, scale as needed.
System Requirements
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 4 cores | 8+ cores |
| RAM | 8 GB | 16+ GB |
| Storage | 20 GB SSD | 100+ GB SSD |
| GPU (optional) | Not required | NVIDIA GPU for faster AI |
Note: AI models require ~4GB storage each. GPU acceleration is optional but significantly speeds up inference.
Architecture Overview
┌─────────────────────────────────────────────────────────────┐
│ Load Balancer │
│ (nginx / traefik) │
└──────────────────────────┬──────────────────────────────────┘
│
┌─────────────────┼─────────────────┐
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Dashboard │ │ Backend │ │ Ollama │
│ (React) │ │ (FastAPI) │ │ (AI) │
│ Port 5173 │ │ Port 8000 │ │ Port 11434 │
└─────────────┘ └──────┬──────┘ └─────────────┘
│
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ PostgreSQL │ │ Redis │ │ Files │
│ (pgvector) │ │ (cache) │ │ (storage) │
│ Port 5432 │ │ Port 6379 │ │ /data │
└─────────────┘ └─────────────┘ └─────────────┘Docker Deployment
1. Clone the Repository
git clone https://github.com/Aelira-AI/aelira-core.git
cd aelira-core2. Configure Environment
# Copy and edit environment file
cp .env.example .env
# Required variables:
DATABASE_URL=postgresql://aelira:your_password@postgres:5432/aelira
REDIS_URL=redis://redis:6379/0
SECRET_KEY=your-secret-key-here
OLLAMA_HOST=http://ollama:11434
# Optional: External AI (if not using Ollama)
GEMINI_API_KEY=your-key # Google Gemini
OPENAI_API_KEY=your-key # OpenAI (backup)3. Start Services
# Production deployment
docker compose up -d --build
# Check service status
docker compose ps
# View logs
docker compose logs -f api4. Initialize Database
# Run database migrations
docker-compose exec backend alembic upgrade head
# Verify database connection
docker-compose exec backend python -c "from src.db import engine; print('OK')"Configuration Reference
| Variable | Description | Default |
|---|---|---|
| DATABASE_URL | PostgreSQL connection string | Required |
| REDIS_URL | Redis connection string | Required |
| SECRET_KEY | JWT signing key (32+ chars) | Required |
| OLLAMA_HOST | Ollama server URL | http://localhost:11434 |
| OLLAMA_MODEL | Default AI model | see docker-compose.yml |
| MAX_UPLOAD_SIZE | Max file size (MB) | 100 |
| LOG_LEVEL | Logging verbosity | INFO |
Memory Optimization
For servers with limited RAM, configure Ollama to use smaller models. The current list of supported models, and how to run the AI fully locally, is documented in docs/deployment/local-ai-models.md in the repository:
# Use smaller models (in .env); see docker-compose.yml for model names
OLLAMA_MODEL=<smaller-language-model> # smaller variant (~2GB RAM)
OLLAMA_VISION_MODEL=<vision-model> # ~2GB RAM
# Or disable AI features and use Gemini API
USE_LOCAL_AI=false
GEMINI_API_KEY=your-keyHTTPS with Let's Encrypt
Use Traefik or nginx for automatic SSL certificates:
# docker-compose.yml includes Traefik config
# Set your domain in .env:
DOMAIN=aelira.yourschool.edu
[email protected]
# Traefik handles SSL automaticallySecurity Checklist
Change default passwords
Update DATABASE_URL and Redis credentials
Generate strong SECRET_KEY
Use: openssl rand -hex 32
Enable HTTPS
Use Let's Encrypt or your own certificates
Restrict network access
Only expose ports 80/443 publicly
Set up backups
Regular PostgreSQL backups for scan history
Troubleshooting
Ollama not responding
Check if models are downloaded: docker-compose exec ollama ollama list
Database connection failed
Ensure PostgreSQL is running and DATABASE_URL is correct. Check: docker-compose logs postgres