Self-Hosted Deployment
Run Xagent on your own infrastructure for full control, data privacy, and customization.Why Self-Host?
Data Privacy
Keep all data on your infrastructure
Customization
Modify and extend as needed
Compliance
Meet regulatory requirements
Cost Control
Predictable infrastructure costs
Deployment Options
Docker Compose (Simplest)
Best for: Small teams, testing, initial deployment- Docker Engine 20+
- Docker Compose 2+
- 4GB RAM minimum
- 20GB disk space
- PostgreSQL database
- Xagent backend
- Next.js frontend
- nginx reverse proxy
Manual Deployment
Best for: Custom setups, specific requirements See Installation for step-by-step instructions.Production Checklist
Security
Database
Observability
Scalability
Cloud Deployment Guides
AWS
Google Cloud
Azure
Backup & Recovery
Database Backups
Configuration Backups
Memory Store Backups
If using LanceDB for memory:Performance Tuning
Database
- Enable connection pooling
- Add indexes for common queries
- Regular vacuum and analyze (PostgreSQL)
- Monitor slow queries
Application
- Increase CONCURRENT for parallel image processing
- Tune memory store settings
- Enable gzip compression
- Use CDN for static assets
Infrastructure
- Use SSD storage
- Sufficient memory for database and models
- Network optimization within VPC
Troubleshooting
Database Connection Issues
Check:- DATABASE_URL is correctly formatted
- Database is running and accessible
- Network allows connection
- Credentials are correct
- Verify database is running:
docker ps - Check database logs:
docker logs postgres - Test connection:
psql $DATABASE_URL
Memory Issues
Check:- Available system memory
- Concurrent operations limit
- Memory store size
- Reduce CONCURRENT value
- Use in-memory store instead of LanceDB
- Increase available RAM
- Clear memory store cache
API Key Errors
Check:- API keys are set in .env
- Keys have necessary permissions
- Keys are valid and not expired
- Verify .env file is loaded
- Regenerate expired keys
- Check API key permissions
- Verify BASE_URL if using custom endpoint