⚙️ Grafana Alloy Installation Guide (Ubuntu & Amazon Linux)
This guide covers installing Grafana Alloy on both Ubuntu/Debian and Amazon Linux distributions.
🐧 Ubuntu/Debian Installation
✅ Step 1: Install Required Packages
sudo apt update
sudo apt install -y gpg wget apt-transport-https
🔐 Step 2: Add Grafana GPG Key & 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.list
🔄 Step 3: Update Package List and Install Alloy
sudo apt-get update -y
sudo apt-get install -y alloy
▶️ Step 4: Start and Enable the Alloy Service
sudo systemctl start alloy
sudo systemctl enable alloy.service
sudo systemctl status alloy
🔁 Step 5: Restart or Reload Alloy
sudo systemctl restart alloy
# To reload config after changes:
sudo systemctl reload alloy
📜 View Alloy Logs
sudo journalctl -u alloy
☁️ Amazon Linux Installation
⚠️ Note: Amazon Linux does not support Debian
.deb
packages. Use binary installation instead.
✅ Step 1: Download and Install Alloy Binary
curl -LO https://github.com/grafana/alloy/releases/latest/download/alloy-linux-amd64.zip
unzip alloy-linux-amd64.zip
sudo mv alloy /usr/local/bin/
sudo chmod +x /usr/local/bin/alloy
📝 Step 2: Create a Systemd Service
Create /etc/systemd/system/alloy.service
:
[Unit]
Description=Grafana Alloy
After=network.target
[Service]
ExecStart=/usr/local/bin/alloy --config.file=/etc/alloy/config.alloy
Restart=always
User=root
[Install]
WantedBy=multi-user.target
▶️ Step 3: Enable and Start the Service
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable alloy
sudo systemctl start alloy
sudo systemctl status alloy
✅ Grafana Alloy is now installed and running! You can begin configuring it using /etc/alloy/config.alloy
.