---
title: "Run a scenario | Grafana Alloy documentation"
description: "Clone the alloy-scenarios repository and run a Grafana Alloy scenario"
---

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

# Run a scenario

Every scenario is in the [alloy-scenarios](https://github.com/grafana/alloy-scenarios) repository. Each scenario directory has its own configuration, backends, and README.

## Before you begin

Ensure you have the following:

- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/) for Docker-based scenarios
- Git
- kind, kubectl, and Helm for Kubernetes scenarios

## Start a Docker-based scenario

1. Clone the repository and change to its root directory:
   
   shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   git clone https://github.com/grafana/alloy-scenarios.git
   cd alloy-scenarios
   ```
2. Start the scenario with the image versions pinned in `image-versions.env`:
   
   shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```shell
   ./run-example.sh <SCENARIO_DIRECTORY>
   ```
   
   Replace *`<SCENARIO_DIRECTORY>`* with the scenario path, for example `logs-file`.
3. Open Grafana at [http://localhost:3000](http://localhost:3000) and the Alloy UI at [http://localhost:12345](http://localhost:12345). You don’t need to log in to Grafana. Refer to the scenario README for additional endpoints.

## Stop a scenario

From the repository root, run:

shell ![Copy code to clipboard](https://grafana.com/media/images/icons/icon-copy-small-2.svg) Copy

```shell
cd <SCENARIO_DIRECTORY> && docker compose down
```

## Start a Kubernetes scenario

Kubernetes scenarios are in the `k8s/` directory. Follow the README in the scenario directory.
