DropVPS Team
Writer: John hens
How to install Grafana Loki on Debian 13

Table of Contents
Grafana Loki is a powerful log aggregation system designed to be efficient and scalable. This guide will walk you through installing Loki and Promtail on Debian 13 in a simple and clear way so you can centralize your system logs quickly.
Step 1: Update Your System
Keeping your Debian 13 system updated ensures stability and prevents errors during the installation of Grafana Loki.
sudo apt update && sudo apt upgrade -y
Step 2: Install Required Dependencies
Install essential tools like wget and tar to download and extract Loki and Promtail without issues.
sudo apt install wget tar -y
Step 3: Download Grafana Loki
Download the latest Loki and Promtail binaries from the official Grafana repository to ensure you are using the most stable and up-to-date versions.
wget https://github.com/grafana/loki/releases/latest/download/loki-linux-amd64.zip
wget https://github.com/grafana/loki/releases/latest/download/promtail-linux-amd64.zip
Step 4: Extract Loki and Promtail
Unzip the downloaded packages so that the binaries are ready for installation and configuration.
unzip loki-linux-amd64.zip
unzip promtail-linux-amd64.zip
Step 5: Make Loki Promtail Executable
Move the Loki and Promtail binaries to a system path and set executable permissions to run them properly.
sudo mv loki-linux-amd64 /usr/local/bin/loki
sudo mv promtail-linux-amd64 /usr/local/bin/promtail
sudo chmod +x /usr/local/bin/loki /usr/local/bin/promtail
Step 6: Configure Loki
Create a basic configuration file for Loki to define how logs are stored and managed.
sudo nano /etc/loki-config.yml
Add:
auth_enabled: false
server:
http_listen_port: 3100
ingester:
wal:
enabled: true
lifecycler:
ring:
kvstore:
store: inmemory
schema_config:
configs:
- from: 2022-01-01
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
filesystem:
directory: /var/lib/loki
limits_config:
ingestion_rate_mb: 10
ingestion_burst_size_mb: 20
Step 7: Create a Systemd Service for Loki
Creating a systemd service ensures Loki starts automatically on boot and runs reliably in the background.
sudo nano /etc/systemd/system/loki.service
Add:
[Unit]
Description=Loki Log Aggregation System
After=network.target
[Service]
ExecStart=/usr/local/bin/loki -config.file=/etc/loki-config.yml
Restart=always
[Install]
WantedBy=multi-user.target
Step 8: Create Promtail Configuration File
Promtail collects system logs and sends them to Loki, allowing centralized log management and easy monitoring of your server activities.
sudo nano /etc/promtail-config.yml
Add:
server:
http_listen_port: 9080
clients:
- url: http://localhost:3100/loki/api/v1/push
positions:
filename: /var/log/positions.yaml
scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: system
__path__: /var/log/*log