<!-- Adapted reference excerpt from launch/repo/README.md; deployment placeholder removed and links localized. -->
# Self-hosted Sentry (errors + logs + traces)

[Deploy on Railway](https://railway.com/deploy/self-hosted-sentry-errors-logs-and-trace?utm_source=railway-templates-launch&utm_medium=docs) · [Quickstart](/quickstart).

**Unofficial community template, not affiliated with or endorsed by Sentry.**
The human publisher must supply the template URL before release.

Monitor your own applications with Sentry on Railway. Sentry is **Fair Source
(FSL-1.1-Apache-2.0)**, source-available software, Copyright Functional Software, Inc. dba Sentry. See [licensing](https://open.sentry.io/licensing/) and the
[upstream LICENSE.md](https://github.com/getsentry/sentry/blob/26.9.0/LICENSE.md).
This template is for monitoring your own applications, not for offering Sentry
as a hosted service to third parties. Our original template code is [MIT](/reference/template-MIT.txt);
upstream software retains its own licenses. No Sentry logo is used.

## Quickstart

These are the setup steps, not a measured deployment-time promise.

1. Click **Deploy on Railway** and use its defaults.
2. Wait for **gateway** to become healthy. Open its public URL.
3. Copy `ADMIN_EMAIL` and `ADMIN_PASSWORD` from **web → Variables** to log in.
4. Create an organization and project. If needed, open `/organizations/new/`.
5. In **Settings → Projects → Client Keys (DSN)**, copy the public key and project ID.
   Set this variable on an application in the same Railway environment:

```text
SENTRY_DSN=http://PUBLIC_KEY@${{gateway.RAILWAY_PRIVATE_DOMAIN}}:8081/PROJECT_ID
```

Run a [Node, Python or Go example](/reference/examples/README.md), then check **Issues**,
**Logs** and **Traces**. Private networking is required. A laptop cannot reach
this DSN through `railway run`. Public browser and mobile ingestion is not supported.

## What you get

- Error tracking, structured logs, and linked parent/child trace spans.
- Automatic initialization and generated per-install credentials.
- Persistent PostgreSQL, Valkey, ClickHouse, Kafka and Taskbroker storage.
- Separate private object buckets for filestore and nodestore.
- Public authenticated UI and private SDK ingestion.

The pinned runtime is Sentry `26.9.0`; versions and digests are in
[images.lock.json](/reference/images.lock.json). Dockerfiles use official upstream images
as their bases. Railway wrappers add startup/configuration and the pinned
S3 nodestore integration; upstream Sentry binaries and source are not patched.
These wrapper images are built locally or by CI, not published by this repository.

This single-node profile excludes replay, profiling, feedback, uptime, cron,
AI features and legacy metrics. It is not a high-availability deployment.
Indexed retention is seven days; Kafka queue retention is three hours.
These are configuration values, not a recovery guarantee. Email is disabled
unless you configure SMTP. See [operations](/reference/OPERATIONS.md).

## Architecture

```mermaid
flowchart LR
  Browser -->|public UI| Gateway
  App[Your application] -->|private port 8081| Gateway
  Gateway --> Web[Sentry web]
  Gateway --> Relay
  Relay --> Kafka
  Kafka --> SC[Sentry consumers]
  Kafka --> NC[Snuba consumers]
  NC --> CH[ClickHouse]
  Web --> Snuba[Snuba API]
  Snuba --> CH
  Web --> PG[PostgreSQL]
  SC --> PG
  Web --> VK[Valkey]
  SC --> MC[Memcached]
  SC --> SY[Symbolicator]
  SC --> TB[Taskbroker]
  Tasks[Sentry tasks] --> TB
  Tasks --> PG
  Web --> S3[Private object buckets]
  SC --> S3
```

## Measured cost

A previous healthy test window, **2026-10-01 23:49:50 to 23:53:19 UTC**, measured
**9.313 GB RAM** and **0.170 vCPU** across the fourteen runtime services.
Repeating that measured window for thirty days gives **$96.34 compute**.
This is an extrapolation, not an invoice or capacity guarantee.
[Measurement and calculation](/reference/validation/cost.json).

The calculation uses 43,200 minutes × (RAM GB × $0.000231 + vCPU × $0.000463),
from [Railway's published rates](https://docs.railway.com/pricing/plans).
Volume storage, bucket storage, service egress, workload growth, plan charges
and included credits are excluded. Measure your own workload and configure
usage alerts before relying on this estimate.

## FAQ

**Is this an official Sentry template?** No. It is an unofficial community template.

**Can I send events from outside Railway?** This profile accepts SDK traffic only
through private ingress in the same Railway environment. Do not expose port 8081.

**Can I use this for customers' applications?** This template is intended for
monitoring your own applications. Do not offer Sentry as a hosted service to third
parties. Read the upstream license for permitted purposes.

**Can I change versions independently?** Keep the Sentry-family releases coordinated.
Back up volumes and both buckets first. See [recovery](/reference/RECOVERY.md).

**Does restarting preserve data?** The runtime uses persistent stores. Persistence
is not a backup. Recovery must verify the saved error, log and trace plus new data.

## Troubleshooting

| Symptom | Check |
| --- | --- |
| Gateway not ready | Find the failed Railway service and read its startup logs. Bootstrap waits for migrations and workers. Do not run concurrent manual migrations. |
| No telemetry | Confirm DSN key/project ID, private port 8081 and the application's Railway environment. Check each telemetry view separately. |
| Login fails | Use web's generated credentials. Updating `ADMIN_PASSWORD` does not reset an existing user. See [password reset](/reference/OPERATIONS.md#mail-and-password-reset). |
| Missing older data | Check indexed retention and Kafka consumer lag. Expired queue records cannot be recreated. |
| No invitation email | Configure and test SMTP using [operations](/reference/OPERATIONS.md#mail-and-password-reset). |

