Install and run Grafana Loki locally
In order to log events with Grafana Loki, download and install both Promtail and Loki.
- Loki is the logging engine.
- Promtail sends logs to Loki.
The configuration specifies running Loki as a single binary.
Navigate to the release page.
Scroll down to the Assets section under the version that you want to install.
Download the Loki and Promtail .zip files that correspond to your system. Note: Do not 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.
Unzip the package contents into the same directory. This is where the two programs will run.
In the command line, change directory (
cdon most systems) to the directory with Loki and Promtail. Copy and paste the commands below into your command line to download generic configuration files. Note: Use the corresponding Git refs that match your downloaded Loki version to get the correct configuration file. For example, if you are using Loki version 2.7.0, you need to use the
https://raw.githubusercontent.com/grafana/loki/v2.7.0/cmd/loki/loki-local-config.yamlURL to download the configuration file that corresponds to the Loki version you aim to run.
wget https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml wget https://raw.githubusercontent.com/grafana/loki/main/clients/cmd/promtail/promtail-local-config.yaml
Enter the following command to start Loki:
Loki runs and displays Loki logs in your command line and on http://localhost:3100/metrics.
The next step will be running an agent to send logs to Loki. To do so with Promtail, refer to get logs into Loki.
Release binaries - openSUSE Linux only
Every release includes binaries for Loki which can be found on the Releases page.
Community openSUSE Linux packages
The community provides packages of Loki for openSUSE Linux. To install:
- Add the repository
https://download.opensuse.org/repositories/security:/logging/to your system. For example, if you are using Leap 15.1, run
sudo zypper ar https://download.opensuse.org/repositories/security:/logging/openSUSE_Leap_15.1/security:logging.repo ; sudo zypper ref
- Install the Loki package with
zypper in loki
- Enable the Loki and Promtail services:
systemd start loki && systemd enable loki
systemd start promtail && systemd enable promtail
- Modify the configuration files as needed:
Related Loki resources
Getting started with logging and Grafana Loki (Part 3 of 4)
Join this webinar to learn why correlating metrics and logs is critical across the development lifecycle, and how Loki helps reduce logging costs and operations overhead.
Logging with Loki: Essential configuration settings
This webinar focuses on Grafana Loki configuration including agents Promtail and Docker; the Loki server; and Loki storage for popular backends.