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/install/chef.md, or by sending Accept: text/markdown to https://grafana.com/docs/grafana-cloud/send-data/alloy/set-up/install/chef/. 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.
Install Grafana Alloy with Chef
You can use Chef to install and manage Alloy.
Before you begin
- These steps assume you already have a working Chef setup.
- You can add the following resources to any recipe.
- These tasks install Alloy from the package repositories.
The tasks target Linux systems from the following families:
- Debian, including Ubuntu
- RedHat Enterprise Linux, including Fedora
- Amazon Linux
Steps
To add Alloy to a host:
Add the following resources to your Chef recipe to add the Grafana package repositories to your system:
rubyif platform_family?('debian', 'rhel', 'amazon', 'fedora') if platform_family?('debian') remote_file '/etc/apt/keyrings/grafana.gpg' do source 'https://apt.grafana.com/gpg.key' mode '0644' action :create end file '/etc/apt/sources.list.d/grafana.list' do content "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com/ stable main" mode '0644' notifies :update, 'apt_update[update apt cache]', :immediately end apt_update 'update apt cache' do action :nothing end elsif platform_family?('rhel', 'amazon', 'fedora') yum_repository 'grafana' do description 'grafana' baseurl 'https://rpm.grafana.com' gpgcheck true gpgkey 'https://rpm.grafana.com/gpg.key' enabled true action :create notifies :run, 'execute[add-rhel-key]', :immediately end execute 'add-rhel-key' do command "rpm --import https://rpm.grafana.com/gpg.key" action :nothing end end else fail "The #{node['platform_family']} platform is not supported." endAdd the following resources to install and enable the
alloyservice:rubypackage 'alloy' do action :install flush_cache [ :before ] if platform_family?('amazon', 'rhel', 'fedora') notifies :restart, 'service[alloy]', :delayed end service 'alloy' do service_name 'alloy' action [:enable, :start] end
Configuration
The alloy package installs a default configuration file that doesn’t send telemetry anywhere.
The default configuration file location is /etc/alloy/config.alloy.
You can replace this file with your own configuration or create a configuration file for the service to use.
Next steps
Was this page helpful?
Related resources from Grafana Labs


