Overview
OpenSight can be self-hosted on your own infrastructure, giving you complete control over your brand monitoring data. This guide covers deployment using Docker Compose for a production-ready setup.Self-hosting requires basic familiarity with Docker, environment variables, and server administration.
Prerequisites
Before you begin, ensure you have the following installed:- Docker 20.10 or higher
- Docker Compose 2.0 or higher
- Git for cloning the repository
- Node.js 20+ (for local development only)
- 2GB+ RAM recommended for production
- 10GB+ disk space for database and logs
Quick Start with Docker
Get OpenSight running in under 5 minutes with Docker Compose.Configure environment variables
Copy the example environment file and update with your settings:Edit
.env with your preferred text editor. See Environment Variables for details.Start the full stack
- Web UI on port 3000
- API server on port 4000
- PostgreSQL database on port 5432
- Redis cache on port 6379
Docker Compose Configuration
OpenSight uses Docker Compose to orchestrate multiple services. Here’s the complete configuration:docker/docker-compose.yml
Environment Variables
Configure OpenSight by setting these environment variables in your.env file.
Database Configuration
Redis Configuration
Authentication
AI Engine APIs
These API keys enable OpenSight to query AI engines:You need at least one AI engine API key for OpenSight to function. Get API keys from:
- OpenAI Platform
- Perplexity AI
- Serper.dev (for Google AI)
Email Configuration
Payment Processing (Optional)
File Upload (Optional)
Application URLs
Feature Flags
Error Tracking (Optional)
Local Development Setup
For local development without Docker, follow these steps.Start development services
Start PostgreSQL and Redis in Docker:This starts only the database and cache, not the application.
Database Management
OpenSight uses Drizzle ORM for database management.Generate Schema
Run Migrations
Seed Database
Production Deployment
Build for Production
Start Production Services
Health Checks
Verify services are running:View Logs
Monitoring & Maintenance
Database Backups
Create automated backups of your PostgreSQL database:Redis Cache
Clear the Redis cache if needed:Update OpenSight
To update to the latest version:Troubleshooting
Services fail to start
Services fail to start
Check Docker logs for errors:Common issues:
- Ports already in use (3000, 4000, 5432, 6379)
- Insufficient disk space
- Missing environment variables
Database connection errors
Database connection errors
Verify PostgreSQL is running and accessible:Check the DATABASE_URL in your
.env file matches the Docker service name.API requests failing
API requests failing
Common causes:
- Missing AI engine API keys
- Incorrect NEXT_PUBLIC_API_URL in frontend
- CORS configuration issues
Out of memory errors
Out of memory errors
OpenSight requires at least 2GB RAM. If running on a constrained system:
- Increase Docker memory limits
- Reduce concurrent analysis jobs
- Use external managed services for PostgreSQL/Redis
Security Considerations
- Change default passwords for PostgreSQL
- Use strong JWT secrets (64+ characters)
- Enable HTTPS with a reverse proxy (nginx, Caddy)
- Restrict database access to application containers only
- Keep dependencies updated with
npm audit - Set up firewall rules to limit exposed ports
- Enable Redis authentication for production
- Rotate API keys regularly
- Use environment-specific .env files (never commit secrets)
Scaling Considerations
For high-traffic deployments:- Use managed PostgreSQL (AWS RDS, Railway, Supabase)
- Use managed Redis (Upstash, Redis Cloud)
- Deploy multiple API instances behind a load balancer
- Enable CDN for static assets
- Consider horizontal scaling with Kubernetes
Next Steps
Environment Variables
Complete reference for all configuration options.
Docker Guide
Advanced Docker deployment patterns.
API Reference
Integrate OpenSight into your workflows.
Platform Features
Explore plan tiers and features.
Need Help?
If you encounter issues during installation:- Check GitHub Issues
- Review Docker documentation
- Join our community discussions