Self-Host GlitchTip for Django Error Tracking
Run GlitchTip, the open-source Sentry-compatible error tracker, for Django: deploy it with PostgreSQL and Redis, point the standard sentry-sdk at a GlitchTip DSN, set up uptime checks and alerts, manage event retention, and keep it secure.
Problem statement
You want error tracking for Django, with grouped exceptions, stack traces, and alerts, but Sentry's hosted pricing does not fit, self-hosted Sentry needs a large server and many services, or data must stay on your infrastructure. GlitchTip is an open-source error tracker that accepts events from Sentry SDKs. It is itself a Django app with PostgreSQL and Redis, light enough for a small VPS.
- Deploy GlitchTip with its Docker Compose file (web, worker, PostgreSQL, Redis) behind HTTPS.
- Set
SECRET_KEY,GLITCHTIP_DOMAIN,DEFAULT_FROM_EMAIL, and an email backend so alerts and invites work. - Create an organization and project; copy the DSN.
- In your Django app, keep
sentry-sdkand setdsnto the GlitchTip DSN; disable features GlitchTip does not support. - Configure retention (
GLITCHTIP_MAX_EVENT_LIFE_DAYS), alerts, and uptime monitors; back up its database.
Step-by-step solution
1. Deploy GlitchTip
GlitchTip publishes a Compose example. The essentials:
services:
web:
image: glitchtip/glitchtip:latest
depends_on: [postgres, redis]
env_file: glitchtip.env
ports: ["127.0.0.1:8000:8000"]
worker:
image: glitchtip/glitchtip:latest
command: ./bin/run-celery-with-beat.sh
env_file: glitchtip.env
migrate:
image: glitchtip/glitchtip:latest
command: ./manage.py migrate
env_file: glitchtip.env
postgres:
image: postgres:17
environment: { POSTGRES_PASSWORD: "${PG_PASSWORD}", POSTGRES_DB: glitchtip }
volumes: [pg-data:/var/lib/postgresql/data]
redis:
image: redis:7
volumes: { pg-data: {} }
Pin an image version rather than latest once you are set up. Put Nginx or Caddy in front for TLS. Check GlitchTip's documentation for the current command names.
2. Configure it
SECRET_KEY=<random>
DATABASE_URL=postgres://postgres:...@postgres:5432/glitchtip
REDIS_URL=redis://redis:6379/0
GLITCHTIP_DOMAIN=https://errors.example.com
DEFAULT_FROM_EMAIL=errors@example.com
EMAIL_URL=smtp+tls://user:pass@smtp.example.com:587
ENABLE_USER_REGISTRATION=False
GLITCHTIP_MAX_EVENT_LIFE_DAYS=30
Disable open registration after creating your account so strangers cannot sign up. GLITCHTIP_DOMAIN must match the public URL, or DSNs and links will be wrong.
3. Point Django at GlitchTip
import sentry_sdk
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"], # https://<key>@errors.example.com/1
environment="production",
release=os.environ.get("GIT_SHA"),
traces_sample_rate=0.0, # or a small value; GlitchTip supports basic transactions
send_default_pii=False,
)
The standard Django integration, logging integration, and Celery integration all work. Features such as session replay and profiling are Sentry-specific and should stay off.
4. Alerts and uptime
In each project, add alert recipients by email or webhook (Slack, Discord, Microsoft Teams via webhooks). GlitchTip also includes uptime monitors: add an HTTP check for your site's health endpoint so outages appear next to errors.
5. Operate it
GlitchTip stores events in PostgreSQL. Retention settings delete old events through its Celery worker; make sure the worker runs, or the database grows without limit. Back up the database like any production app, and keep GlitchTip on a different server or provider from the app it monitors, so an outage does not take both down.
Explanation
Sentry SDKs send events to whatever host the DSN names, using a documented ingestion API. GlitchTip implements that API, groups events into issues, and notifies you. Because it is a regular Django application with Celery, its resource needs are modest compared with self-hosted Sentry, which runs Kafka, ClickHouse, and many services. The trade-off is fewer advanced features, particularly in performance monitoring.
Edge cases / notes
- Event volume. A runaway error loop can flood the database; set rate limits per project and keep retention short.
- Source maps and frontend. GlitchTip accepts JavaScript errors from the browser SDK too; upload source maps if you use them.
- Hosted option. GlitchTip also offers a hosted service if you want its pricing without running it.
Next steps
- Configure the SDK well with Set Up Sentry for Django in Production.
- If events do not arrive, use Fix Sentry Not Receiving Errors From Django.
- Round out monitoring with the Django Monitoring Checklist.
FAQ
Does GlitchTip work with sentry-sdk?
Yes. Point the DSN at your GlitchTip instance; the SDK and integrations stay the same.
How big a server does GlitchTip need?
A small VPS with 1 to 2 GB of RAM handles modest event volumes, plus PostgreSQL storage.
Can I move from GlitchTip to Sentry later?
Yes. Change the DSN in your app; past events stay in GlitchTip.
Does GlitchTip do performance monitoring?
It supports basic transaction tracking, but not Sentry's full tracing and profiling features.