Run Grafana Alloy in a Podman container
Podman is a container engine that runs without a daemon for developing, managing, and running Open Container Initiative (OCI) containers. You can use Podman as a drop-in replacement for Docker to run Alloy.
Alloy is available as a Docker container image that you can use with Podman on the following platforms:
- Linux for AMD64 and ARM64.
- macOS for AMD64 (Intel) and ARM64 (Apple Silicon).
- Windows for AMD64.
Note
On macOS and Windows, Podman runs containers in a Linux virtual machine managed by
podman machine. The container commands are the same across all platforms once the machine is running.
Before you begin
Install Podman or Podman Desktop on your computer.
On macOS or Windows, initialize and start the Podman machine:
podman machine init podman machine startCreate and save an Alloy configuration file on your computer, for example:
logging { level = "info" format = "logfmt" }
Run a rootless Podman container
One of the key features of Podman is the ability to run containers without root privileges. To run Alloy as a rootless Podman container, run the following command in a terminal window:
podman run \
-v <CONFIG_FILE_PATH>:/etc/alloy/config.alloy:Z \
-p 12345:12345 \
docker.io/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 absolute path of the configuration file on your host system.
Note
The
:Zsuffix on the volume mount is required on Linux systems with Security-Enhanced Linux enabled (such as Fedora, RHEL, and CentOS) to set the correct security context for the mounted file.If you’re running on macOS, Windows, or a Linux system without Security-Enhanced Linux, you can omit the
:Zsuffix.
You can modify the last line to change the arguments passed to the Alloy binary.
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][UI] won’t be available outside of the Podman container.
Run a Podman container with root privileges
If you need to run Alloy with root privileges, for example to access host-level resources, run the following command:
sudo podman run \
-v <CONFIG_FILE_PATH>:/etc/alloy/config.alloy:Z \
-p 12345:12345 \
docker.io/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 absolute path of the configuration file on your host system.
Run with systemd integration on Linux
On Linux, Podman integrates with systemd to manage containers as services. To generate a systemd unit file for Alloy:
Run the container with a name:
podman run -d --name alloy \ -v <CONFIG_FILE_PATH>:/etc/alloy/config.alloy:Z \ -p 12345:12345 \ docker.io/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 absolute path of the configuration file on your host system.
Generate a systemd unit file:
podman generate systemd --name alloy --files --newMove the generated file to the systemd directory:
mv container-alloy.service ~/.config/systemd/user/Reload systemd and enable the service:
systemctl --user daemon-reload systemctl --user enable --now container-alloy.service
Use Podman Compose
If you prefer using Compose files, Podman supports Docker Compose files through podman-compose.
Create a
compose.yamlfile:services: alloy: image: docker.io/grafana/alloy:latest ports: - "12345:12345" volumes: - <CONFIG_FILE_PATH>:/etc/alloy/config.alloy:Z command: - 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 absolute path of the configuration file on your host system.
Run the container:
podman-compose up -d
BoringCrypto images
Note
BoringCrypto support is in Public preview and is only available on AMD64 and ARM64 platforms.
BoringCrypto images are published with every release starting with version 1.1:
- The current BoringCrypto image is published as
docker.io/grafana/alloy:boringcrypto. - A specific version of the BoringCrypto image is published as
docker.io/grafana/alloy:<VERSION>-boringcrypto, such asdocker.io/grafana/alloy:v1.1.0-boringcrypto.
Verify
To verify that Alloy is running successfully, navigate to http://localhost:12345 and make sure the Alloy UI loads without error.
You can also check the container status:
podman ps


