Self-hosting
You can self-host Rhesis on your own infrastructure.
This guide covers two deployment scenarios:
- Zero-Configuration Local Deployment - Get started immediately with pre-configured defaults
- Production Deployment - Full configuration for production environments
Important: This guide uses Docker Compose V2 syntax (
docker composewithout hyphen). If you’re using an older version of Docker, you may need to install Docker Compose V2 or use the legacydocker-composecommand.
Zero-Configuration Local Deployment
Perfect for quickly testing Rhesis locally without any configuration hassles. This setup includes:
- ✅ No Auth0 setup required - Local authentication bypass enabled
- ✅ Pre-configured database - PostgreSQL with automatic setup
- ✅ Auto-login enabled - Access the dashboard immediately
- ✅ Default admin user -
admin@local.devcreated automatically - ✅ All secrets included - Development-safe defaults provided
Local Deployment Only
This configuration is NOT suitable for production. It includes hardcoded secrets and disabled security features for ease of local deployment.
Prerequisites
- Docker Desktop installed and running
- Git (to clone the repository)
- Ports 3000, 8080, 8081, 5432, and 6379 available on your system
Quick Start
Get Rhesis running in under 5 minutes:
That’s it! The ./rh start command automatically:
- Checks if Docker is running
- Generates a secure database encryption key
- Creates
.env.docker.localwith all required configuration - Enables local authentication bypass (auto-login)
- Starts all services
- Creates the database and runs migrations
- Creates the default admin user (
Local Admin) - Loads example test data
Configuration Files
The zero-configuration setup uses these files:
What’s Auto-Generated
When you run ./rh start, the .env.docker.local file is automatically created with:
Auto-Generated Keys:
- Database encryption key (using Python cryptography.fernet)
- Local authentication bypass flags:
QUICK_START=true(enables backend auto-login endpoint)NEXT_PUBLIC_QUICK_START=true(enables frontend auto-login detection)
You can add (optional):
- Rhesis API key (for test generation)
- AI provider keys (Gemini, OpenAI, Azure)
- SMTP credentials (for email notifications)
Default Services:
- Backend API on port 8080
- Frontend on port 3000
- Worker on port 8081
- PostgreSQL on port 5432
- Redis on port 6379
Default Access
Once running, access the platform at:
| Service | URL | Credentials |
|---|---|---|
| Frontend | http://localhost:3000 | Auto-login (no credentials needed) |
| Backend API | http://localhost:8080/docs | API documentation |
| Worker Health | http://localhost:8081/health/basic | Health check endpoint |
| Default Admin | Local Admin | Created automatically with auto-login |
Optional: Configure AI Providers
The local setup works out-of-the-box, but to enable test generation, you need an AI provider. Two options:
Option 1: Use Rhesis API (Recommended)
- Get your API key from https://app.rhesis.ai/
- Edit
.env.docker.localand add:
Option 2: Use Your Own AI Provider
Add your provider’s credentials to .env.docker.local:
After updating, restart services:
Managing Services
Use the ./rh CLI for easy service management:
Stop services:
View logs:
Restart services:
Delete everything (fresh start):
Troubleshooting
Docker not running:
Port already in use:
Need a fresh start:
Check service health:
Python cryptography package missing:
Auto-login not working (still seeing login page):
Note: The ./rh start command automatically sets both variables. If you’re manually configuring, ensure both QUICK_START=true (for backend) and NEXT_PUBLIC_QUICK_START=true (for frontend) are set in your .env.docker.local file. If you add these variables after the frontend container was already built, you may need to rebuild it: docker compose --env-file .env.docker.local build frontend && ./rh restart
Production Deployment
For production environments, you need to configure authentication, security, and other production concerns properly.
Production Setup
This section covers deploying Rhesis for production use with proper security configuration, custom authentication setup, and environment-specific settings.
Prerequisites
- Docker Desktop installed and running
- Git (to clone the repository)
- Ports 3000, 8080, 8081, 5432, and 6379 available on your system
System Requirements
Local Deployment Environment
For local deployment, testing, and evaluation:
| Resource | Minimum | Recommended |
|---|---|---|
| RAM | 4 GB | 6 GB |
| Storage | 8 GB free | 15 GB free |
| CPU | 2 cores | 4 cores |
| Network | Stable internet | Broadband |
Local Deployment Notes:
- Includes hot-reload and development tools
- Lower concurrent user load
- Smaller dataset for testing
- Debug logging enabled
Production Environment
For production deployment with real users:
| Resource | Minimum | Recommended | High-Scale |
|---|---|---|---|
| RAM | 8 GB | 16 GB | 32 GB+ |
| Storage | 20 GB SSD | 50 GB SSD | 100 GB+ SSD |
| CPU | 4 cores | 8 cores | 16+ cores |
| Network | 50 Mbps | 100 Mbps | 1 Gbps+ |
Production Notes:
- Optimized builds without development overhead
- Higher concurrent user capacity
- Production logging levels
- Database connection pooling
Detailed Resource Breakdown
Memory Usage by Environment:
| Service | Local Deployment | Production |
|---|---|---|
| PostgreSQL | ~256 MB | ~1-2 GB |
| Redis | ~50 MB | ~500 MB - 1 GB |
| Backend | ~150 MB | ~500 MB - 1 GB |
| Worker | ~200 MB | ~1-2 GB |
| Frontend | ~100 MB | ~200-400 MB |
| Docker Overhead | ~300 MB | ~500 MB - 1 GB |
| Total Estimated | ~1.1 GB | ~3.7-7.1 GB |
Storage Requirements:
| Component | Local Deployment | Production |
|---|---|---|
| Application Code | ~2 GB | ~2 GB |
| Database | ~500 MB | ~5-50 GB+ |
| Docker Images | ~3 GB | ~3-4 GB |
| Logs & Cache | ~500 MB | ~2-10 GB |
| Working Space | ~1 GB | ~3-5 GB |
| Total Estimated | ~7 GB | ~15-75 GB+ |
Performance Characteristics
CPU Usage Patterns:
- High Load: AI processing, bulk data operations, migrations
- Normal Load: API requests, background tasks, web serving
- Idle: Minimal CPU during low activity periods
Scaling Factors:
- AI Operations: Memory spikes during model inference
- Concurrent Users: ~50-100 MB RAM per active user
- Database Growth: Storage scales with user data and analytics
- Background Tasks: CPU-intensive during batch processing
Docker Compose Version Note
Why docker compose instead of docker-compose?
docker-compose(V1): The original standalone tool written in Python, deprecated as of June 2023docker compose(V2): The modern version integrated into Docker CLI, written in Go with better performance
If you encounter errors with docker-compose, you’re likely using the deprecated V1. Switch to docker compose (V2) for:
- Better performance and reliability
- Active maintenance and security updates
- Support for newer Docker features
- Improved integration with Docker CLI
Quick Start
- Clone the repository
- Copy environment variables
-
Configure environment variables
Edit the
.env.dockerfile and update the following configurations:- Auth0 configuration
- JWT configuration
- Azure OpenAI configuration
- Gemini configuration
- SMTP configuration
- NextAuth.js configuration
- Any other environment variables as needed
-
Start all services
- Access the applications
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080/docs
- Worker Health: http://localhost:8081/health/basic
Architecture Overview
Services
The Rhesis platform consists of several interconnected services:
| Service | Port | Description | Health Check |
|---|---|---|---|
| PostgreSQL | 5432 | Primary database | pg_isready |
| Redis | 6379 | Cache & message broker | redis-cli ping |
| Backend | 8080 | FastAPI application | curl /health |
| Worker | 8081 | Celery background tasks | curl /health/basic |
| Frontend | 3000 | Next.js application | curl /api/auth/session |
Service Dependencies
Automated Database Setup
No manual database setup required! The system automatically handles:
- PostgreSQL database and user creation
- Database ownership and permissions setup
- Automatic Alembic migration execution
- Table and relationship creation
- Migration status checking (prevents duplicate migrations)
The backend container startup process:
- Waits for PostgreSQL to be ready
- Sets proper database ownership
- Runs all pending migrations
- Starts the FastAPI application
Environment Configuration
Required Environment Variables
Update your .env.docker file with the following configurations:
Authentication & Security:
These variables configure user authentication and security for the platform:
OAuth Providers (Optional):
Additional authentication providers for user login options:
Email Configuration (Optional):
Required for sending system emails, notifications, and user communications:
AI Model Configuration (Optional):
Configure AI providers for natural language processing and content generation:
Note: At least one AI provider configuration is recommended for full platform functionality. You can choose between Gemini, Azure OpenAI, or OpenAI based on your preferences and requirements.
📊 Telemetry & Privacy
Important: Rhesis collects anonymous usage data by default to improve the platform. All telemetry is privacy-focused and transparent. You can opt-out anytime.
Telemetry Status
For self-hosted deployments: Telemetry is ENABLED by default (opt-out). For cloud deployments: Telemetry is ALWAYS enabled (user consent via Terms & Conditions).
Telemetry helps us improve Rhesis by understanding:
- Which features are most valuable
- Performance bottlenecks
- Common error patterns
What We Collect
✅ Anonymous usage data:
- Feature usage patterns (which features are used, how often)
- API performance metrics (response times, error rates)
- Deployment information (self-hosted vs cloud, version)
- Hashed user/org IDs (SHA-256, irreversible, 16-char truncated)
What We DON’T Collect
❌ Your private data is NEVER collected:
- Your prompts, responses, or generated content
- Document contents or uploaded files
- API keys, passwords, or credentials
- Personal information (names, emails, etc.)
- IP addresses or organization names
- Any identifiable or sensitive data
Data Usage
- Usage: Only by Rhesis team for product improvement
- Sharing: Never sold or shared with third parties
- Storage: Separate analytics database (isolated from your data)
How to Disable Telemetry (Opt-Out)
Telemetry is enabled by default. To opt-out, add to your .env file:
Then restart your services:
docker-compose restart
# or
./rh backend startTelemetry Configuration (Optional)
If telemetry is enabled (default), you can optionally configure these settings:
Learn More: For technical details about the telemetry architecture, see Telemetry System Documentation.
Management Commands
Service Management
Start services:
Stop services:
Restart services:
Monitoring and Logs
View logs:
Check service status:
Building and Updates
Rebuild services:
Database Operations
The database is automatically managed, but you can access it directly if needed:
Troubleshooting
Common Issues
Database Migration Problems:
- Check migration status:
- View migration logs:
- Reset database (WARNING: deletes all data):
Service Health Issues:
- Check service status:
- Verify environment variables:
- Check resource usage:
Port Conflicts:
If you encounter port conflicts, you can modify the ports in docker compose.yml or stop conflicting services:
Performance Optimization
Resource Allocation:
- Ensure Docker has at least 4GB RAM allocated
- Monitor disk space usage with
docker system df - Clean up unused resources with
docker system prune
Database Performance:
- Monitor PostgreSQL logs:
docker compose logs postgres - Check connection counts and slow queries
Security Considerations
- Change default passwords in production
- Use strong JWT secrets
- Configure proper firewall rules
- Keep environment variables secure
- Regularly update Docker images
Backup and Recovery
Database Backup
Full System Backup
Support and Resources
Getting Help
If you encounter issues:
- Check the logs:
docker compose logs - Verify environment variables are set correctly
- Ensure Docker has sufficient resources
- Check if ports are available and not in use
- Review the main documentation for additional guidance
Additional Resources
For local development setup without Docker (for contributing to Rhesis), see the 🔧 Environment Setup Guide .