DOKPLOY-GUIDE 10 min read fordnox

Deploy Sentry with Dokploy: Docker Compose Setup Guide

Step-by-step guide to deploying Sentry error tracking on your VPS using Dokploy and Docker Compose. Includes PostgreSQL, Redis, Kafka, ClickHouse, workers, and SSL configuration.


Deploy Sentry with Dokploy

Dokploy is an open-source server management platform that simplifies deploying Docker Compose applications on your VPS. It handles reverse proxy configuration, SSL certificates, and deployment management — which helps manage Sentry's complex multi-service error tracking platform.

This guide walks you through deploying a streamlined Sentry setup with PostgreSQL, Redis, the web interface, worker, and cron services. Sentry provides real-time error tracking and performance monitoring for applications.

Prerequisites

Docker Compose Configuration

Create a new Compose project in Dokploy and paste the following configuration:

version: "3.8"

services:
  sentry-web:
    image: getsentry/sentry:latest
    restart: unless-stopped
    ports:
      - "9000:9000"
    environment:
      - SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY}
      - SENTRY_POSTGRES_HOST=sentry-db
      - SENTRY_POSTGRES_PORT=5432
      - SENTRY_DB_NAME=sentry
      - SENTRY_DB_USER=sentry
      - SENTRY_DB_PASSWORD=${SENTRY_DB_PASSWORD}
      - SENTRY_REDIS_HOST=sentry-redis
      - SENTRY_REDIS_PORT=6379
      - SENTRY_SERVER_EMAIL=${SENTRY_EMAIL_FROM:-sentry@yourdomain.com}
      - SENTRY_EMAIL_HOST=${SMTP_SERVER:-localhost}
      - SENTRY_EMAIL_PORT=${SMTP_PORT:-587}
      - SENTRY_EMAIL_USER=${SMTP_LOGIN}
      - SENTRY_EMAIL_PASSWORD=${SMTP_PASSWORD}
      - SENTRY_EMAIL_USE_TLS=true
    depends_on:
      sentry-db:
        condition: service_healthy
      sentry-redis:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:9000/_health/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 5

  sentry-worker:
    image: getsentry/sentry:latest
    restart: unless-stopped
    command: run worker
    environment:
      - SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY}
      - SENTRY_POSTGRES_HOST=sentry-db
      - SENTRY_POSTGRES_PORT=5432
      - SENTRY_DB_NAME=sentry
      - SENTRY_DB_USER=sentry
      - SENTRY_DB_PASSWORD=${SENTRY_DB_PASSWORD}
      - SENTRY_REDIS_HOST=sentry-redis
      - SENTRY_REDIS_PORT=6379
    depends_on:
      sentry-db:
        condition: service_healthy
      sentry-redis:
        condition: service_healthy

  sentry-cron:
    image: getsentry/sentry:latest
    restart: unless-stopped
    command: run cron
    environment:
      - SENTRY_SECRET_KEY=${SENTRY_SECRET_KEY}
      - SENTRY_POSTGRES_HOST=sentry-db
      - SENTRY_POSTGRES_PORT=5432
      - SENTRY_DB_NAME=sentry
      - SENTRY_DB_USER=sentry
      - SENTRY_DB_PASSWORD=${SENTRY_DB_PASSWORD}
      - SENTRY_REDIS_HOST=sentry-redis
      - SENTRY_REDIS_PORT=6379
    depends_on:
      sentry-db:
        condition: service_healthy
      sentry-redis:
        condition: service_healthy

  sentry-db:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      - POSTGRES_DB=sentry
      - POSTGRES_USER=sentry
      - POSTGRES_PASSWORD=${SENTRY_DB_PASSWORD}
    volumes:
      - ../files/sentry-db-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U sentry"]
      interval: 10s
      timeout: 5s
      retries: 5

  sentry-redis:
    image: redis:7-alpine
    restart: unless-stopped
    volumes:
      - ../files/sentry-redis-data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

Note: Before first deployment, generate a secret key by running docker run --rm getsentry/sentry:latest config generate-secret-key. After first deploy, initialize the database and create the superuser: docker compose exec sentry-web sentry upgrade (runs migrations and prompts for admin account). The full Sentry self-hosted stack includes Kafka, ClickHouse, Snuba, and more — this streamlined setup covers the core functionality. For the complete stack, see Sentry's self-hosted repository.

Environment Variables

Set these in Dokploy's Environment tab for your compose project:

Variable Purpose Example
SENTRY_SECRET_KEY Django secret key (generate with sentry CLI) (generated 50+ char key)
SENTRY_DB_PASSWORD PostgreSQL database password a-strong-random-password
SENTRY_EMAIL_FROM From address for alert emails sentry@yourdomain.com
SMTP_SERVER SMTP server for notifications (optional) smtp.mailgun.org
SMTP_PORT SMTP server port 587
SMTP_LOGIN SMTP username sentry@yourdomain.com
SMTP_PASSWORD SMTP password your-smtp-password

In Dokploy, environment variables are set via the Environment editor in the project settings. Do not create a .env file manually — Dokploy manages this for you. The secret key must be generated before first deployment and kept consistent across all Sentry services.

Volumes & Data Persistence

This setup uses Dokploy's ../files convention for bind-mounted volumes:

The ../files path is relative to the compose file inside Dokploy's project directory. This ensures your data persists across redeployments. Avoid using absolute paths because Dokploy may clean them during redeployment.

Domain & SSL Setup

  1. In your Dokploy project, navigate to the Domains tab
  2. Click Add Domain and enter your domain (e.g., sentry.yourdomain.com)
  3. Set the container port to 9000
  4. Enable HTTPS — Dokploy automatically provisions a Let's Encrypt SSL certificate
  5. Save and wait for the certificate to be issued (usually under a minute)

Dokploy's built-in Traefik reverse proxy handles TLS termination and routes traffic to the Sentry web container.

Verifying the Deployment

  1. In Dokploy, go to your project's Deployments tab and click Deploy
  2. Watch the build logs — all five services should start (database and Redis first)
  3. Run database setup on first deploy: docker compose exec sentry-web sentry upgrade — this runs migrations and prompts for the admin superuser account
  4. Check the Logs tab for the sentry-web service. Look for: uWSGI is ready
  5. Open https://sentry.yourdomain.com in your browser — you should see the Sentry login page
  6. Log in with the superuser credentials created during sentry upgrade
  7. Create a project and integrate the Sentry SDK into your application to test error tracking

Troubleshooting

"sentry upgrade" fails with migration errors Ensure PostgreSQL is healthy and accessible. Sentry requires specific PostgreSQL extensions — if migrations fail, check for missing extensions. Run docker compose exec sentry-web sentry upgrade --noinput for non-interactive mode after the initial setup.

Worker not processing events Check the sentry-worker logs for Redis connection errors. All Sentry services must share the same SENTRY_SECRET_KEY and database credentials. Verify Redis is healthy and the worker can connect.

High memory usage and slow performance Sentry is resource-intensive. The streamlined setup needs at least 8 GB RAM. Consider setting memory limits on containers and adding swap space. For production use with high event volume, deploy the full Sentry self-hosted stack with Kafka and ClickHouse.

Event ingestion DSN not working After creating a project in Sentry, ensure the DSN URL uses your public domain. Configure system.url-prefix in Sentry's admin settings to match your HTTPS domain.

SSL certificate not issuing Ensure your domain's DNS A record points to your server's IP and has propagated. Dokploy uses Let's Encrypt HTTP-01 challenges, so port 80 must be accessible. Check Traefik logs in Dokploy for certificate-related errors.


Learn more about Sentry in our complete overview.

Need a VPS? Hostinger VPS starts at $4.99/mo — perfect for running Sentry.


For more on Docker Compose deployments in Dokploy, see the Dokploy Docker Compose documentation.

App data sourced from selfh.st open-source directory.

~/self-hosted-app/sentry/dokploy/get-started

Ready to get started?

Get the best VPS hosting deal today. Hostinger offers 4GB RAM VPS starting at just $4.99/mo.

Get Hostinger VPS — $4.99/mo

// up to 75% off + free domain included

// related topics

sentry dokploy docker compose self-hosted error tracking sentry deployment

fordnox

Expert VPS reviews and hosting guides. We test every provider we recommend.

// last updated: February 12, 2026. Disclosure: This article may contain affiliate links.