Self-Hosting Real User Monitoring (RUM): Optimizing Digital Experience with GlitchTip and Umami on a Private VPS
Introduction: The Imperative of Real User Monitoring (RUM)
In the modern digital economy, performance is directly correlated with business revenue. A delay of a few hundred milliseconds can lead to a measurable drop in conversion rates, increased bounce rates, and degraded brand perception. While traditional synthetic monitoring provides baseline infrastructure health metrics, it fails to capture the chaotic reality of how actual end-users interact with your application across various devices, networks, and geographical locations.
This is where Real User Monitoring (RUM) becomes indispensable. RUM tracks and analyzes every user interaction in real-time, offering deep insights into frontend performance, Core Web Vitals, and client-side exceptions. However, relying on commercial SaaS platforms for RUM often introduces two major challenges: prohibitive scaling costs and stringent data privacy compliance (such as GDPR, CCPA, or HIPAA).
The solution? Self-hosting your RUM stack. By deploying open-source alternatives like GlitchTip and Umami on your own Virtual Private Server (VPS), your organization can achieve complete data sovereignty, eliminate unpredictable monthly bills, and maintain a lightweight, high-performance monitoring ecosystem. This guide provides an enterprise-ready blueprint for deploying and integrating these two powerful tools.
Why GlitchTip and Umami? The Ultimate Open-Source Duo
Building an effective RUM strategy requires a dual approach: monitoring application stability (errors and exceptions) and analyzing user behavior and performance metrics. Combining GlitchTip and Umami covers both pillars seamlessly without bloating your client-side bundle.
GlitchTip: Open-Source Error and Exception Tracking
GlitchTip is an open-source, Sentry-compatible error tracking platform. It allows developers to find, fix, and optimize software errors by collecting detailed stack traces, environment context, and user impact data. Because it uses the open Sentry SDK protocol, it integrates effortlessly into almost any modern framework (Next.js, Vue, Nuxt, Angular, Laravel, or Python) without requiring proprietary libraries.
Umami: Privacy-Focused, Lightweight Web Analytics
Umami is a self-hosted, open-source web analytics solution designed as a privacy-centric alternative to Google Analytics. It does not use cookies, complies fully with GDPR, and anonymizes visitor data out of the box. Crucially for RUM, Umami goes beyond basic pageview tracking by collecting vital performance metrics, including custom events, device breakdowns, and page-speed insights, all through a script that is less than 6KB in size.
Prerequisites and Infrastructure Planning
Before initiating the deployment, ensure your infrastructure meets the necessary baseline requirements to handle production traffic efficiently.
- Virtual Private Server (VPS): A minimum configuration of 2 vCPUs and 4GB RAM is recommended to run both applications along with their respective databases (PostgreSQL and Redis) comfortably. Providers like DigitalOcean, Linode, Hetzner, or Vultr are ideal.
- Operating System: Ubuntu 22.04 LTS or Ubuntu 24.04 LTS.
- Domain and DNS: A registered domain name with access to configure DNS records (e.g.,
errors.yourcompany.comfor GlitchTip andanalytics.yourcompany.comfor Umami). - Software Stack: Docker Engine (v20.10+) and Docker Compose (v2.0+) installed on the host machine.
Step-by-Step Deployment Blueprint via Docker Compose
Utilizing Docker Compose ensures that our environment remains isolated, reproducible, and easy to maintain or migrate. We will construct a unified architecture leveraging PostgreSQL as our central data store and Nginx Proxy Manager or Caddy for automatic SSL termination.
Step 1: Directory Structure Architecture
Connect to your VPS via SSH and establish an organized directory structure for persistence and configuration management:
mkdir -p ~/rum-stack/{glitchtip,umami,proxy}
cd ~/rum-stackStep 2: Configuring the Unified Docker Compose File
Create a docker-compose.yml file in the root of your rum-stack directory to orchestrate the services, isolated networks, and persistent data volumes. Below is an enterprise-grade template:
Note: Ensure all placeholder values (e.g., secret keys and passwords) are replaced with secure, randomly generated strings prior to deployment.
version: '3.8'
networks:
rum-network:
driver: bridge
volumes:
postgres_data:
redis_data:
glitchtip_uploads:
services:
# Database Engine
postgres:
image: postgres:15-alpine
container_name: rum-postgres
environment:
POSTGRES_USER: rum_admin
POSTGRES_PASSWORD: SuperSecurePassword123
POSTGRES_DB: rum_combined
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- rum-network
restart: always
# Cache Engine for GlitchTip
redis:
image: redis:7-alpine
container_name: rum-redis
volumes:
- redis_data:/data
networks:
- rum-network
restart: always
# GlitchTip Web & Worker Services
glitchtip-web:
image: glitchtip/glitchtip:latest
container_name: glitchtip-web
depends_on:
- postgres
- redis
environment:
- DATABASE_URL=postgres://rum_admin:SuperSecurePassword123@postgres:5432/rum_combined
- REDIS_URL=redis://redis:6379/0
- SECRET_KEY=AnotherSuperLongSecretKeyExample987
- PORT=8000
- GLITCHTIP_DOMAIN=[https://errors.yourcompany.com](https://errors.yourcompany.com)
- ENABLE_VOLUMETRIC_LIMITS=False
volumes:
- glitchtip_uploads:/code/uploads
ports:
- "8000:8000"
networks:
- rum-network
restart: always
# Umami Analytics Service
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
container_name: umami-web
depends_on:
- postgres
environment:
- DATABASE_URL=postgres://rum_admin:SuperSecurePassword123@postgres:5432/rum_combined
- APP_SECRET=UmamiSecretKeyHash321
ports:
- "3000:3000"
networks:
- rum-network
restart: alwaysStep 3: Initializing and Launching the Stack
Execute the following command to download the optimized images and launch the services in detached mode:
docker-compose up -dTo ensure GlitchTip initializes its database schema correctly, execute the database migration command inside the container running the application:
docker-compose exec glitchtip-web ./manage.py migrateConfiguring Nginx Reverse Proxy and Let's Encrypt SSL
To safely transmit telemetry data from clients to your VPS, all traffic must be encrypted over HTTPS. You can configure an Nginx reverse proxy block to handle incoming requests on ports 80 and 443, routing traffic dynamically based on the domain headers.
For instance, configure your Nginx configuration file for Umami at analytics.yourcompany.com to reverse proxy to http://localhost:3000, and GlitchTip at errors.yourcompany.com to route to http://localhost:8000. Utilize Certbot to automatically provision free Let's Encrypt SSL certificates:
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d errors.yourcompany.com -d analytics.yourcompany.comIntegrating RUM Into Your Web Applications
With both services running securely under HTTPS, you can now seamlessly integrate them into your production frontend applications.
1. Embedding Umami for Client-Side Performance & Events
Log in to your Umami dashboard (default credentials: admin / umami), create a new website entity, and copy the auto-generated script tag. Place it within the section of your HTML document:
Umami will automatically monitor page load speeds, bounce rates, country-level demographics, and outbound link clicks without violating user privacy metrics.
2. Initializing the Sentry SDK with GlitchTip for Error Capturing
Create an organization and project inside GlitchTip to generate your Data Source Name (DSN). For a standard JavaScript application, install the standard browser SDK and initialize it at the entry point of your application codebase:
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "https://[email protected]/your-project-id",
integrations: [new Sentry.BrowserTracing()],
tracesSampleRate: 0.1, // Captures 10% of frontend performance traces
});Once configured, any unhandled runtime exceptions, failed API requests, or performance bottlenecks will immediately trigger detailed error reports within your self-hosted GlitchTip dashboard.
Maintenance, Scaling, and Security Best Practices
Operating your own telemetry infrastructure requires strict adherence to maintenance best practices to ensure continuous data availability and optimal server performance.
- Automated Database Backups: Schedule a cron job to routinely execute
pg_dumpon your PostgreSQL container. Store these encrypted database snapshots in an offsite object storage solution (e.g., AWS S3, Backblaze B2). - Database Index Maintenance: High-traffic applications generate large volumes of analytics data quickly. Implement data retention policies within Umami and GlitchTip to prune telemetry older than 30 or 60 days, preventing disk space exhaustion.
- Performance Tuning: Utilize Redis as an efficient caching broker for GlitchTip to decouple heavy client request ingestion from database writes. This ensures your server remains highly responsive even during sudden traffic spikes.
Conclusion
Self-hosting your Real User Monitoring system using GlitchTip and Umami delivers the perfect balance of comprehensive performance analytics, absolute privacy compliance, and cost efficiency. By breaking free from commercial SaaS monitoring dependencies, you gain ultimate control over your organization's data asset pipeline while continuously optimizing your digital user experiences.
