> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Loki Installation

> Guide to installing and configuring a local Grafana Loki server for development, including minimal configuration, startup steps, and best practice notes for production.

Before any parcels can be sorted, the receiving office has to exist first: the building must be there, the desk staffed, and the doors open. Only then does it make sense to send couriers out to collect anything. Loki follows the same order — the server must be running and listening before any agent ships a single log line.

![An illustration of a small "RECEIVING" storefront with two delivery workers standing at the entrance. A line connects the shop to a floating panel labeled "Loki server" under the title "Installing Loki Locally."](https://mintcdn.com/kodekloud-c4ac6d9a/dEcIUoAxuol-3ZBK/images/Grafana-Loki/Grafana-Loki-Essentials/Loki-Installation/installing-loki-locally-receiving-storefront.jpg?fit=max\&auto=format\&n=dEcIUoAxuol-3ZBK\&q=85\&s=ac97364349346235d72c291daf628d87)

In practice that means: first install and start the Loki server locally, then point your logs/agents at it. Loki is designed to be lightweight for local development — it ships as a single binary with a single configuration file. There is no external database to provision, so getting a local instance running is straightforward.

![A minimalist slide titled "One binary, one config file" showing a blue rounded box labeled "loki BINARY" with a downward arrow pointing to it and a green check mark.](https://mintcdn.com/kodekloud-c4ac6d9a/dEcIUoAxuol-3ZBK/images/Grafana-Loki/Grafana-Loki-Essentials/Loki-Installation/one-binary-one-config-loki.jpg?fit=max\&auto=format\&n=dEcIUoAxuol-3ZBK\&q=85\&s=830ed258463efb0d6c444e404dfb7454)

Quick steps to get a local Loki running

* Download the Loki binary for your OS from the official releases.
* Create a configuration YAML file for local operation.
* Start Loki with the config: `./loki -config.file=loki-local-config.yaml`
* Point your log shipper (promtail, fluentd, Vector, etc.) to `http://localhost:3100`.

What the minimal config does

* The `server` block sets the HTTP and gRPC listener ports. By default, Loki serves its HTTP API on `3100` and a gRPC listener commonly on `9095` or `9096`.
* The `common` block configures local disk layout (e.g. `path_prefix: /tmp/loki`) and uses `replication_factor: 1` because this is a single-node local setup.
* `schema_config` selects the TSDB index schema, here set to `v13`.
* `object_store: filesystem` keeps all data in a local directory. For production, use object stores such as Amazon S3, Google Cloud Storage, or Azure Blob Storage.
* `auth_enabled: false` disables authentication so requests are allowed without credentials — suitable for local testing but not for production.

Configuration summary

| Key | Purpose | Typical local value |
| - | - | - |
| `server.http_listen_port` | HTTP API port for queries and ingestion | `3100` |
| `server.grpc_listen_port` | Internal gRPC listener | `9096` |
| `common.path_prefix` | Local filesystem path for TSDB and indexes | `/tmp/loki` |
| `common.replication_factor` | Replication factor for ingesters | `1` |
| `schema_config` | TSDB schema selection | `v13` |
| `auth_enabled` | Enable/disable authentication | `false` |
| `object_store` | Where to store chunks and indexes | `filesystem` (local) or cloud object store |

Example minimal config (loki-local-config.yaml)

```yaml theme={null}
server:
  http_listen_port: 3100
  grpc_listen_port: 9096

common:
  path_prefix: /tmp/loki
  replication_factor: 1

auth_enabled: false

schema_config:
  configs:
    - from: 2024-04-01
      store: tsdb
      object_store: filesystem
      schema: v13
```

This configuration is intended for local development and learning. For production deployments, use a durable object store (S3/GCS/Azure Blob), increase replication, enable authentication/multi-tenancy, and follow best practices for high availability and retention.

Links and references

* [Grafana Loki releases](https://github.com/grafana/loki/releases)
* [Amazon S3 documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html)
* [Google Cloud Storage documentation](https://cloud.google.com/storage/docs)
* [Azure Blob Storage documentation](https://learn.microsoft.com/azure/storage/blobs/)
* [Promtail (Loki agent) documentation](https://grafana.com/docs/loki/latest/clients/promtail/)

> **[Watch Video](https://learn.kodekloud.com/user/courses/grafana-loki/module/d9262c89-9213-4e21-8599-d54b9c773885/lesson/d2ca867c-da21-496e-96c4-8832eab960fd)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.