---
title: "Build from source | Grafana Loki documentation"
description: "Describes how to install Loki from the source code."
---

# Build from source

Clone the Grafana Loki repository and use the provided `Makefile` to build Loki from source.

> 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](/docs/loki/latest/operations/authentication/) for a list of open-source reverse proxies you can use.

## Prerequisites

- [Go](https://golang.org/), version 1.23 or later; set your `$GOPATH` environment variable
- `make`
- Docker (for updating protobuf and yacc files)

## Build locally

1. Clone Loki to `$GOPATH/src/github.com/grafana/loki`:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   git clone https://github.com/grafana/loki $GOPATH/src/github.com/grafana/loki
   ```
2. With a current working directory of `$GOPATH/src/github.com/grafana/loki`:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   make loki
   ```

The built executable will be in `$GOPATH/src/github.com/grafana/loki/cmd/loki/loki`.
