Grafana Stack

One-click observability with Loki, Prometheus, Tempo, and Grafana

Deploy Grafana Stack

Grafana

MykalMachon/railway-grafana-stack

Just deployed

/var/lib/grafana/

Loki

MykalMachon/railway-grafana-stack

Just deployed

/loki

Prometheus

MykalMachon/railway-grafana-stack

Just deployed

/prometheus

Tempo

MykalMachon/railway-grafana-stack

Just deployed

/var/tempo

Deploy and Host Grafana Stack on Railway

A complete observability stack including Grafana, Loki, Prometheus, and Tempo - all pre-configured and ready to monitor your Railway applications with comprehensive dashboards, logging, metrics, and distributed tracing capabilities.

About Hosting Grafana Stack

Hosting a Grafana Stack involves deploying four integrated observability services: Grafana for visualization and dashboards, Loki for log aggregation, Prometheus for metrics collection, and Tempo for distributed tracing. This template handles all the complex configuration and service interconnections automatically, providing persistent storage for all components and exposing internal URLs for easy integration with your other Railway applications. The stack comes pre-configured with useful Grafana plugins and sensible defaults for production use.

Common Use Cases

  • Application Performance Monitoring: Track metrics, logs, and traces across your entire Railway application stack
  • Infrastructure Observability: Monitor system health, resource usage, and service dependencies in real-time
  • Debugging and Troubleshooting: Correlate logs, metrics, and traces to quickly identify and resolve issues
  • Business Intelligence Dashboards: Create custom dashboards to visualize application and business metrics
  • Alerting and Incident Response: Set up proactive alerts based on metrics and log patterns

Dependencies for Grafana Stack Hosting

  • Railway Volumes for persistent data storage across all services
  • Docker images for Grafana, Loki, Prometheus, and Tempo (versions controlled via environment variables)

Deployment Dependencies

Implementation Details

Quick Start Guide

  1. Click "Deploy on Railway" and enter your desired Grafana admin username in GF_SECURITY_ADMIN_USER
  2. Wait 3-5 minutes for deployment, then access Grafana using the provided Railway URL
  3. Log in with your admin username and the auto-generated GF_SECURITY_ADMIN_PASSWORD
  4. Connect your applications using the exposed internal URLs

Environment Variables

VariableDescriptionDefault
GF_SECURITY_ADMIN_USERGrafana admin usernameRequired input
GF_SECURITY_ADMIN_PASSWORDGrafana admin passwordAuto-generated
GF_DEFAULT_INSTANCE_NAMEGrafana instance nameGrafana on Railway
GF_INSTALL_PLUGINSComma-separated Grafana pluginsPre-configured useful plugins

Internal Service URLs

The template exposes these variables for connecting your Railway applications:

# Reference these in your other Railway services
LOKI_URL=${{Grafana.LOKI_INTERNAL_URL}}
PROMETHEUS_URL=${{Grafana.PROMETHEUS_INTERNAL_URL}}
TEMPO_URL=${{Grafana.TEMPO_INTERNAL_URL}}

# Tempo-specific ingest endpoints
TEMPO_HTTP_INGEST=${{Tempo.INTERNAL_HTTP_INGEST}}
TEMPO_GRPC_INGEST=${{Tempo.INTERNAL_GRPC_INGEST}}

Version Control

Each service supports independent version pinning via VERSION environment variables:

  • Grafana: VERSION=11.5.2
  • Loki: VERSION=3.4.2
  • Prometheus: VERSION=v3.2.1
  • Tempo: VERSION=v2.7.1

Connecting Applications

For Logs: Use Locomotive to automatically ingest all Railway service logs into Loki without code changes.

For Traces: Configure OpenTelemetry libraries to send traces to Tempo's HTTP endpoint (/v1/traces) or GRPC endpoint using the provided internal URLs.

For Metrics: You'll have to fork the source GitHub repository and customize the Prometheus config. For more information on this, see below.

Customizing Your Stack

To customize the configuration of Loki, Prometheus, or Tempo:

  • Fork the GitHub repository
  • Modify the configuration files in their respective directories
  • In Railway, disconnect the service you want to customize
  • Reconnect the service to your forked repository
  • Deploy the updated service

The pre-configured Grafana connections will continue to work with your customized services.

Why Deploy Grafana Stack on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Grafana Stack on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
OpenTelemetry Collector and Backend
OpenTelemetry Collector with Backend Stack

View Template
pgweb | Postgres UI
View and query your Postgres instance with a sleek and minimalistic UI.

View Template
Elasticsearch-Kibana
Elasticsearch is a search engine based on the Lucene library.