Skip to main content

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
For production deployments, we recommend at least 4GB RAM and 20GB disk space.

Quick Start with Docker

Get OpenSight running in under 5 minutes with Docker Compose.
1

Clone the repository

2

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.
3

Start the full stack

This command starts:
  • Web UI on port 3000
  • API server on port 4000
  • PostgreSQL database on port 5432
  • Redis cache on port 6379
4

Access OpenSight

Open your browser and navigate to:
  • Web UI: http://localhost:3000
  • API: http://localhost:4000
  • API Documentation: http://localhost:4000/api/docs
Initial startup may take 1-2 minutes while the database initializes.

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

Change the default password in production deployments!

Redis Configuration

Authentication

Generate secure random strings for JWT secrets:

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:

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.
1

Install dependencies

OpenSight uses pnpm workspaces. If you prefer pnpm:
2

Start development services

Start PostgreSQL and Redis in Docker:
This starts only the database and cache, not the application.
3

Initialize the database

Or run all at once:
4

Start development servers

This starts:
  • Web UI at http://localhost:3000
  • API server at http://localhost:4000
To start services individually:

Database Management

OpenSight uses Drizzle ORM for database management.

Generate Schema

Generates TypeScript types from your database schema.

Run Migrations

Applies pending migrations to your database.

Seed Database

Populates the database with sample data for development.

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:
Set up automated backups for production deployments. Consider using managed database services for critical data.

Redis Cache

Clear the Redis cache if needed:

Update OpenSight

To update to the latest version:

Troubleshooting

Check Docker logs for errors:
Common issues:
  • Ports already in use (3000, 4000, 5432, 6379)
  • Insufficient disk space
  • Missing environment variables
Verify PostgreSQL is running and accessible:
Check the DATABASE_URL in your .env file matches the Docker service name.
Common causes:
  • Missing AI engine API keys
  • Incorrect NEXT_PUBLIC_API_URL in frontend
  • CORS configuration issues
Check API logs:
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

Follow these security best practices for production deployments:
  • 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: