Run Grafana Alloy in a Docker container
Alloy is available as a Docker container image on the following platforms:
- Linux containers for AMD64, ARM64, ppc64le, and s390x.
- macOS for AMD64 on Intel and ARM64 on Apple Silicon using Docker Desktop.
- Windows containers 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 or Docker Desktop on your computer.
Create and save an Alloy configuration file on your computer, for example:
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:
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.alloyReplace 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 for more information about the options available to the run command.
Note
Make sure you pass
--server.http.listen-addr=0.0.0.0:12345as an argument as shown in the example. If you don’t pass this argument, the debugging 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:boringcryptotag always points to the most recent stable release. - The
grafana/alloy:<VERSION>-boringcryptotag pins a specific version, for examplegrafana/alloy:v1.1.0-boringcrypto.
Distroless images
EXPERIMENTAL: Distroless images are experimental. 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-distrolesstag always points to the most recent stable Alloy version. - The
grafana/alloy:<VERSION>-distrolesstag pins a specific Alloy version. - The
grafana/alloy:boringcrypto-distrolesstag always points to the most recent stable Alloy version with BoringCrypto. - The
grafana/alloy:<VERSION>-boringcrypto-distrolesstag 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:
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"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 for more information about the options available to the run command.
Note
Make sure you pass
--server.http.listen-addr=0.0.0.0:12345as an argument as shown in the example. If you don’t pass this argument, the debugging UI won’t be available outside the Docker container.
Every release includes Windows images:
- The
grafana/alloy:windowsservercore-ltsc2022tag always points to the most recent stable Alloy version. - The
grafana/alloy:<VERSION>-windowsservercore-ltsc2022tag pins a specific Alloy version.
Verify
To verify that Alloy is running successfully, navigate to http://localhost:12345 and make sure the Alloy UI loads without error.