Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/grafana-cloud/send-data/alloy/set-up/run/binary.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/send-data/alloy/set-up/run/binary/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
Run Grafana Alloy as a standalone binary
If you downloaded the standalone binary, you must run Alloy from a terminal or command window.
Refer to the run documentation for more information about the command line flags you can use when you run Alloy.
Start Alloy
To start Alloy, run the following command in a terminal or command window:
<BINARY_PATH> run <CONFIG_PATH>Replace the following:
<BINARY_PATH>: The path to the Alloy binary file.<CONFIG_PATH>: The path to the Alloy configuration file.
Set up Alloy as a Linux systemd service
You can set up and manage the standalone binary for Alloy as a Linux systemd service.
Note
These steps assume you have a default systemd and Alloy configuration.
To create a user called
alloyrun the following command in a terminal window:shellsudo useradd --no-create-home --shell /bin/false alloyCreate a service file in
/etc/systemd/systemcalledalloy.servicewith the following contents:systemd[Unit] Description=Vendor-neutral programmable observability pipelines. Documentation=https://grafana.com/docs/alloy/ Wants=network-online.target After=network-online.target [Service] Restart=always User=alloy Environment=HOSTNAME=%H EnvironmentFile=/etc/default/alloy WorkingDirectory=<WORKING_DIRECTORY> ExecStart=<BINARY_PATH> run $CUSTOM_ARGS --storage.path=<WORKING_DIRECTORY> $CONFIG_FILE ExecReload=/usr/bin/env kill -HUP $MAINPID TimeoutStopSec=20s [Install] WantedBy=multi-user.targetReplace the following:
<BINARY_PATH>: The path to the Alloy binary file.<WORKING_DIRECTORY>: The path to a working directory, for example/var/lib/alloy.
Create an environment file in
/etc/default/calledalloywith the following contents:shell## Path: ## Description: Grafana Alloy settings ## Type: string ## Default: "" ## ServiceRestart: alloy # # Command line options for alloy # # The configuration file holding the Grafana Alloy configuration. CONFIG_FILE="<CONFIG_PATH>" # User-defined arguments to pass to the run command. CUSTOM_ARGS="" # Restart on system upgrade. Defaults to true. RESTART_ON_UPGRADE=trueReplace the following:
<CONFIG_PATH>: The path to the Alloy configuration file.
To reload the service files, run the following command in a terminal window:
shellsudo systemctl daemon-reloadUse the Linux systemd commands to manage your standalone Linux installation of Alloy.
View Alloy logs
By default, Alloy writes the output to stdout and errors to stderr.
To write the output and error logs to a file, you can use the redirection operator for your operating system. For example, the following command combines the standard output and standard errors into a single text file:
<BINARY_PATH> run <CONFIG_PATH> &> <OUTPUT_FILE><BINARY_PATH> run <CONFIG_PATH> &> <OUTPUT_FILE><BINARY_PATH> run <CONFIG_PATH> 1> <OUTPUT_FILE> 2>&1Replace the following:
<BINARY_PATH>: The path to the Alloy binary file.<CONFIG_PATH>: The path to the Alloy configuration file.<OUTPUT_FILE>: The output filename.
Was this page helpful?
Related resources from Grafana Labs


