Deploy Pyroscope
Pyroscope 2.3 continuous profiling with volume storage and auth gateway.
gateway
Just deployed
pyroscope
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/datacaddy:2.11.4-alpine(official image) as the authenticated gateway- A Pyroscope SDK or Grafana Alloy in your application
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:
- 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=falseto 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
gateway
caddy:2.11.4-alpinepyroscope
grafana/pyroscope:2.3.1
