---
title: "Docker OpenTelemetry LGTM | OpenTelemetry documentation"
description: "An OpenTelemetry backend in a Docker image."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Docker OpenTelemetry LGTM

The Grafana [docker-otel-lgtm](https://github.com/grafana/docker-otel-lgtm/) project provides an open source backend for OpenTelemetry in a Docker image. This project is the easiest way to set up an OpenTelemetry backend with an OpenTelemetry Collector, Grafana, Loki, Mimir, and Tempo for self-managed development, demo, and testing environments. For production observability solutions, refer to the [insights documentation](./insights/).

## Get the Docker image

The Docker image is available on Docker Hub: [https://hub.docker.com/r/grafana/otel-lgtm](https://hub.docker.com/r/grafana/otel-lgtm)

## Run the Docker image

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
# Unix/Linux
./run-lgtm.sh

# Windows (PowerShell)
./run-lgtm

# Using mise (Unix/Linux)
mise run lgtm
```

## Configuration

### Enable logging

Set the following environment variables to enable logging for various systems:

Expand table

| Environment Variable     | Enables Logging in      |
|--------------------------|-------------------------|
| `ENABLE_LOGS_GRAFANA`    | Grafana                 |
| `ENABLE_LOGS_LOKI`       | Loki                    |
| `ENABLE_LOGS_PROMETHEUS` | Prometheus              |
| `ENABLE_LOGS_TEMPO`      | Tempo                   |
| `ENABLE_LOGS_PYROSCOPE`  | Pyroscope               |
| `ENABLE_LOGS_OTELCOL`    | OpenTelemetry Collector |
| `ENABLE_LOGS_ALL`        | All of the above        |

These variables don’t affect application logs, which OpenTelemetry collects separately.

### Send data to Grafana Cloud

Find the values for the environment variables in your [Grafana Cloud account](/docs/grafana-cloud/send-data/otlp/send-data-otlp/#manual-opentelemetry-setup-for-advanced-users).

### Persist data across container instantiation

The components in the repository write their data to the `/data` directory. To persist data across container restarts, mount a volume to the `/data` directory. Note that this image is intended for development, demo, and testing environments.

## Run lgtm in Kubernetes

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
# create k8s resources
kubectl apply -f k8s/lgtm.yaml

# port forwarding
kubectl port-forward service/lgtm 3000:3000 4317:4317 4318:4318

# Using mise
mise k8s-apply
mise k8s-port-forward
```

## Send OpenTelemetry Data

You don’t need to configure anything. The Docker image works with OpenTelemetry’s defaults.

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
# Not needed as these are the defaults in OpenTelemetry:
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
```

## View Grafana

Log in to [http://localhost:3000](http://localhost:3000) with user *admin* and password *admin*.

## Build the Docker image from scratch

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
cd docker/
docker build . -t grafana/otel-lgtm

# Using mise
mise build-lgtm
```

## Build and run the example app

You can run everything together using [mise](https://mise.jdx.dev/), with `mise run all`.

Run the example REST service:

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
# Unix/Linux
./run-example.sh

# Windows (PowerShell)
./run-example

# Using mise (Unix/Linux)
mise run example
```

Generate traffic:

sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```sh
# Unix/Linux
./generate-traffic.sh

# Windows (PowerShell)
./generate-traffic

# Using mise (Unix/Linux)
mise run generate-traffic
```

You can use [OTel Checker](https://github.com/grafana/otel-checker/) to verify your instrumentation.

## Run example apps in different languages

The example apps are in the `examples/` directory. Each example has a `run.sh` or `run.cmd` script to start the app.

Every example implements a rolldice service, which returns a random number between 1 and 6.

Each example uses a different application port so you can run all applications at the same time.

Expand table

| Example | Service URL                           |
|---------|---------------------------------------|
| Java    | `curl http://localhost:8080/rolldice` |
| Go      | `curl http://localhost:8081/rolldice` |
| Python  | `curl http://localhost:8082/rolldice` |
| dotnet  | `curl http://localhost:8083/rolldice` |

## Resources

- [Grafana Blog: An OpenTelemetry backend in a Docker image](/blog/2024/03/13/an-opentelemetry-backend-in-a-docker-image-introducing-grafana/otel-lgtm/)
- [Observability in under 5 seconds: Reflecting on a year of grafana/otel-lgtm](/blog/2025/07/08/observability-in-under-5-seconds-reflecting-on-a-year-of-grafana/otel-lgtm/)
- [Introduction to Metrics, Logs, Traces and Profiles in Grafana](https://github.com/grafana/intro-to-mltp)
