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
- Add the Grafana Advanced Package Tool (APT) or RPM Package Manager (RPM) package repository following the linked instructions.
- Install Loki
Using
dnfdnf update dnf install lokiUsing
apt-getapt-get update apt-get install loki
Install manually
Browse to the release page.
Find the Assets section for the version that you want to install.
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.
Extract the package contents into a directory. This is where Loki will run.
In the command line, change directory (
cdon 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.yamlURL to download the configuration file.wget https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yamlRun the following command to start Loki:
Windows