github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/docs/sources/installation/install-from-source.md (about)

     1  ---
     2  title: Build from source
     3  weight: 50
     4  ---
     5  # Build from source
     6  
     7  Clone the Grafana Loki repository and use the provided `Makefile`
     8  to build Loki from source.
     9  
    10  ## Prerequisites
    11  
    12  - [Go](https://golang.org/), version 1.14 or later;
    13  set your `$GOPATH` environment variable
    14  - `make`
    15  - Docker (for updating protobuf and yacc files)
    16  
    17  ## Build locally
    18  
    19  1. Clone Loki to `$GOPATH/src/github.com/grafana/loki`:
    20  
    21      ```bash
    22      git clone https://github.com/grafana/loki $GOPATH/src/github.com/grafana/loki
    23      ```
    24  
    25  2. With a current working directory of `$GOPATH/src/github.com/grafana/loki`:
    26  
    27      ```bash
    28      make loki
    29      ```
    30  
    31  The built executable will be in `$GOPATH/src/github.com/grafana/loki/cmd/loki/loki`.