Docker Compose

This guide will help you set up pyroscope with Docker Compose.

Pyroscope consists of 2 parts:

  • Pyroscope Server — database + UI that stores and visualizes profiling data
  • Pyroscope Agent — software that profiles your application


Check out the examples folder in our repository for examples of go, ruby and python apps running in docker with pyroscope.

Adding Pyroscope to your docker-compose file

Step 1. Adding Pyroscope Server to Docker Compose

Add pyroscope service and expose port 4040:

image: "pyroscope/pyroscope:latest"
- "4040:4040"
- "server"

Step 2. Adding Pyroscope Agent to your existing application

If you're using Go, add this code to your application:

package main
import ""
func main() {
ApplicationName: "backend.purchases", # change this to your app name
ServerAddress: "http://pyroscope:4040",
// your code goes here