Self-Hosting GlitchTip With Docker Compose: One Container, Email and Pointing a Sentry SDK at It

Jesse Cole

Jesse Cole

November 23, 2026

Self-Hosting GlitchTip With Docker Compose: One Container, Email and Pointing a Sentry SDK at It

Your app throws exceptions you only hear about when a user complains, and the Sentry SDK is already a single line away in most frameworks. What you do not want is a second server bill or a self-hosted Sentry stack that needs more RAM than the app it watches. GlitchTip accepts events from the same Sentry SDKs and runs from a short Docker Compose file. The catch is that the official instructions and the newest release disagree on a few details right now, and those details decide whether your first docker compose up works cleanly.

GlitchTip 7.0 changed what “workers” means

Older GlitchTip guides describe two containers built from the same image: a web service and a separate worker that processed queued tasks, chosen with a SERVER_ROLE variable. GlitchTip 6.0, released in February 2026, replaced Celery with a lighter task queue called django-vtasks and made a combined web-plus-worker process stable. GlitchTip 7.0, released November 9, 2026, finished the job.

According to the 7.0 release notes, SERVER_ROLE, GLITCHTIP_EMBED_WORKER and IS_WORKER no longer do anything and log a warning if set. The startup script in the backend repository spells out the new model: one Granian ASGI server process that also hosts the task worker and the scheduler, with no roles, and you scale by running more copies of that same process. If an old deployment still asks for SERVER_ROLE=worker, the script refuses to start rather than quietly turning it into a second web server.

So for a single-server install, you no longer run a worker service. If you are migrating a compose file that has a worker: service, delete it. The settings that still control background work are tuning knobs on the one process:

  • VTASKS_CONCURRENCY (default 20): concurrent asyncio background tasks.
  • DATABASE_POOL_MAX_SIZE (default 20): the psycopg connection pool. The docs suggest matching it to the vtasks concurrency and watching your PostgreSQL connection limit.
  • GRANIAN_WORKERS (default 1): web worker processes. The docs recommend raising it only when you are not scaling horizontally.

The official compose file, service by service

GlitchTip’s install guide says to download compose.sample.yml from glitchtip.com, save it on your server as compose.yml and edit the environment section. As of this writing, the sample defines three services and two named volumes.

postgres

The database runs postgres:18 with a named volume pg-data mounted at /var/lib/postgresql. It starts with -c max_locks_per_transaction=512. That flag is not optional decoration. The PostgreSQL tuning section of the docs explains that GlitchTip’s tables are partitioned, so its queries take far more locks than the default allows, and once the shared lock pool fills, anything needing a lock fails with “out of shared memory”, event ingestion included. The setting costs about 24 MB of shared memory. If you point GlitchTip at an existing or managed PostgreSQL server, set it there yourself.

The sample also sets POSTGRES_HOST_AUTH_METHOD: "trust", with a comment suggesting you remove it and set a password. Because the database port is not published to the host, trust auth only applies inside the compose network, but a password is still the better default. If you add one, update the credentials in DATABASE_URL to match. GlitchTip 7.0 requires PostgreSQL 15 or newer, which the sample’s version 18 satisfies.

valkey

valkey/valkey:9 serves as cache and task queue backend. It is optional. Setting VALKEY_URL to an empty string tells GlitchTip to use PostgreSQL for the task queue, cache and sessions, and the docs list this as one of the ways to fit into 256 to 512 MB of RAM. If you disable it, also remove the service and its entry in the shared depends_on list.

web

This is GlitchTip itself. The sample uses the image glitchtip/glitchtip:6, publishes 8000:8000, mounts a named volume uploads at /code/uploads for uploaded files such as source maps, and sets SERVER_ROLE: all_in_one.

Here is the mismatch to resolve before you start. The :6 tag pins you to the 6.x line, and Docker Hub now also carries 7, 7.0 and 7.0.0 tags. The sample’s own comment says to check the GlitchTip blog for new major versions. For a fresh install, change the image to glitchtip/glitchtip:7 and delete the SERVER_ROLE line. The 7.x start script still accepts all_in_one, but the release notes say the variable is ignored and logs a warning, so there is no reason to keep it.

Resource needs: what fits on a small VPS

The install docs give concrete numbers:

  • Recommended: 512 MB of RAM and an x86 or arm64 CPU.
  • Minimum: 256 MB with the all-in-one setup; the docs say careful configuration allows 128 MB plus swap.
  • Disk: depends on event volume and size. As a rough guide, the docs estimate an instance receiving one million events per month may need about 30 GB.

To shrink further, the sample lists three switches: VALKEY_URL: "", GLITCHTIP_ENABLE_LOGS: "False" and GLITCHTIP_ENABLE_UPTIME: "False". The 7.0 notes add a caveat for sizing: GlitchTip no longer restarts workers when memory grows, so reported memory will look higher than on 6.x. Size the container for spikes rather than the idle number. If you are still weighing this against the official product, GlitchTip vs Sentry for a one-person app covers the trade-offs.

A home server rack with blue status lights

Environment variables you must change before the first start

GlitchTip’s settings live in a YAML anchor, x-environment, at the top of the file, which the web service pulls in. The docs mark these as required or essential:

  • SECRET_KEY: any random string. The sample comment suggests generating one with openssl rand -hex 32. Do not leave change_me_to_something_random in place.
  • DATABASE_URL: the PostgreSQL connection string. The sample’s postgres://postgres:postgres@postgres:5432/postgres works with the bundled database.
  • GLITCHTIP_DOMAIN: your public URL including the scheme, such as https://glitchtip.example.com.
  • DEFAULT_FROM_EMAIL: the sender address for outgoing mail.
  • EMAIL_URL: how GlitchTip sends mail, covered in the next section.

Two registration settings matter on a server reachable from the internet. ENABLE_USER_REGISTRATION defaults to True, meaning anyone who finds the URL can sign up. Set it to False and, per the docs, self-signup is disabled after the first user registers; later users join through social login if enabled, or are created by a superuser. ENABLE_ORGANIZATION_CREATION defaults to False, so only superusers can create organizations after the first one.

The sample also exposes ENABLE_ADMIN (Django Admin at /admin/), ENABLE_OPENAPI, GLITCHTIP_ENABLE_MCP for the built-in MCP server and GLITCHTIP_ENABLE_DUCKDB for cold storage, all off by default.

Getting email to actually send

The sample ships with EMAIL_URL: consolemail://, which writes emails to the container logs instead of sending them. That is fine for a first look, but alert emails, invitations and password resets will go nowhere. For SMTP, the docs give the format smtp://email:password@smtp_url:port.

The common failure here is the password. If it contains characters such as @ or /, the URL parser misreads it. GlitchTip’s docs point to django-environ’s guidance on unsafe characters in URLs; URL-encoding those characters is the usual fix.

If you would rather use an email API than SMTP, GlitchTip supports Mailgun by setting MAILGUN_API_KEY and EMAIL_BACKEND to anymail.backends.mailgun.EmailBackend, and SendGrid the same way with SENDGRID_API_KEY and the SendGrid backend. Through the Anymail library it also supports Postmark, Mailjet, Mandrill, SparkPost, Brevo and Postal. A transactional provider is usually less trouble than delivering from your own mail server, since DEFAULT_FROM_EMAIL needs to be an address that provider is allowed to send for.

HTTPS in front of port 8000

The docs recommend SSL as the next step and give an nginx example: a server block for your domain with client_max_body_size 40M; and a location / that uses proxy_pass http://127.0.0.1:8000; plus the Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto headers. Then run certbot for the certificate. The body size limit matters because SDKs and the CLI upload source maps and debug files.

Three settings belong with the proxy:

  • ALLOWED_HOSTS defaults to *; the docs say to restrict it in production.
  • CSRF_TRUSTED_ORIGINS is required when the proxy uses a different domain.
  • TRUSTED_PROXIES changed its default in 7.0 from * to private, so X-Forwarded-For is only trusted from private addresses. Behind Cloudflare, the release notes say to set cloudflare,private. Until you do, all users behind that proxy share one login rate limit.

Once the environment is set, run docker compose up -d. Migrations run automatically on startup unless SKIP_INIT is set.

First account, organization, project and DSN

Open your domain and register. GlitchTip’s getting started guide then walks through three objects: an organization, which can be your company or just a container for projects; a project, which corresponds to one endpoint receiving errors, so separate staging and production projects are common; and a team, which decides who gets notified. Selecting a platform for the project is optional but makes GlitchTip show matching SDK instructions.

The project’s DSN appears on the Issues page the first time you visit it, and later on the project settings page. In 7.0, creating additional client keys (DSNs) requires the Admin role or higher; members can no longer do it.

If you need user management beyond the web interface, enable Django Admin with ENABLE_ADMIN: "True" and create a superuser. The docs give the command as ./manage.py createsuperuser; with Compose, run it inside the web container with docker compose exec web ./manage.py createsuperuser, then log in at /admin/.

Pointing a Sentry SDK at your instance

GlitchTip does not have its own SDKs. You install the normal Sentry SDK for your language and give it the GlitchTip DSN. In Python that is sentry_sdk.init(dsn="https://..."); in JavaScript, Sentry.init({ dsn: "https://..." }). The error tracking guide suggests triggering a test error, such as dividing by zero, and confirming it shows up on the Issues page.

Two SDK options deserve attention on a small server. GlitchTip’s FAQ notes that performance events are a common source of excess volume and recommends setting traces_sample_rate (or tracesSampleRate) to a low value such as 0.01, which sends about 1 percent of transactions. If one noisy error floods the instance, sample_rate or sampleRate reduces error events too.

For JavaScript apps that route events through the SDK’s tunnel option to avoid ad blockers, 7.0 now reads the DSN from the envelope instead of rejecting the request with a 403.

A smoke detector on a white ceiling

The glitchtip-cli for source maps and releases

GlitchTip has its own command-line tool, labeled beta in the docs. Install it with curl -fsSL https://glitchtip.com/install.sh | sh, or with cargo install glitchtip-cli if you have Rust. Log in with glitchtip-cli --url https://your-glitchtip.example.com login, which prompts for an API token, or add --method oauth for a browser login.

It reads the familiar Sentry environment variables, including SENTRY_URL, SENTRY_AUTH_TOKEN, SENTRY_ORG and SENTRY_PROJECT. Useful commands include glitchtip-cli send-event -m "Test event from CLI" for checking a setup, sourcemaps inject ./dist followed by sourcemaps upload ./dist for readable JavaScript stack traces, and releases new and deploys new for release tracking. The 7.0 notes also say ProGuard mappings uploaded with sentry-cli upload-proguard 3.x now work.

Uptime checks from the same box, and their blind spot

Uptime monitoring is on by default (GLITCHTIP_ENABLE_UPTIME). The docs describe four monitor types: Ping, which sends an HTTP HEAD request; GET and POST, which compare the response to an expected status; and Heartbeat, where your app or cron job calls a GlitchTip URL and silence marks it down. Attach each monitor to a project with alerts configured, or you will not get notified. Version 7.0 added a Slack alert recipient for both issue and uptime alerts.

For homelab users there is one setting to know: GLITCHTIP_UPTIME_ALLOW_PRIVATE_IPS defaults to False, so monitors cannot target private addresses until you enable it. And a monitor running on the same VPS as the app cannot tell you when that VPS goes down; which monitor has to live on a different machine explains how to split that job.

Retention settings that decide your disk usage

GlitchTip deletes old data automatically. All values are in days, and the rest fall back to the master setting unless noted:

Variable Default Controls
GLITCHTIP_RETENTION_DAYS 90 Master default for everything below
GLITCHTIP_EVENT_RETENTION_DAYS Master Error events
GLITCHTIP_EVENT_HOT_DAYS 30 Days events stay in PostgreSQL before archival
GLITCHTIP_TRANSACTION_RETENTION_DAYS Master Performance transactions
GLITCHTIP_LOG_RETENTION_DAYS Master Logs (hot days default to 7)
GLITCHTIP_UPTIME_RETENTION_DAYS Master Uptime check results
GLITCHTIP_RELEASE_RETENTION_DAYS 365 Releases

The hot-day values only matter with cold storage enabled via GLITCHTIP_ENABLE_DUCKDB=true, which archives older data to Parquet files on S3 or a local directory. The tuning docs add that shorter retention and cold storage both reduce PostgreSQL lock pressure, because fewer partitions stay in the database.

Upgrading from 6.x without losing events

The routine upgrade is docker compose pull, then docker compose stop and docker compose up -d; migrations run automatically. Going from 6 to 7 needs more care, and the release notes list the steps:

  1. Back up the database first. A pg_dump from the postgres container is the safe form; copying the volume while Postgres is running is not.
  2. If you are on a release older than 6.0.9, upgrade to 6.2.6 and let it migrate before moving to 7.0, or existing events will not carry over.
  3. Make sure PostgreSQL is version 15 or newer while you are still on 6.x.
  4. Rename retired variables. 7.0 ignores old names such as GLITCHTIP_MAX_EVENT_LIFE_DAYS, and an ignored retention variable falls back to 90 days, deleting older events. If you used ENABLE_OPEN_USER_REGISTRATION, set ENABLE_ORGANIZATION_CREATION to the same value and remove the old name.
  5. Remove SERVER_ROLE and any separate worker service, check TRUSTED_PROXIES, then change the image tag to :7 and pull.

If you overrode the container’s startup command, the notes recommend switching back to the default bin/start.sh, since uWSGI is no longer in the image.

More articles for you