---
title: "Deploy Grafana"
description: "Grafana with Loki, Tempo and Prometheus: logs, traces, metrics via OTLP"
category: "Observability"
url: https://railway.com/deploy/grafana-5
---

# Deploy Grafana

Grafana with Loki, Tempo and Prometheus: logs, traces, metrics via OTLP

**[Deploy Grafana on Railway](https://railway.com/template/grafana-5)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/grafana-5/manifest.json

- **Creator:** Dektion
- **Category:** Observability
- **Total deploys:** 1

## Template content

### Tempo

- **Source:** dektionstudio/railway-template-images
- **Health check:** /ready

### Collector

- **Source:** dektionstudio/railway-template-images
- **Health check:** /
- **Public domain:** Yes

### Prometheus https://devicons.railway.com/i/prometheus.svg

- **Source:** dektionstudio/railway-template-images
- **Health check:** /-/ready

### Grafana https://devicons.railway.com/i/grafana.svg

- **Source:** dektionstudio/railway-template-images
- **Health check:** /api/health
- **Public domain:** Yes

### Loki

- **Source:** dektionstudio/railway-template-images
- **Health check:** /ready

## Documentation

# Deploy and Host Grafana on Railway

[Grafana](https://github.com/grafana/grafana) with [Loki](https://github.com/grafana/loki), [Tempo](https://github.com/grafana/tempo) and [Prometheus](https://github.com/prometheus/prometheus) is the open-source observability stack: logs, traces and metrics from your apps in one place, sent over OpenTelemetry. This template runs all four plus an OpenTelemetry Collector on Railway, wired together and ready to receive data.

## About Hosting Grafana

The template runs five services, all official images pinned to current releases (Grafana 13.3.1, Loki 3.7.10, Tempo 3.1.1, Prometheus 3.16.0, Collector 0.165.0). The OpenTelemetry Collector is the only public ingest endpoint: your apps send OTLP over HTTPS to `OTLP_ENDPOINT` with the generated `INGEST_TOKEN` as a bearer token, and requests without it get a 401.

Behind it, Tempo stores traces, Loki stores logs (its OTLP endpoint keeps attributes as labels) and Prometheus stores metrics, including the span metrics and service graphs Tempo writes to it. They stay private on Railway's network, each with its own volume. Grafana has them provisioned as linked data sources, so from a trace you jump to its logs and metrics, and from a metric exemplar to its trace. Sign in with `GF_SECURITY_ADMIN_USER` and the generated `GF_SECURITY_ADMIN_PASSWORD`; sign-up and anonymous access are off.

Retention is set so the volumes don't fill up: Loki deletes logs after 30 days (`LOKI_RETENTION_PERIOD`) and Prometheus keeps 30 days or 4 GB (`PROMETHEUS_RETENTION_TIME` / `_SIZE`), whichever comes first. Raise them together with the volumes on a Pro plan.

Before publishing I tested it on Railway. Grafana's API returned 401 without a login and listed the three data sources with one. The collector returned 401 for OTLP without the token. With the token I sent a trace, a log line and a gauge metric over OTLP/HTTP; through Grafana's data source proxy the trace came back from Tempo, the log from Loki and the metric (42) from Prometheus within a second. After restarting all five services at once, the trace, the log and the metric were all still there.

Idle, the stack used about 1 GB of RAM in total (most of it Grafana), a little over $10 a month on Railway's usage pricing; it grows with how much you send.

To point an app at it, set the standard OpenTelemetry variables:

```
OTEL_EXPORTER_OTLP_ENDPOINT=
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Bearer 
OTEL_SERVICE_NAME=my-app
```

## Common Use Cases

- Logs, traces and metrics for the apps you run on Railway, in one Grafana
- Tracing LLM and agent calls instrumented with OpenTelemetry
- A cheaper self-hosted alternative to a hosted observability plan for a small team
- Alerts on error rates or slow endpoints with Grafana alerting, sent to Slack or a webhook

## Dependencies for Grafana Hosting

Apps instrumented with OpenTelemetry (SDKs exist for every major language, and many frameworks and AI libraries emit OTLP directly).

### Deployment Dependencies

- Grafana: https://github.com/grafana/grafana
- Loki: https://github.com/grafana/loki
- Tempo: https://github.com/grafana/tempo
- Prometheus: https://github.com/prometheus/prometheus
- OpenTelemetry Collector: https://github.com/open-telemetry/opentelemetry-collector-contrib
- The wrappers this template builds (one config each): https://github.com/dektionstudio/railway-template-images (folders `lgtm-*`)

### Implementation Details

```
GRAFANA_URL                    # open this and sign in
OTLP_ENDPOINT / INGEST_TOKEN   # where apps send data, and the bearer token they need
Tempo, Loki, Prometheus        # private, each on its own volume
LOKI_RETENTION_PERIOD          # 720h by default
PROMETHEUS_RETENTION_SIZE/TIME # 4GB / 30d by default
```

## Why Deploy Grafana on Railway?

The whole stack comes up wired together, with the ingest endpoint behind a token and the storage services off the public internet. Railway bills the resources it uses, which for a small team's telemetry is a few services idling most of the day.


## Similar templates

- [Rootprint](https://railway.com/deploy/rootprint-1) — Open-source logs and traces with full-text search on object-storage.
- [Pyroscope profiling](https://railway.com/deploy/pyroscope-profiling) — Protected continuous profiling with durable Pyroscope storage.
- [SigOnly](https://railway.com/deploy/sigonly) — Deploy SigNoz with a working demo app & config in one click

Open this page in a browser: https://railway.com/deploy/grafana-5
