This is documentation for the next version of Loki. For the latest stable release, go to the latest version.
Install Promtail
Note
Promtail is feature complete. All future feature development will occur in Grafana Alloy.
Promtail is distributed as a binary, in a Docker container, or there is a Helm chart to install it in a Kubernetes cluster.
Install the binary
Every Grafana Loki release includes binaries for Promtail which can be found on the Releases page as part of the release assets.
Install using APT or RPM package manager
See the instructions here.
Install using Docker
Make sure to modify the tag to the most recent version.
docker pull grafana/promtail:3.2.1
Create your Promtail configuration file in a file called
promtail-config.yaml
. Refer to the Promtail configuration reference for more details.Note that you will need to replace
<local-path>
in the commands with your local path.docker run -v <local-path>:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:3.2.1 --config.file=/mnt/config/promtail-config.yaml
Install on MacOS with Homebrew
If necessary, install Homebrew.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Update Homebrew.
brew update
Navigate to the homebrew page for Promtail.
To install Promtail, run the following command:
brew install promtail
Check that installation was successful.
Check that promtail exists in its install directory.
which promtail
Run promtail
promtail
Install using Helm
Make sure that Helm is installed. See Installing Helm.
Then you can add Grafana’s chart repository to Helm:
helm repo add grafana https://grafana.github.io/helm-charts
Update the chart repository:
helm repo update
Create the configuration file
values.yaml
. The example below illustrates a connection to the locally deployed loki server:config: # publish data to loki clients: - url: http://loki-gateway/loki/api/v1/push tenant_id: 1
Finally, Promtail can be deployed with:
# The default helm configuration deploys promtail as a daemonSet (recommended) helm upgrade --values values.yaml --install promtail grafana/promtail
Install as Kubernetes daemonSet (recommended)
A DaemonSet
will deploy Promtail on every node within a Kubernetes cluster.
The DaemonSet deployment works well at collecting the logs of all containers within a
cluster. It’s the best solution for a single-tenant model. Replace {YOUR_LOKI_ENDPOINT}
with your Loki endpoint.