Deploy & Host Pyroscope | Railway

Deploy and Host Pyroscope on Railway

Grafana Pyroscope is an open-source continuous profiling database. Your applications send CPU, memory and other profiles through SDKs for Go, Python, Node.js, Java, Ruby, .NET and Rust, and Pyroscope shows them as flame graphs over time. It helps you find the exact functions that cost CPU, memory or latency in production.

About Hosting Pyroscope

This template deploys Pyroscope v2.3.1 in single-binary mode with v2 filesystem storage on a Railway volume, plus a Caddy gateway that is the only public entry point. The gateway has two logins. admin opens the web UI. ingest is used by SDKs to push profiles and cannot open the UI. Both passwords are generated at deploy time. Profiles are kept for 14 days. Pyroscope starts in about a minute and runs as root so it can write to the volume. Storage grows with the number of profiled services, so watch the volume on the Hobby plan (5 GB).

Common Use Cases

Dependencies for Pyroscope Hosting

Deployment Dependencies

Implementation Details

Service Image Networking Storage
pyroscope grafana/pyroscope:2.3.1 private only, port 4040 volume at /data
gateway caddy:2.11.4-alpine public domain on 8080 none

Python example:

import pyroscope
pyroscope.configure(
    application_name="my-app",
    server_address="https://",
    basic_auth_username="ingest",
    basic_auth_password="",
)

Go (grafana/pyroscope-go): set ServerAddress, BasicAuthUser: "ingest" and BasicAuthPassword. Services on Railway can instead push to ${{pyroscope.PYROSCOPE_PRIVATE_URL}} without credentials.

Variable Service Default Purpose
PYROSCOPE_UI_USERNAME / PYROSCOPE_UI_PASSWORD gateway admin / generated Web UI login
PYROSCOPE_INGEST_USERNAME / PYROSCOPE_INGEST_PASSWORD gateway ingest / generated SDK push credentials (/ingest, /push.v1.PusherService/*)
CADDYFILE gateway gateway config Routing and auth

Notes:

This is a community-maintained deployment package and does not imply affiliation with or endorsement by Grafana Labs.

Why Deploy Pyroscope 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 Pyroscope 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.