Skip to main content
This guide shows how to install a standalone Loki instance and configure Grafana to query logs from it. The demo uses two Ubuntu nodes:
  • node01 — runs Grafana (already installed) and will host Loki in this tutorial.
  • node02 — a separate Ubuntu node from which we will collect logs using an agent.
Note: Installing Grafana and Loki on the same machine is purely for demo convenience. In production, run them on separate hosts or in a distributed setup.
This lesson demonstrates a manual Loki installation using the binary download. You can also install Loki via your package manager (apt/dnf) or follow the installation options or run it in Kubernetes.
Prerequisites
  • SSH access to node01 and node02.
  • Example: SSH from node01 to node02:
Quick reference — default ports and paths Downloading the Loki release (manual install)
  1. Browse the Loki releases and pick the Linux AMD64 asset for your desired version. On the release page select the loki-linux-amd64.zip file and copy its download URL.
A dark-themed screenshot of a software "Release list" page showing version entries on the left and a list of downloadable build assets (zip/exe files) on the right with SHA256 hashes, file sizes, and recent timestamps.
  1. On node01, download the zip, unzip it, and make the binary executable:
Tip: Optionally move the binary to a system path, for example /usr/local/bin, so you can run loki-linux-amd64 from any directory. Download and review a sample configuration Loki ships a sample local configuration you can use to get started:
Open the sample config to review or edit. A trimmed excerpt showing important sections:
This sample binds the HTTP API on port 3100 and gRPC on 9096, stores data under /tmp/loki, and uses the filesystem TSDB — appropriate only for demos and evaluation. Start Loki with the config file Run Loki and point it to the downloaded configuration file:
If you want to run Loki in the background or as a service, create a systemd unit or use a process manager (not covered in detail here). Using systemd is recommended for production-style deployments. Verify Loki is running Loki exposes Prometheus-style metrics at /metrics. From node01 check:
If you see similar output, Loki is running and responding on http://localhost:3100. Connect Grafana to Loki
  1. In Grafana (running on node01 in this demo), add a new data source of type “Loki” — see the official docs: Grafana Loki datasource.
  2. Set the URL to http://localhost:3100 and click “Save & Test”. Grafana should report a successful connection.
  3. Open Explore, select the Loki data source, and start running log queries.
A dark-themed Grafana Explore screen using the Loki datasource, showing a query builder with label filters and a large "No data" panel. The left sidebar displays navigation items like Home, Dashboards, Explore, and Connections.
Collecting logs from node02 (install an agent) Grafana can query Loki now, but Loki has no log streams yet. To forward logs from node02 to node01, install a log shipper such as Promtail on node02. A minimal promtail configuration that pushes logs to the Loki HTTP endpoint:
Steps to install Promtail on node02:
  1. Download the matching Promtail release (from the official releases), unzip, and make the binary executable.
  2. Save the YAML config above as promtail-config.yaml on node02.
  3. Start promtail pointing to the config file, for example:
Promtail will tail /var/log/*.log (or any paths you configure) and push log streams to http://node01:3100/loki/api/v1/push. Once promtail is running and sending logs, refresh Grafana Explore — log labels and messages should appear. Closing notes and production considerations
  • For production, use durable object stores such as S3 or GCS instead of the local filesystem and configure retention, replication, and authentication accordingly.
  • To scale Loki and make it discoverable or load-balanced across instances, review Loki’s storage and ring configuration in the official docs.
  • You can point Loki at multiple configuration files by passing a comma-separated list to --config.file. Use --verify-config to validate configuration before starting.
Example flags:
This tutorial uses local filesystem storage and runs components on the same host for simplicity. Do not use this setup for production workloads — configure durable object storage, secure networking, and proper service management.
Links and references That completes the basic manual installation and Grafana integration steps for Loki.

Watch Video