Install Grafana Alloy on Linux
Grafana Learning Journeys provide a clear, structured path that leads you from beginner concepts to advanced use cases. Learn about this Grafana feature on Monitor a Linux server in Grafana Cloud.
You can install Alloy as a systemd service on Linux.
Before you begin
Some Debian-based cloud Virtual Machines don’t have GPG installed by default. To install GPG in your Linux Virtual Machine, run the following command in a terminal window.
sudo apt install gpgInstall
To install Alloy on Linux, run the following commands in a terminal window.
Import the GPG key and add the Grafana package repository.
sudo mkdir -p /etc/apt/keyrings/ wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.listwget -q -O gpg.key https://rpm.grafana.com/gpg.key sudo rpm --import gpg.key echo -e '[grafana]\nname=grafana\nbaseurl=https://rpm.grafana.com\nrepo_gpgcheck=1\nenabled=1\ngpgcheck=1\ngpgkey=https://rpm.grafana.com/gpg.key\nsslverify=1\nsslcacert=/etc/pki/tls/certs/ca-bundle.crt' | sudo tee /etc/yum.repos.d/grafana.repowget -q -O gpg.key https://rpm.grafana.com/gpg.key sudo rpm --import gpg.key sudo zypper addrepo https://rpm.grafana.com grafanaUpdate the repositories.
sudo apt-get updateyum updatesudo zypper updateInstall Alloy.
sudo apt-get install alloysudo dnf install alloysudo zypper -r grafana install alloy
Uninstall
To uninstall Alloy on Linux, run the following commands in a terminal window.
Stop the systemd service for Alloy.
sudo systemctl stop alloyUninstall Alloy.
sudo apt-get remove alloysudo dnf remove alloysudo zypper remove alloyOptional: Remove the Grafana repository.
sudo rm -i /etc/apt/sources.list.d/grafana.listsudo rm -i /etc/yum.repos.d/rpm.grafana.reposudo zypper removerepo grafana



