A complete, production-ready observability stack using Docker Compose with popular monitoring, logging, and tracing tools. Perfect for VPS deployment with nginx reverse proxy and SSL termination.
- π Monitoring: Prometheus, Grafana, Node Exporter, cAdvisor, Alertmanager
- π Logging: Loki, Promtail with log aggregation and correlation
- π Tracing: Jaeger, OpenTelemetry Collector for distributed tracing
- π Health Monitoring: Uptime Kuma, Blackbox Exporter
- π Reverse Proxy: nginx with SSL termination and load balancing
- πΎ Storage: PostgreSQL, Redis for data persistence and caching
- ποΈ Production Ready: SSL/TLS, authentication, rate limiting, security headers
- π Scalable: Resource limits, horizontal scaling, performance monitoring
- π‘οΈ Secure: Internal networking, authentication, encrypted communications
- π± Comprehensive: System, container, application, and network monitoring
- π§ Maintainable: Log rotation, automated cleanup, health checks
- ποΈ Modular: Choose exactly which services you need
- Docker and Docker Compose installed
- Domain name pointing to your server (required for HTTPS)
- Open ports: 80, 443
- DNS records configured (see Domain Setup section)
git clone <repository-url>
cd open-observality-final-bosscp .env .env.local
# Edit .env with your domain and passwords
nano .env- Set
DOMAIN=your-domain.com(replace with your actual domain) - Update all passwords (they all contain
change_me) - Configure email settings for alerts
- Set up Slack webhook URL if needed
The start script now offers multiple deployment options:
./start.shThis will present you with an interactive menu to select services:
π¦ Predefined Stacks:
1) π― Complete Stack (All services)
2) π Monitoring Only (Prometheus + Grafana + Core)
3) π Logging Only (Loki + Promtail + Core)
4) π Tracing Only (Jaeger + OpenTelemetry + Core)
5) π Health Monitoring (Uptime Kuma + Blackbox + Core)
6) π§ Core Infrastructure Only (nginx + PostgreSQL + Redis)
7) ποΈ Custom Selection (Choose individual services)
π Quick Stacks:
8) π Development (Monitoring + Logging - minimal)
9) π Production (Complete stack with health monitoring)
10) π¬ Debugging (Tracing + Logging + Monitoring)
# Deploy complete stack
./start.sh --complete
# Deploy monitoring stack only
./start.sh --monitoring
# Deploy logging stack only
./start.sh --logging
# Deploy tracing stack only
./start.sh --tracing
# Deploy health monitoring
./start.sh --health
# Deploy core infrastructure only
./start.sh --core
# Deploy development stack (lightweight)
./start.sh --dev
# Deploy production stack (complete)
./start.sh --prod
# Deploy debugging stack
./start.sh --debug
# Deploy specific services
./start.sh --services=nginx,prometheus,grafana,postgres
# Show help
./start.sh --helpFor Small Projects/Development:
./start.sh --dev
# Deploys: nginx, postgres, redis, prometheus, grafana, node-exporter, loki, promtailFor Production Monitoring:
./start.sh --monitoring
# Deploys: nginx, postgres, redis, prometheus, grafana, alertmanager, node-exporter, cadvisorFor Application Debugging:
./start.sh --debug
# Deploys: Complete monitoring + logging + tracing stackCustom Selection:
./start.sh --services=nginx,prometheus,grafana
# Deploys: Only specified services (dependencies auto-resolved)| Service | Description | Dependencies |
|---|---|---|
| nginx | Reverse proxy with SSL termination | None |
| postgres | PostgreSQL database | None |
| redis | Redis cache and session store | None |
| prometheus | Metrics collection and storage | node-exporter, cadvisor |
| grafana | Dashboards and visualization | postgres, redis |
| alertmanager | Alert management and routing | postgres |
| node-exporter | System metrics exporter | None |
| cadvisor | Container metrics exporter | None |
| loki | Log aggregation system | None |
| promtail | Log collection agent | loki |
| jaeger | Distributed tracing system | None |
| otel-collector | OpenTelemetry data collector | jaeger, prometheus |
| uptime-kuma | Uptime monitoring dashboard | None |
| blackbox-exporter | Black-box monitoring | None |
| logrotate | Log rotation utility | None |
The available services depend on your selection. Common access points:
- Grafana: https://your-domain.com/grafana/ (admin/your-password)
- Prometheus: https://your-domain.com/prometheus/
- Jaeger: https://your-domain.com/jaeger/
- Uptime Kuma: https://your-domain.com/uptime/
- Alertmanager: https://your-domain.com/alertmanager/
- Monitoring Dashboard: https://monitoring.your-domain.com/
- Status Page: https://status.your-domain.com/
- Metrics: https://prometheus.your-domain.com/
- Traces: https://jaeger.your-domain.com/
All services - Full observability with monitoring, logging, tracing, and health checks
./start.sh --complete- β System monitoring (Prometheus + Grafana)
- β Log aggregation (Loki + Promtail)
- β Distributed tracing (Jaeger + OpenTelemetry)
- β Health monitoring (Uptime Kuma + Blackbox)
- β Alert management (Alertmanager)
Core monitoring - Essential metrics and dashboards
./start.sh --monitoring- β Prometheus metrics collection
- β Grafana dashboards
- β System & container monitoring
- β Alert management
Log management - Centralized logging solution
./start.sh --logging- β Loki log aggregation
- β Promtail log collection
- β Log rotation management
- β Core infrastructure
Distributed tracing - Application performance monitoring
./start.sh --tracing- β Jaeger tracing UI
- β OpenTelemetry collector
- β Request flow visualization
- β Performance analysis
Uptime & availability - Service health tracking
./start.sh --health- β Uptime Kuma dashboard
- β Blackbox monitoring
- β Service availability tracking
- β Status page
Lightweight monitoring - Perfect for development environments
./start.sh --dev- β Basic monitoring (Prometheus + Grafana)
- β Log collection (Loki + Promtail)
- β Minimal resource usage
- β Quick setup
Comprehensive debugging - When you need to troubleshoot
./start.sh --debug- β Full monitoring capabilities
- β Complete log aggregation
- β Distributed tracing
- β Performance analysis tools
Key variables in .env:
DOMAIN: Your domain nameGRAFANA_ADMIN_PASSWORD: Grafana admin passwordPOSTGRES_PASSWORD: Database passwordREDIS_PASSWORD: Redis passwordALERT_EMAIL: Email for alertsSLACK_WEBHOOK_URL: Slack webhook for notifications
# Domain Configuration
DOMAIN=monitoring.example.com
# Database Configuration
POSTGRES_DB=observability
POSTGRES_USER=observability_user
POSTGRES_PASSWORD=secure_postgres_password_123
# Redis Configuration
REDIS_PASSWORD=secure_redis_password_456
# Grafana Configuration
GRAFANA_ADMIN_PASSWORD=secure_grafana_admin_789
# SSL Configuration
SSL_EMAIL=admin@example.com
CERTBOT_STAGING=false
# Alerting Configuration
ALERT_EMAIL=alerts@example.com
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK# Install certbot
sudo apt update
sudo apt install certbot python3-certbot-nginx
# Stop nginx temporarily
docker compose stop nginx
# Generate certificates for all domains
certbot certonly --standalone -d your-domain.com \
-d monitoring.your-domain.com \
-d status.your-domain.com \
-d prometheus.your-domain.com \
-d jaeger.your-domain.com \
-d loki.your-domain.com \
--email your-email@example.com \
--agree-tos --no-eff-email
# Copy certificates to nginx volume
sudo cp /etc/letsencrypt/live/your-domain.com/fullchain.pem /var/lib/docker/volumes/open-observality-final-boss_nginx_ssl/_data/cert.pem
sudo cp /etc/letsencrypt/live/your-domain.com/privkey.pem /var/lib/docker/volumes/open-observality-final-boss_nginx_ssl/_data/key.pem
# Start nginx
docker compose start nginx# Add to crontab for automatic renewal
0 3 * * * certbot renew --quiet && docker compose restart nginx# View logs for specific service
docker-compose logs -f [service-name]
# Restart specific service
docker-compose restart [service-name]
# Update and restart stack
docker-compose pull && docker-compose up -d
# Stop all services
docker-compose down
# Stop and remove data
docker-compose down -v
# Check service status
docker-compose ps
# View resource usage
docker stats# Add monitoring to existing logging stack
docker-compose up -d prometheus grafana node-exporter
# Add tracing to existing stack
docker-compose up -d jaeger otel-collector# Stop specific services
docker-compose stop uptime-kuma blackbox-exporter
# Remove stopped services
docker-compose rm uptime-kuma blackbox-exporter# Check service status
docker-compose ps
# Test specific endpoints
curl -k https://your-domain.com/grafana/api/health
curl -k https://your-domain.com/prometheus/-/healthy
# View service logs
docker-compose logs --tail=50 grafana
docker-compose logs --tail=50 prometheus# Main domain
your-domain.com A YOUR_SERVER_IP
# Subdomains for services
monitoring.your-domain.com A YOUR_SERVER_IP
status.your-domain.com A YOUR_SERVER_IP
prometheus.your-domain.com A YOUR_SERVER_IP
jaeger.your-domain.com A YOUR_SERVER_IP
loki.your-domain.com A YOUR_SERVER_IP
# Optional: Wildcard record (easier management)
*.your-domain.com A YOUR_SERVER_IP
# Test DNS resolution
nslookup your-domain.com
nslookup monitoring.your-domain.com
# Test from your server
ping your-domain.com- CPU, Memory, Disk usage
- Network I/O and connections
- System load and processes
- Temperature and hardware sensors
- Container resource usage
- Docker daemon metrics
- Container lifecycle events
- Image and volume statistics
- HTTP request metrics
- Database connections
- Cache hit/miss ratios
- Custom application metrics
- System logs (syslog, auth, kernel)
- Application logs with structured logging
- Container logs with metadata
- nginx access and error logs
- HTTP request tracing
- Database query tracing
- Service dependency mapping
- Performance bottleneck identification
Configured alerts for:
- System resource exhaustion
- Service downtime
- High error rates
- Performance degradation
- Security events
- Email notifications
- Slack integration
- Webhook notifications
- Uptime Kuma integration
-
Services won't start
# Check dependencies ./start.sh --services=nginx,postgres,redis # Then add other services docker-compose up -d prometheus grafana
-
Domain not resolving
# Check DNS propagation nslookup your-domain.com dig your-domain.com -
SSL certificate issues
# Regenerate self-signed cert rm nginx/ssl/* ./start.sh --core
-
Resource constraints
# Use lightweight stack ./start.sh --dev # Or minimal monitoring ./start.sh --services=nginx,prometheus,grafana
-
Service-specific issues
# Check individual service logs docker-compose logs [service-name] # Restart problematic service docker-compose restart [service-name]
Enable detailed logging:
# Check service selection
./start.sh --help
# Test with core services only
./start.sh --core
# Add services incrementally
docker-compose up -d prometheus
docker-compose up -d grafana# Minimal monitoring for development
./start.sh --dev
# Equivalent to:
./start.sh --services=nginx,postgres,redis,prometheus,grafana,node-exporter,loki,promtail# Full observability for production
./start.sh --prod
# Or step by step:
./start.sh --monitoring # Start with monitoring
docker-compose up -d loki promtail # Add logging
docker-compose up -d jaeger otel-collector # Add tracing# Complete debugging stack
./start.sh --debug
# Focus on specific areas:
./start.sh --tracing # For application performance
./start.sh --logging # For log analysis
./start.sh --monitoring # For resource monitoring# Just system monitoring
./start.sh --monitoring
# Add health checks
docker-compose up -d uptime-kuma blackbox-exporter- Server Setup: VPS with Docker and Docker Compose installed
- Domain Purchased: Domain name registered and configured
- DNS Records: All A records pointing to your server IP
- Firewall: Ports 22, 80, 443 open
- Environment:
.envfile configured with your domain and passwords
- Requirements: Identified monitoring needs (metrics, logs, traces, health)
- Resources: Estimated server capacity for selected services
- Dependencies: Understood service relationships and requirements
- Access: Planned which dashboards and interfaces you need
- Interactive: Use
./start.shfor guided selection - Automated: Use
./start.sh --[option]for scripted deployment - Custom: Use
./start.sh --services=...for specific services - Incremental: Start with core, add services as needed
- Services Running: All selected containers healthy (
docker compose ps) - Web Access: All selected dashboards accessible via HTTPS
- SSL Valid: No certificate warnings in browser
- Data Flow: Metrics, logs, and traces flowing properly
- Alerts: Alerting system configured and tested
- Passwords: Strong, unique passwords for all services
- Firewall: Restrictive firewall rules
- Updates: System packages updated
- Backups: Data backup strategy implemented
- Monitoring: Uptime monitoring configured
- SSL Renewal: Automatic certificate renewal set up
# Complete observability stack
./start.sh --complete
# Development environment
./start.sh --dev
# Production monitoring
./start.sh --prod
# Custom selection
./start.sh --services=nginx,prometheus,grafana,loki# Guided deployment with menu
./start.sh# Show all options
./start.sh --help
# Check service status
docker-compose ps
# View service logs
docker-compose logs -f [service-name]β‘ Ready to monitor everything? Choose your deployment option and start observing your infrastructure like a pro!
- π Check the troubleshooting guide
- π Report issues on GitHub
- π¬ Join our Discord community
- π§ Email support: support@your-domain.com