Open source

Install Grafana Loki locally

You can use Grafana Cloud to avoid installing, maintaining, and scaling your own instance of Grafana Loki. Create a free account to get started, which includes free forever access to 10k metrics, 50GB logs, 50GB traces, 500VUh k6 testing & more.

To log events with Grafana Loki, download and install Loki.

  • Loki is the logging engine.
  • Grafana Alloy is recommended for sending logs to Loki.

The configuration runs Loki as a single binary.

Note

Grafana Loki does not come with any included authentication layer. You must run an authenticating reverse proxy in front of your services to prevent unauthorized access to Loki (for example, nginx). Refer to Manage authentication for a list of open-source reverse proxies you can use.

Install using APT or RPM package manager

  1. Add the Grafana Advanced Package Tool (APT) or RPM Package Manager (RPM) package repository following the linked instructions.
  2. Install Loki
    1. Using dnf

      Bash
      dnf update
      dnf install loki
    2. Using apt-get

      Bash
      apt-get update
      apt-get install loki

Install manually

  1. Browse to the release page.

  2. Find the Assets section for the version that you want to install.

  3. Download the Loki archive file that corresponds to your system.

    Don’t download LogCLI or Loki Canary at this time. LogCLI allows you to run Loki queries in a command line interface. Loki Canary is a tool to audit Loki performance.

  4. Extract the package contents into a directory. This is where Loki will run.

  5. In the command line, change directory (cd on most systems) to the directory with Loki.

    Copy and paste the following command into your command line to download a generic configuration file.

    Use the Git references that match your downloaded Loki version to get the correct configuration file. For example, if you are using Loki version 3.7.0, you need to use the https://raw.githubusercontent.com/grafana/loki/v3.7.0/cmd/loki/loki-local-config.yaml URL to download the configuration file.

    Bash
    wget https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml
  6. Run the following command to start Loki:

    Windows

    Bash