Deploy Pyroscope

Pyroscope 2.3 continuous profiling with volume storage and auth gateway.

Deploy Pyroscope

Just deployed

Just deployed

/data

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

  • Finding CPU hot spots and memory leaks in production services
  • Comparing profiles before and after a deploy to catch performance regressions
  • Adding profiling next to metrics and traces for full observability

Dependencies for Pyroscope Hosting

  • grafana/pyroscope:2.3.1 (official image) with a volume at /data
  • caddy:2.11.4-alpine (official image) as the authenticated gateway
  • A Pyroscope SDK or Grafana Alloy in your application

Deployment Dependencies

Implementation Details

ServiceImageNetworkingStorage
pyroscopegrafana/pyroscope:2.3.1private only, port 4040volume at /data
gatewaycaddy:2.11.4-alpinepublic domain on 8080none

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.

VariableServiceDefaultPurpose
PYROSCOPE_UI_USERNAME / PYROSCOPE_UI_PASSWORDgatewayadmin / generatedWeb UI login
PYROSCOPE_INGEST_USERNAME / PYROSCOPE_INGEST_PASSWORDgatewayingest / generatedSDK push credentials (/ingest, /push.v1.PusherService/*)
CADDYFILEgatewaygateway configRouting and auth

Notes:

  • The Pyroscope start command sets -architecture.storage=v2 -retention-period=14d -self-profiling.disable-push=true. Edit it to change retention or to turn self-profiling back on.
  • Pyroscope has no login of its own, which is why it stays private behind the gateway.
  • To use it from Grafana on Railway, add a Pyroscope data source pointing at the private URL.
  • Pyroscope sends anonymous usage statistics by default; add -usage-stats.enabled=false to the start command to turn them off.

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.


Template Content

More templates in this category

View Template
NEW
Rootprint
Open-source logs and traces with full-text search on object-storage.

Rootprint
1
View Template
Pyroscope profiling
Protected continuous profiling with durable Pyroscope storage.

Anton Orel
1
View Template
SigOnly
Deploy SigNoz with a working demo app & config in one click

zoeyjones
22