# 使用 Homebrew, apk, apt, Nix, pacman, zypper 安装 loki

查看 loki 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:loki
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install loki
```

  证据: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add loki
```

  证据: Alpine Linux edge package indexes: loki from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install loki
```

  证据: Debian stable package indexes: loki from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#loki
```

  证据: nixpkgs package indexes: pkgs/by-name/lo/loki/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S loki
```

  证据: Arch Linux sync databases: loki from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install loki
```

  证据: openSUSE Tumbleweed package metadata: loki from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:loki
- **软件包管理器:** Homebrew
- **版本:** 3.7.4
- **来源摘要:** Horizontally-scalable, highly-available log aggregation system
- **主页:** <https://grafana.com/oss/loki>
- **仓库:** <https://github.com/grafana/loki>
- **最后更新:** 2026-07-26T13:41:03+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- loki (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 3.7.4
## 项目历史与用法

Grafana Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus. Its core design indexes labels rather than full log contents, aiming to make log storage cheaper and easier to operate.

### 项目历史

Grafana Labs started Loki in 2018 and announced it at KubeCon Seattle. The official repository was created in April 2018 and describes the project as 'like Prometheus, but for logs.'

Loki was designed around labels, compressed unstructured logs, and integration with Grafana. The README explains that a Loki-based stack includes the Loki service, Grafana for querying and visualization, and a log collection agent; current docs identify Grafana Alloy as the forward-looking agent while Promtail is considered feature complete.

Grafana announced the general availability of Loki 1.0 in November 2019. By the 3.x series, Loki had grown into one of Grafana Labs' major OSS projects, with active documentation for single-binary, simple scalable, and microservices deployment modes.

### 采用历史

Loki's adoption followed cloud-native observability patterns: Prometheus users already had label conventions, Grafana dashboards, and a need to correlate metrics and logs without paying the storage cost of full-text log indexing.

Grafana's official OSS pages and yearly open-source recap describe Loki as a major Grafana Labs project, and the repository shows broad adoption with tens of thousands of stars, thousands of forks, active releases, and an `ADOPTERS.md` process for organizations using Loki.

The supplied package facts show package-manager availability through Homebrew, Alpine, Debian, Ubuntu, Arch, Nix, and openSUSE-related packaging, with `logcli` also packaged separately in some ecosystems.

### 使用方式

Loki is usually launched with a YAML configuration file, commonly called `loki.yaml`, passed through `-config.file`. The official README's source build example runs `./cmd/loki/loki -config.file=./cmd/loki/loki-local-config.yaml`, and the docs show Docker examples using `/etc/loki/local-config.yaml`.

Operators send logs to Loki with agents such as Grafana Alloy, then query them from Grafana using LogQL. Loki's distinction is that labels are indexed, while log lines remain compressed payloads.

### 为什么软件包爱好者会关心

For package nerds, Loki is the observability-era package that made 'logs as Prometheus-shaped data' a concrete binary and config file. It is large enough to need Helm charts, Docker images, agents, and CLI companions, but still keeps a recognizable single-service local mode for packaging and testing.

### 时间线

- 2018: Loki project starts at Grafana Labs and is announced at KubeCon Seattle.
- 2019: Grafana Labs announces Loki 1.0 general availability.
- 2022: Grafana Labs describes Loki as its second most popular OSS project behind Grafana.
- 2026: Loki 3.7.x releases are active in the official GitHub repository.

### Related projects

- Loki is designed to pair with Grafana for visualization and with Prometheus-style labels for correlation with metrics.
- Promtail was the original log collection agent in many Loki deployments, while Grafana Alloy is now the recommended forward-looking collector in the README.

### 来源

- <https://api.github.com/repos/grafana/loki>
- <https://github.com/grafana/loki#readme>
- <https://grafana.com/blog/grafana-labs-open-source-projects-2022/>
- <https://grafana.com/docs/loki/latest/>
- <https://grafana.com/docs/loki/latest/configure/>
- <https://grafana.com/oss/loki/>
- <https://grafana.com/press/2019/11/20/grafana-labs-announces-ga-release-of-loki-like-prometheus-but-for-logs/>
- source_facts.package-manager


## 安全说明

formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- formula declares a Homebrew service


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ./config.yaml, ./config/config.yaml, loki.yaml
## 其他软件包管理器记录

- Debian apt - loki - 2.4.7.4-12: normalized package name match | Debian stable package indexes: loki from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MCMC linkage analysis on general pedigrees
- Debian apt - loki-doc - 2.4.7.4-12: normalized package name match | Debian stable package indexes: loki-doc from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | MCMC linkage analysis on general pedigrees (PS manual)
- Nix - loki: normalized package name match | nixpkgs package indexes: pkgs/by-name/lo/loki/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - loki - 2.4.7.4-10: normalized package name match | Ubuntu 24.04 LTS package indexes: loki from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MCMC linkage analysis on general pedigrees
- Ubuntu apt - loki-doc - 2.4.7.4-10: normalized package name match | Ubuntu 24.04 LTS package indexes: loki-doc from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | MCMC linkage analysis on general pedigrees (PS manual)
- apk - loki - 3.7.3-r1: normalized package name match | Alpine Linux edge package indexes: loki from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Like Prometheus, but for logs | https://github.com/grafana/loki
- apk - loki-canary - 3.7.3-r1: normalized package name match | Alpine Linux edge package indexes: loki-canary from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Loki auditing program | https://github.com/grafana/loki
- apk - loki-logcli - 3.7.3-r1: normalized package name match | Alpine Linux edge package indexes: loki-logcli from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Loki log client | https://github.com/grafana/loki
- apk - loki-lokitool - 3.7.3-r1: normalized package name match | Alpine Linux edge package indexes: loki-lokitool from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Tool for interracting with Loki rules | https://github.com/grafana/loki
- apk - loki-openrc - 3.7.3-r1: normalized package name match | Alpine Linux edge package indexes: loki-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Like Prometheus, but for logs (OpenRC init scripts) | https://github.com/grafana/loki
- pacman - loki - 3.6.6-1: normalized package name match | Arch Linux sync databases: loki from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | like Prometheus, but for logs | https://github.com/grafana/loki
- zypper - logcli - 3.7.4-1.1: normalized package name match | openSUSE Tumbleweed package metadata: logcli from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | LogCLI tool | https://grafana.com/loki
- zypper - loki - 3.7.4-1.1: normalized package name match | openSUSE Tumbleweed package metadata: loki from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Loki: like Prometheus, but for logs | https://grafana.com/loki
- zypper - lokitool - 3.7.4-1.1: normalized package name match | openSUSE Tumbleweed package metadata: lokitool from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | A command-line tool to manage Loki | https://grafana.com/loki


## Combined YAML source

View the package source record on GitHub. [combined/loki.yml](https://github.com/mxcl/pkgdb/blob/main/combined/loki.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
