docs/sources/setup/install/local.md
To log events with Grafana Loki, download and install Loki.
The configuration runs Loki as a single binary.
{{< admonition type="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. {{< /admonition >}}
Using dnf
dnf update
dnf install loki
Using apt-get
apt-get update
apt-get install loki
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 (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.
wget https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml
Run the following command to start Loki:
Windows
.\loki-windows-amd64.exe --config.file=loki-local-config.yaml
Linux
./loki-linux-amd64 -config.file=loki-local-config.yaml
Loki runs and displays Loki logs in your command line and on http://localhost:3100/metrics.
The next step is running an agent to send logs to Loki. Refer to Grafana Alloy for the recommended log collection agent.
Every release includes binaries for Loki. You can find them on the Releases page.
The community provides packages of Loki for openSUSE Linux. To install them:
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:
zypper in loki
Start and enable the Loki service:
systemd start loki
systemd enable loki
Modify the /etc/loki/loki.yaml configuration file as needed.