Self-Hosting GlitchTip on a VPS: The Ultimate Open-Source Error Tracking Solution for Businesses
Introduction to Modern Error Tracking
In today's fast-paced digital economy, application downtime or undetected software bugs can directly translate to lost revenue and damaged brand reputation. To maintain high availability and seamless user experiences, development teams rely heavily on Error Tracking and Application Performance Monitoring (APM) tools. While proprietary solutions like Sentry, Rollbar, or Datadog offer robust features, their pricing tiers can quickly scale out of control as your application grows and generates millions of event logs.
Furthermore, data privacy regulations such as GDPR and HIPAA demand strict control over where user data and stack traces are stored. This is where GlitchTip enters the frame as a powerful, open-source, and self-hosted alternative. Compatible with Sentry's open-source SDKs, GlitchTip allows businesses to monitor errors, track performance, and manage uptime without the premium price tag or data compliance headaches. In this comprehensive guide, we will walk you through the end-to-end process of deploying GlitchTip on your own Virtual Private Server (VPS).
Why Choose GlitchTip Over Proprietary Solutions?
Before diving into the technical implementation, it is vital to understand the strategic advantages GlitchTip brings to an enterprise infrastructure:
- Cost Efficiency: Since GlitchTip is entirely open-source, you only pay for the underlying VPS infrastructure, drastically reducing operational overhead.
- Data Ownership and Compliance: By self-hosting on your own private infrastructure, your user data, proprietary code snippets, and environment variables never leave your secure perimeter.
- Sentry SDK Compatibility: GlitchTip leverages Sentry's widely-adopted client SDKs. If your applications are already configured for Sentry, migrating to GlitchTip requires changing just a single environment variable (the DSN URL).
- All-in-One Monitoring: Beyond error reporting, GlitchTip includes built-in uptime monitoring and basic performance tracking, consolidating your DevOps tool stack.
Prerequisites and Environment Preparation
To ensure a smooth and stable deployment, your hosting environment must meet certain hardware and software baselines. We recommend utilizing a clean Linux VPS instance.
Hardware Requirements
- CPU: Minimum 2 vCPUs (4 vCPUs recommended for high-traffic staging/production environments).
- RAM: Minimum 2GB RAM (4GB or higher recommended to comfortably run PostgreSQL, Redis, and the GlitchTip web/worker instances).
- Storage: 20GB+ of SSD storage, depending on your log retention policies.
Software Prerequisites
Ensure that your VPS has a modern operating system installed (e.g., Ubuntu 22.04 LTS or Ubuntu 24.04 LTS) and that you have administrative sudo privileges. Additionally, Docker and Docker Compose must be installed on the system to orchestrate the containerized services.
Step-by-Step GlitchTip Deployment Guide
The most reliable and scalable method to run GlitchTip in production is via Docker Compose. This ensures all microservices—the web frontend, background workers, PostgreSQL database, and Redis cache—are properly isolated and networked.
Step 1: Setting Up the Directory Structure
Connect to your VPS via SSH and create a dedicated directory for your GlitchTip deployment to keep configuration files organized:
mkdir -p /opt/glitchtip
cd /opt/glitchtipStep 2: Configuring the Environment Variables
GlitchTip relies on environment variables for critical configuration settings such as database credentials, domain names, and email server connections. Create an .env file within your directory:
nano .envPopulate the file with the following production-ready configuration guidelines. Make sure to replace the placeholder values with your actual secure credentials:
Security Note: Always generate strong, random strings for your database passwords and the secret key. Never expose these values in public repositories.
# General Settings
GLITCHTIP_DOMAIN=[https://glitchtip.yourdomain.com](https://glitchtip.yourdomain.com)
SECRET_KEY=your_very_secure_random_secret_key_here
PORT=8000
# Database Configuration
POSTGRES_DB=glitchtip
POSTGRES_USER=glitchtip_user
POSTGRES_PASSWORD=your_secure_db_password_here
DATABASE_URL=postgres://glitchtip_user:your_secure_db_password_here@postgres:5432/glitchtip
# Redis Configuration
REDIS_URL=redis://redis:6379/0
# User Registration
GLITCHTIP_REGISTRATION_OPEN=False
# Email (SMTP) Configuration - Required for alerts and password resets
EMAIL_URL=smtp://user:[email protected]:587
[email protected]Setting GLITCHTIP_REGISTRATION_OPEN=False after creating your initial administrator account is highly recommended to prevent unauthorized public registrations on your server.
Step 3: Creating the Docker Compose File
Now, define the multi-container architecture in a docker-compose.yml file. This configuration links the GlitchTip web service, asynchronous Celery worker, PostgreSQL, and Redis together seamlessly.
nano docker-compose.ymlInsert the following configuration code into the file:
version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- pg_data:/var/lib/postgresql/data
restart: unless-stopped
redis:
image: redis:7-alpine
restart: unless-stopped
web:
image: glitchtip/glitchtip
depends_on:
- postgres
- redis
ports:
- "127.0.0.1:8000:8000"
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- SECRET_KEY=${SECRET_KEY}
- GLITCHTIP_DOMAIN=${GLITCHTIP_DOMAIN}
- GLITCHTIP_REGISTRATION_OPEN=${GLITCHTIP_REGISTRATION_OPEN}
- EMAIL_URL=${EMAIL_URL}
- DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL}
volumes:
- uploads:/code/uploads
restart: unless-stopped
worker:
image: glitchtip/glitchtip
command: ./bin/run-celery-with-beat.sh
depends_on:
- postgres
- redis
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- SECRET_KEY=${SECRET_KEY}
- GLITCHTIP_DOMAIN=${GLITCHTIP_DOMAIN}
- EMAIL_URL=${EMAIL_URL}
- DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL}
volumes:
- uploads:/code/uploads
restart: unless-stopped
volumes:
pg_data:
uploads:Notice that the port mapping 127.0.0.1:8000:8000 restricts direct public access to the container web port. Instead, we will route traffic safely through a reverse proxy.
Step 4: Initializing and Migrating the Database
With configuration files locked in, spin up the database and Redis services, then execute the initial database migrations required by GlitchTip:
docker-compose up -d postgres redis
docker-compose run --rm web ./manage.py migrateOnce the migration commands finish executing successfully, create your initial superuser/administrator account:
docker-compose run --rm web ./manage.py createsuperuserFollow the terminal prompts to input your administrative email and password. Finally, launch the entire application stack in detached mode:
docker-compose up -d---Securing GlitchTip with Nginx and Let's Encrypt HTTPS
Running an error tracking system over unencrypted HTTP exposes sensitive application tokens and payload details to potential eavesdropping. To secure your setup, configure Nginx as a reverse proxy coupled with Let's Encrypt SSL certificates.
Installing Nginx and Certbot
sudo apt update
sudo apt install nginx certbot python3-certbot-nginx -yConfiguring the Nginx Server Block
Create a dedicated configuration file for your GlitchTip domain:
sudo nano /etc/nginx/sites-available/glitchtipAdd the following production configuration block, making sure to update glitchtip.yourdomain.com with your actual subdomain:
server {
listen 80;
server_name glitchtip.yourdomain.com;
client_max_body_size 50M;
location / {
proxy_pass [http://127.0.0.1:8000](http://127.0.0.1:8000);
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}Enable the site configuration by creating a symbolic link to the sites-enabled directory, and verify your Nginx syntax rules before reloading:
sudo ln -s /etc/nginx/sites-available/glitchtip /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginxObtaining an SSL Certificate
Run the Certbot agent to automatically acquire, install, and configure a free, auto-renewing Let's Encrypt SSL certificate for your setup:
sudo certbot --nginx -d glitchtip.yourdomain.comFollow the interactive prompts to automatically redirect all standard HTTP traffic straight to secure HTTPS.
---Connecting an Application to Your VPS Instance
With GlitchTip fully operational and secured behind HTTPS, you can log into the web dashboard using your admin credentials. To begin tracking bugs, create a new Organization and a new Project corresponding to your target software stack.
GlitchTip will immediately generate a unique DSN (Data Source Name) string. Because GlitchTip maintains backend compatibility with Sentry, you can import standard Sentry client libraries into your codebase. For instance, in a standard Node.js/Express backend environment, integration is straightforward:
const Sentry = require("@sentry/node");
Sentry.init({
dsn: "https://[email protected]/project-id",
tracesSampleRate: 1.0,
});
// Your application logic automatically captures unhandled exceptionsAny uncaught run-time exception or managed error log will now stream directly to your self-hosted VPS dashboard instead of a third-party server, ready for inspection, deep debugging, and team triage.
---Production Best Practices and Maintenance
To keep your self-hosted instance performing reliably over the long haul, implement these core operational habits:
- Regular Backups: Schedule automated nightly backups of your PostgreSQL database volumes using standard tools like
pg_dumpto ensure rapid recovery capabilities. - Log Data Retention: Error tracking databases can grow rapidly. Periodically evaluate data retention periods within GlitchTip configurations or establish clean-up crontabs to prevent disk exhaustion.
- Resource Monitoring: Keep a close eye on system RAM and CPU storage patterns using integrated VPS metric dashboards or lightweight tooling like
htop.
Conclusion
Deploying GlitchTip on a VPS strikes an ideal balance for modern engineering teams: it provides the high-fidelity visibility of enterprise error tracking without the associated price barriers or privacy liabilities. By following this guide, you have established a highly scalable, compliant, and cost-efficient observability hub tailored specifically to your organizational footprint. As your application ecosystem continues to scale, your underlying monitoring foundation is now fully prepared to scale alongside it sustainably.
