How to install Loki on EndeavourOS

Loki is a horizontally-scalable, highly-available, multi-tenant log aggregation system inspired by Prometheus. In this tutorial, we will walk you through how to install Loki on EndeavourOS.

Prerequisites

  • An EndeavourOS latest installed and updated system.
  • A user account with administrative privileges (sudo).

Step 1: Install Loki

  1. Open your terminal and update your system's package repository by running the following command:

    sudo pacman -Syu
    
  2. Install Loki by running the following command:

    sudo pacman -S loki
    

Step 2: Configure Loki

  1. Create a configuration file for Loki by running the following command:

    sudo nano /etc/loki/local-config.yaml
    

    and paste the following configuration there:

    server:
      http_listen_port: 3100
      grpc_listen_port: 9095
    
    auth_enabled: false
    
    ingester:
      lifecycler:
        address: 127.0.0.1
        ring:
          kvstore:
            store: inmemory
          replication_factor: 1
        final_sleep: 0s
      chunk_idle_period: 5m
      chunk_retain_period: 30s
    
    schema_config:
      configs:
        - from: 2021-01-01
          store: boltdb
          object_store: filesystem
          schema: v11
          index:
            prefix: index_
            period: 24h
    
    storage_config:
      boltdb:
        directory: /var/lib/loki/index
    
    limits_config:
      enforce_metric_name: false
      reject_old_samples: true
      reject_old_samples_max_age: 168h
    
    chunk_store_config:
      max_look_back_period: 0s
    
    table_manager:
      retention_deletes_enabled: false
      retention_period: 0s
    
  2. Save and exit the file.

Step 3: Run Loki

  1. Run the following command to start Loki:

    sudo systemctl start loki
    
  2. Check the status of Loki by running the following command:

    sudo systemctl status loki
    

Conclusion

In this tutorial, we have shown you how to install and configure Loki on EndeavourOS. Now that Loki is up and running, you can start sending logs to it and using its powerful querying and alerting features.