---
title: "Run Grafana Alloy in a Docker container | Grafana Alloy documentation"
description: "Learn how to run Grafana Alloy in a Docker container"
---

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

# Run Grafana Alloy in a Docker container

Alloy is available as a Docker container image on the following platforms:

- [Linux containers](#run-a-linux-docker-container) for AMD64, ARM64, ppc64le, and s390x.
- macOS for AMD64 on Intel and ARM64 on Apple Silicon using [Docker Desktop](https://www.docker.com/products/docker-desktop/).
- [Windows containers](#run-a-windows-docker-container) for AMD64.

> Note
> 
> On macOS, Docker Desktop manages a Linux virtual machine transparently, so the Linux container commands work without modification.

## Before you begin

- Install [Docker](https://www.docker.com/) or [Docker Desktop](https://www.docker.com/products/docker-desktop/) on your computer.
- Create and save an Alloy configuration file on your computer, for example:
  
  Alloy ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
  
  ```alloy
  logging {
    level  = "info"
    format = "logfmt"
  }
  ```

## Run a Linux Docker container

To run Alloy as a Linux Docker container, run the following command in a terminal window:

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

```shell
docker run \
  -v <CONFIG_FILE_PATH>:/etc/alloy/config.alloy \
  -p 12345:12345 \
  grafana/alloy:latest \
    run --server.http.listen-addr=0.0.0.0:12345 --storage.path=/var/lib/alloy/data \
    /etc/alloy/config.alloy
```

Replace the following:

- *`<CONFIG_FILE_PATH>`* : The path of the configuration file on your host system.

Docker passes everything after the image name to the Alloy binary as the `run` command and its arguments. You can change them as needed. Refer to the documentation for [run](../../../reference/cli/run/) for more information about the options available to the `run` command.

> Note
> 
> Make sure you pass `--server.http.listen-addr=0.0.0.0:12345` as an argument as shown in the example. If you don’t pass this argument, the [debugging UI](../../../troubleshoot/debug/#alloy-ui) won’t be available outside the Docker container.

### BoringCrypto images

> Note
> 
> BoringCrypto support is in *Public preview* and is only available for Linux containers on AMD64 and ARM64.

Every release starting with version 1.10 includes BoringCrypto images:

- The `grafana/alloy:boringcrypto` tag always points to the most recent stable release.
- The `grafana/alloy:<VERSION>-boringcrypto` tag pins a specific version, for example `grafana/alloy:v1.1.0-boringcrypto`.

### Distroless images

> **EXPERIMENTAL**: Distroless images are [experimental](/docs/release-life-cycle/). Experimental features are subject to frequent breaking changes, and may be removed with no equivalent replacement.

> Note
> 
> BoringCrypto variants of distroless images are only available on AMD64 and ARM64 platforms.

Distroless images are stripped-down container images containing only the essential runtime dependencies required by Alloy. They use the same entrypoint, configuration path, and storage path as the standard image, so the `docker run` command is the same.

Every release starting with version 1.20 includes distroless images:

- The `grafana/alloy:latest-distroless` tag always points to the most recent stable Alloy version.
- The `grafana/alloy:<VERSION>-distroless` tag pins a specific Alloy version.
- The `grafana/alloy:boringcrypto-distroless` tag always points to the most recent stable Alloy version with BoringCrypto.
- The `grafana/alloy:<VERSION>-boringcrypto-distroless` tag pins a specific Alloy version with BoringCrypto.

## Run a Windows Docker container

The Windows image uses a Windows Server 2022 base image, so the host must be a Windows Server 2022 system or a Windows version that supports `ltsc2022` containers.

To run Alloy as a Windows Docker container, run the following command in a Command Prompt or PowerShell window:

Command PromptPowerShell

Command Prompt PowerShell

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

```cmd
docker run ^
  -v "<CONFIG_FILE_PATH>:C:\Program Files\GrafanaLabs\Alloy\config.alloy" ^
  -p 12345:12345 ^
  grafana/alloy:windowsservercore-ltsc2022 ^
    run --server.http.listen-addr=0.0.0.0:12345 "--storage.path=C:\ProgramData\GrafanaLabs\Alloy\data" ^
    "C:\Program Files\GrafanaLabs\Alloy\config.alloy"
```

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

```powershell
docker run `
  -v "<CONFIG_FILE_PATH>:C:\Program Files\GrafanaLabs\Alloy\config.alloy" `
  -p 12345:12345 `
  grafana/alloy:windowsservercore-ltsc2022 `
    run --server.http.listen-addr=0.0.0.0:12345 "--storage.path=C:\ProgramData\GrafanaLabs\Alloy\data" `
    "C:\Program Files\GrafanaLabs\Alloy\config.alloy"
```

Replace the following:

- *`<CONFIG_FILE_PATH>`* : The path of the configuration file on your host system.

Docker passes everything after the image name to the Alloy binary as the `run` command and its arguments. You can change them as needed. Refer to the documentation for [run](../../../reference/cli/run/) for more information about the options available to the `run` command.

> Note
> 
> Make sure you pass `--server.http.listen-addr=0.0.0.0:12345` as an argument as shown in the example. If you don’t pass this argument, the [debugging UI](../../../troubleshoot/debug/#alloy-ui) won’t be available outside the Docker container.

Every release includes Windows images:

- The `grafana/alloy:windowsservercore-ltsc2022` tag always points to the most recent stable Alloy version.
- The `grafana/alloy:<VERSION>-windowsservercore-ltsc2022` tag pins a specific Alloy version.

## Verify

To verify that Alloy is running successfully, navigate to [http://localhost:12345](http://localhost:12345) and make sure the Alloy [UI](../../../troubleshoot/debug/) loads without error.

## Next steps

- [Configure Alloy](../../../configure/)
