<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Installation on Grafana Labs</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/</link><description>Recent content in Installation on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/loki/v2.9.x/setup/install/index.xml" rel="self" type="application/rss+xml"/><item><title>Install Grafana Loki with Helm</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/helm/</link><pubDate>Thu, 10 Apr 2025 12:15:54 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/install/helm/</guid><content><![CDATA[&lt;h1 id=&#34;install-grafana-loki-with-helm&#34;&gt;Install Grafana Loki with Helm&lt;/h1&gt;
&lt;p&gt;The &lt;a href=&#34;https://helm.sh/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Helm&lt;/a&gt; chart allows you to configure, install, and upgrade Grafana Loki within a Kubernetes cluster.&lt;/p&gt;
&lt;p&gt;This guide references the Loki Helm chart version 3.0 or greater and contains the following sections:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v2.9.x/setup/install/helm/concepts/&#34;&gt;Helm chart components&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v2.9.x/setup/install/helm/install-monolithic/&#34;&gt;Install monolithic Loki&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v2.9.x/setup/install/helm/install-scalable/&#34;&gt;Install scalable Loki&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v2.9.x/setup/install/helm/configure-storage/&#34;&gt;Configure storage&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v2.9.x/setup/install/helm/reference/&#34;&gt;Helm chart values&lt;/a&gt;&lt;/li&gt;&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v2.9.x/setup/install/helm/monitor-and-alert/&#34;&gt;Monitoring&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;h2 id=&#34;reference&#34;&gt;Reference&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;reference/&#34;&gt;Values reference&lt;/a&gt;&lt;/p&gt;
]]></content><description>&lt;h1 id="install-grafana-loki-with-helm">Install Grafana Loki with Helm&lt;/h1>
&lt;p>The &lt;a href="https://helm.sh/" target="_blank" rel="noopener noreferrer">Helm&lt;/a> chart allows you to configure, install, and upgrade Grafana Loki within a Kubernetes cluster.&lt;/p>
&lt;p>This guide references the Loki Helm chart version 3.0 or greater and contains the following sections:&lt;/p></description></item><item><title>Tanka</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/tanka/</link><pubDate>Wed, 06 Sep 2023 12:47:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/install/tanka/</guid><content><![CDATA[&lt;h1 id=&#34;tanka&#34;&gt;Tanka&lt;/h1&gt;
&lt;p&gt;&lt;a href=&#34;https://tanka.dev&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Tanka&lt;/a&gt; is a reimplementation of
&lt;a href=&#34;https://ksonnet.io&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Ksonnet&lt;/a&gt; that Grafana Labs created after Ksonnet was
deprecated. Tanka is used by Grafana Labs to run Grafana Loki in production.&lt;/p&gt;
&lt;p&gt;The Tanka installation runs the Loki cluster in microservices mode.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;p&gt;Install the latest version of Tanka (version v0.17.1 or a more recent version) for the &lt;code&gt;tk env&lt;/code&gt;
commands. Prebuilt binaries for Tanka can be found at the &lt;a href=&#34;https://github.com/grafana/tanka/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Tanka releases
URL&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In your config repo, if you don&amp;rsquo;t have a Tanka application, create a folder and
call &lt;code&gt;tk init&lt;/code&gt; inside of it. Then create an environment for Loki and provide the
URL for the Kubernetes API server to deploy to (e.g., &lt;code&gt;https://localhost:6443&lt;/code&gt;):&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;mkdir &amp;lt;application name&amp;gt;
cd &amp;lt;application name&amp;gt;
tk init
tk env add environments/loki --namespace=loki --server=&amp;lt;Kubernetes API server&amp;gt;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Install &lt;code&gt;jsonnet-bundler&lt;/code&gt; (&lt;code&gt;jb&lt;/code&gt;), find instructions for your platform in Tanka&amp;rsquo;s &lt;a href=&#34;https://tanka.dev/install#jsonnet-bundler&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;installation docs&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;deploying&#34;&gt;Deploying&lt;/h2&gt;
&lt;p&gt;Download and install the Loki and Promtail module using &lt;code&gt;jb&lt;/code&gt; (version v0.4.0 or a more recent version):&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;jb init  # not required if you already ran `tk init`
jb install github.com/grafana/loki/production/ksonnet/loki@main
jb install github.com/grafana/loki/production/ksonnet/promtail@main&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Revise the YAML contents of &lt;code&gt;environments/loki/main.jsonnet&lt;/code&gt;, updating these variables:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Update the &lt;code&gt;username&lt;/code&gt;, &lt;code&gt;password&lt;/code&gt;, and the relevant &lt;code&gt;htpasswd&lt;/code&gt; variable values.&lt;/li&gt;
&lt;li&gt;Update the S3 or GCS variable values, depending on your object storage type. See &lt;a href=&#34;/docs/loki/latest/configuration/#storage_config&#34;&gt;storage_config&lt;/a&gt; for more configuration details.&lt;/li&gt;
&lt;li&gt;Remove from the configuration the S3 or GCS object storage variables that are not part of your setup.&lt;/li&gt;
&lt;li&gt;Update the value of &lt;code&gt;boltdb_shipper_shared_store&lt;/code&gt; or &lt;code&gt;tsdb_shipper_shared_store&lt;/code&gt; to the type of object storage you are using. Options are &lt;code&gt;gcs&lt;/code&gt;, &lt;code&gt;s3&lt;/code&gt;, &lt;code&gt;azure&lt;/code&gt;, &lt;code&gt;cos&lt;/code&gt; or &lt;code&gt;filesystem&lt;/code&gt;. Update the &lt;code&gt;object_store&lt;/code&gt; variable under the &lt;code&gt;schema_config&lt;/code&gt; section to the same value.&lt;/li&gt;
&lt;li&gt;Update the Promtail configuration &lt;code&gt;container_root_path&lt;/code&gt; variable&amp;rsquo;s value to reflect your root path for the Docker daemon. Run &lt;code&gt;docker info | grep &amp;quot;Root Dir&amp;quot;&lt;/code&gt; to acquire your root path.&lt;/li&gt;
&lt;li&gt;Update the &lt;code&gt;from&lt;/code&gt; value in the Loki &lt;code&gt;schema_config&lt;/code&gt; section to no more than 14 days prior to the current date. The &lt;code&gt;from&lt;/code&gt; date represents the first day for which the &lt;code&gt;schema_config&lt;/code&gt; section is valid. For example, if today is &lt;code&gt;2021-01-15&lt;/code&gt;, set &lt;code&gt;from&lt;/code&gt; to &lt;code&gt;2021-01-01&lt;/code&gt;. This recommendation is based on Loki&amp;rsquo;s default acceptance of log lines up to 14 days in the past. The &lt;code&gt;reject_old_samples_max_age&lt;/code&gt; configuration variable controls the acceptance range.&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;jsonnet&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-jsonnet&#34;&gt;local gateway = import &amp;#39;loki/gateway.libsonnet&amp;#39;;
local loki = import &amp;#39;loki/loki.libsonnet&amp;#39;;
local promtail = import &amp;#39;promtail/promtail.libsonnet&amp;#39;;

loki &amp;#43; promtail &amp;#43; gateway {
  _config&amp;#43;:: {
    namespace: &amp;#39;loki&amp;#39;,
    htpasswd_contents: &amp;#39;loki:$apr1$H4yGiGNg$ssl5/NymaGFRUvxIV1Nyr.&amp;#39;,

    // S3 variables -- Remove if not using s3
    storage_backend: &amp;#39;s3,dynamodb&amp;#39;,
    s3_access_key: &amp;#39;key&amp;#39;,
    s3_secret_access_key: &amp;#39;secret access key&amp;#39;,
    s3_address: &amp;#39;url&amp;#39;,
    s3_bucket_name: &amp;#39;loki-test&amp;#39;,
    dynamodb_region: &amp;#39;region&amp;#39;,

    // GCS variables -- Remove if not using gcs
    storage_backend: &amp;#39;bigtable,gcs&amp;#39;,
    bigtable_instance: &amp;#39;instance&amp;#39;,
    bigtable_project: &amp;#39;project&amp;#39;,
    gcs_bucket_name: &amp;#39;bucket&amp;#39;,

    //Set this variable based on the type of object storage you&amp;#39;re using.
    boltdb_shipper_shared_store: &amp;#39;my-object-storage-backend-type&amp;#39;,

    //Update the object_store and from fields
    loki&amp;#43;: {
      schema_config: {
        configs: [{
          from: &amp;#39;YYYY-MM-DD&amp;#39;,
          store: &amp;#39;boltdb-shipper&amp;#39;,
          object_store: &amp;#39;my-object-storage-backend-type&amp;#39;,
          schema: &amp;#39;v11&amp;#39;,
          index: {
            prefix: &amp;#39;%s_index_&amp;#39; % $._config.table_prefix,
            period: &amp;#39;%dh&amp;#39; % $._config.index_period_hours,
          },
        }],
      },
    },

    //Update the container_root_path if necessary
    promtail_config&amp;#43;: {
      clients: [{
        scheme:: &amp;#39;http&amp;#39;,
        hostname:: &amp;#39;gateway.%(namespace)s.svc&amp;#39; % $._config,
        username:: &amp;#39;loki&amp;#39;,
        password:: &amp;#39;password&amp;#39;,
        container_root_path:: &amp;#39;/var/lib/docker&amp;#39;,
      }],
    },

    replication_factor: 3,
    consul_replicas: 1,
  },
}&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Run &lt;code&gt;tk show environments/loki&lt;/code&gt; to see the manifests that will be deployed to
the cluster. Run &lt;code&gt;tk apply environments/loki&lt;/code&gt; to deploy the manifests.
To delete the environment from cluster, run &lt;code&gt;tk delete environments/loki&lt;/code&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="tanka">Tanka&lt;/h1>
&lt;p>&lt;a href="https://tanka.dev" target="_blank" rel="noopener noreferrer">Tanka&lt;/a> is a reimplementation of
&lt;a href="https://ksonnet.io" target="_blank" rel="noopener noreferrer">Ksonnet&lt;/a> that Grafana Labs created after Ksonnet was
deprecated. Tanka is used by Grafana Labs to run Grafana Loki in production.&lt;/p></description></item><item><title>Install Loki with Docker or Docker Compose</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/docker/</link><pubDate>Wed, 07 Feb 2024 18:57:52 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/install/docker/</guid><content><![CDATA[&lt;h1 id=&#34;install-loki-with-docker-or-docker-compose&#34;&gt;Install Loki with Docker or Docker Compose&lt;/h1&gt;
&lt;p&gt;You can install Loki and Promtail with Docker or Docker Compose if you are evaluating, testing, or developing Loki.
For production, Grafana recommends installing with Tanka or Helm.&lt;/p&gt;
&lt;p&gt;The configuration acquired with these installation instructions run Loki as a single binary.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.docker.com/install&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Docker&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://docs.docker.com/compose/install&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Docker Compose&lt;/a&gt; (optional, only needed for the Docker Compose install method)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;install-with-docker&#34;&gt;Install with Docker&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Copy and paste the commands below into your command line.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;wget https://raw.githubusercontent.com/grafana/loki/v2.9.4/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run --name loki -d -v $(pwd):/mnt/config -p 3100:3100 grafana/loki:2.9.4 -config.file=/mnt/config/loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.9.4/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
docker run --name promtail -d -v $(pwd):/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.9.4 -config.file=/mnt/config/promtail-config.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When finished, &lt;code&gt;loki-config.yaml&lt;/code&gt; and &lt;code&gt;promtail-config.yaml&lt;/code&gt; are downloaded in the directory you chose. Docker containers are running Loki and Promtail using those config files.&lt;/p&gt;
&lt;p&gt;Navigate to http://localhost:3100/metrics to view the metrics and http://localhost:3100/ready for readiness.&lt;/p&gt;
&lt;p&gt;The image is configured to run by default as user loki with  UID &lt;code&gt;10001&lt;/code&gt; and GID &lt;code&gt;10001&lt;/code&gt;. You can use a different user, specially if you are using bind mounts, by specifying the UID with a &lt;code&gt;docker run&lt;/code&gt; command and using &lt;code&gt;--user=UID&lt;/code&gt; with numeric UID suited to your needs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Copy and paste the commands below into your terminal. Note that you will need to replace the &lt;code&gt;&amp;lt;placeholders&amp;gt;&lt;/code&gt; in the commands with your local path.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;cd &amp;#34;&amp;lt;local-path&amp;gt;&amp;#34;
wget https://raw.githubusercontent.com/grafana/loki/v2.9.4/cmd/loki/loki-local-config.yaml -O loki-config.yaml
docker run --name loki -v &amp;lt;local-path&amp;gt;:/mnt/config -p 3100:3100 grafana/loki:2.9.4 --config.file=/mnt/config/loki-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/v2.9.4/clients/cmd/promtail/promtail-docker-config.yaml -O promtail-config.yaml
docker run -v &amp;lt;local-path&amp;gt;:/mnt/config -v /var/log:/var/log --link loki grafana/promtail:2.9.4 --config.file=/mnt/config/promtail-config.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When finished, &lt;code&gt;loki-config.yaml&lt;/code&gt; and &lt;code&gt;promtail-config.yaml&lt;/code&gt; are downloaded in the directory you chose. Docker containers are running Loki and Promtail using those config files.&lt;/p&gt;
&lt;p&gt;Navigate to http://localhost:3100/metrics to view the output.&lt;/p&gt;
&lt;h2 id=&#34;install-with-docker-compose&#34;&gt;Install with Docker Compose&lt;/h2&gt;
&lt;p&gt;Run the following commands in your command line. They work for Windows or Linux systems.&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;wget https://raw.githubusercontent.com/grafana/loki/v2.9.4/production/docker-compose.yaml -O docker-compose.yaml
docker-compose -f docker-compose.yaml up&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="install-loki-with-docker-or-docker-compose">Install Loki with Docker or Docker Compose&lt;/h1>
&lt;p>You can install Loki and Promtail with Docker or Docker Compose if you are evaluating, testing, or developing Loki.
For production, Grafana recommends installing with Tanka or Helm.&lt;/p></description></item><item><title>Local</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/local/</link><pubDate>Thu, 10 Apr 2025 12:15:54 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/install/local/</guid><content><![CDATA[&lt;h1 id=&#34;local&#34;&gt;Local&lt;/h1&gt;
&lt;p&gt;In order to log events with Grafana Loki, download and install both Promtail and Loki.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Loki is the logging engine.&lt;/li&gt;
&lt;li&gt;Promtail sends logs to Loki.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The configuration specifies running Loki as a single binary.&lt;/p&gt;
&lt;h2 id=&#34;install-using-apt-or-rpm-package-manager&#34;&gt;Install using APT or RPM package manager&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add Granafa&amp;rsquo;s Advanced Package Tool &lt;a href=&#34;https://apt.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;APT&lt;/a&gt; or RPM Package Manager &lt;a href=&#34;https://rpm.grafana.com/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;RPM&lt;/a&gt;
package repository following the linked instructions.&lt;/li&gt;
&lt;li&gt;Install Loki and Promtail
&lt;ol&gt;
&lt;li&gt;Using &lt;code&gt;dnf&lt;/code&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;dnf update
dnf install loki promtail&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;apt-get&lt;/code&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;apt-get update
apt-get install loki promtail&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;install-manually&#34;&gt;Install manually&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the &lt;a href=&#34;https://github.com/grafana/loki/releases/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;release page&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Scroll down to the Assets section under the version that you want to install.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download the Loki and Promtail .zip files that correspond to your system.
&lt;strong&gt;Note:&lt;/strong&gt; Do not download LogCLI or Loki Canary at this time. &lt;code&gt;LogCLI&lt;/code&gt; allows you to run Loki queries in a command line interface. &lt;a href=&#34;../../../operations/loki-canary/&#34;&gt;Loki Canary&lt;/a&gt; is a tool to audit Loki performance.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Unzip the package contents into the same directory. This is where the two programs will run.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the command line, change directory (&lt;code&gt;cd&lt;/code&gt; on most systems) to the directory with Loki and Promtail. Copy and paste the commands below into your command line to download generic configuration files.
&lt;strong&gt;Note:&lt;/strong&gt; Use the corresponding Git refs that match your downloaded Loki version to get the correct configuration file. For example, if you are using Loki version 2.6.1, you need to use the &lt;code&gt;https://raw.githubusercontent.com/grafana/loki/v2.9.4/cmd/loki/loki-local-config.yaml&lt;/code&gt; URL to download the configuration file that corresponds to the Loki version you aim to run.&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;wget https://raw.githubusercontent.com/grafana/loki/main/cmd/loki/loki-local-config.yaml
wget https://raw.githubusercontent.com/grafana/loki/main/clients/cmd/promtail/promtail-local-config.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the following command to start Loki:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;.\loki-windows-amd64.exe --config.file=loki-local-config.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;./loki-linux-amd64 -config.file=loki-local-config.yaml&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Loki runs and displays Loki logs in your command line and on http://localhost:3100/metrics.&lt;/p&gt;
&lt;p&gt;The next step will be running an agent to send logs to Loki.
To do so with Promtail, refer to the &lt;a href=&#34;../../../send-data/promtail/&#34;&gt;Promtail configuration&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;release-binaries---opensuse-linux-only&#34;&gt;Release binaries - openSUSE Linux only&lt;/h2&gt;
&lt;p&gt;Every release includes binaries for Loki which can be found on the
&lt;a href=&#34;https://github.com/grafana/loki/releases&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Releases page&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;community-opensuse-linux-packages&#34;&gt;Community openSUSE Linux packages&lt;/h2&gt;
&lt;p&gt;The community provides packages of Loki for openSUSE Linux. To install:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add the repository &lt;code&gt;https://download.opensuse.org/repositories/security:/logging/&lt;/code&gt;
to your system. For example, if you are using Leap 15.1, run
&lt;code&gt;sudo zypper ar https://download.opensuse.org/repositories/security:/logging/openSUSE_Leap_15.1/security:logging.repo ; sudo zypper ref&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install the Loki package with &lt;code&gt;zypper in loki&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Enable the Loki and Promtail services:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;systemd start loki &amp;amp;&amp;amp; systemd enable loki&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;systemd start promtail &amp;amp;&amp;amp; systemd enable promtail&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Modify the configuration files as needed: &lt;code&gt;/etc/loki/promtail.yaml&lt;/code&gt; and
&lt;code&gt;/etc/loki/loki.yaml&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
]]></content><description>&lt;h1 id="local">Local&lt;/h1>
&lt;p>In order to log events with Grafana Loki, download and install both Promtail and Loki.&lt;/p>
&lt;ul>
&lt;li>Loki is the logging engine.&lt;/li>
&lt;li>Promtail sends logs to Loki.&lt;/li>
&lt;/ul>
&lt;p>The configuration specifies running Loki as a single binary.&lt;/p></description></item><item><title>Install on Istio</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/istio/</link><pubDate>Wed, 06 Sep 2023 12:47:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/install/istio/</guid><content><![CDATA[&lt;h1 id=&#34;install-on-istio&#34;&gt;Install on Istio&lt;/h1&gt;
&lt;p&gt;When installing Loki on Istio service mesh you must complete some additional steps. Without these steps, the ingester, querier, etc. might start, but you will see logs like the following:&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;loki level=debug ts=2021-11-24T11:33:37.352544925Z caller=broadcast.go:48 msg=&amp;#34;Invalidating forwarded broadcast&amp;#34; key=collectors/distributor version=123 oldVersion=122 content=[loki-distributor-59c4896444-t9t6g[] oldContent=[loki-distributor-59c4896444-t9t6g[]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This means that the pod is failing to join the ring.&lt;/p&gt;
&lt;p&gt;If you try to add &lt;code&gt;loki&lt;/code&gt; to &lt;code&gt;Grafana&lt;/code&gt; data sources, you will see logs like (&lt;code&gt;empty ring&lt;/code&gt;)&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;loki level=warn ts=2021-11-24T08:02:42.08262122Z caller=logging.go:72 traceID=3fc821042d8ada1a orgID=fake msg=&amp;#34;GET /loki/api/v1/labels?end=1637740962079859431&amp;amp;start=1637740361925000000 (500) 97.4µs Response: \&amp;#34;empty ring\\n\&amp;#34; ws: false; X-Scope-Orgid: fake; uber-trace-id: 3fc821042d8ada1a:1feed8872deea75c:1180f95a8235bb6c:0; &amp;#34;&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;When you enable istio-injection on the namespace where Loki is running, you need to also modify the configuration for the Loki services. Given that Istio will not allow a pod to resolve another mod using an IP address, you must also modify the &lt;code&gt;memberlist&lt;/code&gt; service.&lt;/p&gt;
&lt;h2 id=&#34;required-changes&#34;&gt;Required changes&lt;/h2&gt;
&lt;h3 id=&#34;query-frontend-service&#34;&gt;Query frontend service&lt;/h3&gt;
&lt;p&gt;Make the following modifications to the file for Loki&amp;rsquo;s Query Frontend service.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change the name of &lt;code&gt;grpc&lt;/code&gt; port to &lt;code&gt;grpclb&lt;/code&gt;. This is used by the grpc load balancing strategy which relies on SRV records. Otherwise the &lt;code&gt;querier&lt;/code&gt; will not be able to reach the &lt;code&gt;query-frontend&lt;/code&gt;. See &lt;a href=&#34;https://github.com/grafana/loki/blob/0116aa61c86fa983ddcbbd5e30a2141d2e89081a/production/ksonnet/loki/common.libsonnet#L19&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://github.com/grafana/loki/blob/0116aa61c86fa983ddcbbd5e30a2141d2e89081a/production/ksonnet/loki/common.libsonnet#L19&lt;/a&gt;
and
&lt;a href=&#34;https://grpc.github.io/grpc/core/md_doc_load-balancing.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;https://grpc.github.io/grpc/core/md_doc_load-balancing.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Set the &lt;code&gt;appProtocol&lt;/code&gt; of &lt;code&gt;grpclb&lt;/code&gt; to &lt;code&gt;tcp&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Set &lt;code&gt;publishNotReadyAddresses&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;apiVersion: v1
kind: Service
metadata:
  labels:
    app: loki-query-frontend
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-query-frontend
spec:
  ports:
  - appProtocol: http
    name: http
    port: 3100
    protocol: TCP
    targetPort: http
  - appProtocol: tcp
    name: grpclb
    port: 9095
    protocol: TCP
    targetPort: grpc
  publishNotReadyAddresses: true
  selector:
    app: loki-query-frontend
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-query-frontend
  type: ClusterIP&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;querier-service&#34;&gt;Querier service&lt;/h3&gt;
&lt;p&gt;Make the following modifications to the file for Loki&amp;rsquo;s Querier service.&lt;/p&gt;
&lt;p&gt;Set the &lt;code&gt;appProtocol&lt;/code&gt; of the &lt;code&gt;grpc&lt;/code&gt; service to &lt;code&gt;tcp&lt;/code&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;apiVersion: v1
kind: Service
metadata:
  labels:
    app: loki-querier
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-querier
  name: loki-querier
  namespace: observability
spec:
  ports:
  - appProtocol: http
    name: http
    port: 3100
    protocol: TCP
    targetPort: http
  - appProtocol: tcp
    name: grpc
    port: 9095
    protocol: TCP
    targetPort: grpc
  selector:
    app: loki-querier
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-querier
  type: ClusterIP&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;ingester-service-and-ingester-headless-service&#34;&gt;Ingester service and Ingester headless service&lt;/h3&gt;
&lt;p&gt;Make the following modifications to the file for Loki&amp;rsquo;s Query Ingester and Ingester Headless service.&lt;/p&gt;
&lt;p&gt;Set the &lt;code&gt;appProtocol&lt;/code&gt; of the &lt;code&gt;grpc&lt;/code&gt; port to &lt;code&gt;tcp&lt;/code&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;apiVersion: v1
kind: Service
metadata:
  labels:
    app: loki-ingester-(headless)
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-ingester
  name: loki-ingester-headless
spec:  
  clusterIP: None (if headless)
  ports:
  - name: http
    port: 3100
    protocol: TCP
    targetPort: http
  - appProtocol: tcp
    name: grpc
    port: 9095
    protocol: TCP
    targetPort: grpc
  selector:
    app: loki-ingester
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-ingester
  type: ClusterIP&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;distributor-service&#34;&gt;Distributor service&lt;/h3&gt;
&lt;p&gt;Make the following modifications to the file for Loki&amp;rsquo;s Distributor service.&lt;/p&gt;
&lt;p&gt;Set the &lt;code&gt;appProtocol&lt;/code&gt; of the &lt;code&gt;grpc&lt;/code&gt; port to &lt;code&gt;tcp&lt;/code&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;apiVersion: v1
kind: Service
metadata:
  labels:
    app: loki-distributor
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-distributor
spec:
  ports:
  - name: http
    port: 3100
    protocol: TCP
    targetPort: http
  - name: grpc
    port: 9095
    protocol: TCP
    targetPort: grpc
    appProtocol: tcp
  selector:
    app: loki-distributor
    app.kubernetes.io/instance: observability
    app.kubernetes.io/name: loki-distributor
  sessionAffinity: None
  type: ClusterIP&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h3 id=&#34;memberlist-service&#34;&gt;Memberlist service&lt;/h3&gt;
&lt;p&gt;Make the following modifications to the file for the Memberlist service.&lt;/p&gt;
&lt;p&gt;Set the &lt;code&gt;appProtocol&lt;/code&gt; of the &lt;code&gt;http&lt;/code&gt; port to &lt;code&gt;tcp&lt;/code&gt;&lt;/p&gt;

&lt;div class=&#34;code-snippet code-snippet__mini&#34;&gt;&lt;div class=&#34;lang-toolbar__mini&#34;&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet code-snippet__border&#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-none&#34;&gt;apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/instance: observability
  name: loki-memberlist
  namespace: observability
spec:
  clusterIP: None
  ports:
    - name: http
      port: 7946
      protocol: TCP
      targetPort: 7946
      appProtocol: tcp
  selector:
    app.kubernetes.io/instance: observability
    app.kubernetes.io/part-of: memberlist&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
]]></content><description>&lt;h1 id="install-on-istio">Install on Istio&lt;/h1>
&lt;p>When installing Loki on Istio service mesh you must complete some additional steps. Without these steps, the ingester, querier, etc. might start, but you will see logs like the following:&lt;/p></description></item><item><title>Build from source</title><link>https://grafana.com/docs/loki/v2.9.x/setup/install/install-from-source/</link><pubDate>Wed, 06 Sep 2023 12:47:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v2.9.x/setup/install/install-from-source/</guid><content><![CDATA[&lt;h1 id=&#34;build-from-source&#34;&gt;Build from source&lt;/h1&gt;
&lt;p&gt;Clone the Grafana Loki repository and use the provided &lt;code&gt;Makefile&lt;/code&gt;
to build Loki from source.&lt;/p&gt;
&lt;h2 id=&#34;prerequisites&#34;&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://golang.org/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Go&lt;/a&gt;, version 1.14 or later;
set your &lt;code&gt;$GOPATH&lt;/code&gt; environment variable&lt;/li&gt;
&lt;li&gt;&lt;code&gt;make&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Docker (for updating protobuf and yacc files)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;build-locally&#34;&gt;Build locally&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Clone Loki to &lt;code&gt;$GOPATH/src/github.com/grafana/loki&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/grafana/loki $GOPATH/src/github.com/grafana/loki&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;With a current working directory of &lt;code&gt;$GOPATH/src/github.com/grafana/loki&lt;/code&gt;:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;make loki&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The built executable will be in &lt;code&gt;$GOPATH/src/github.com/grafana/loki/cmd/loki/loki&lt;/code&gt;.&lt;/p&gt;
]]></content><description>&lt;h1 id="build-from-source">Build from source&lt;/h1>
&lt;p>Clone the Grafana Loki repository and use the provided &lt;code>Makefile&lt;/code>
to build Loki from source.&lt;/p>
&lt;h2 id="prerequisites">Prerequisites&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://golang.org/" target="_blank" rel="noopener noreferrer">Go&lt;/a>, version 1.14 or later;
set your &lt;code>$GOPATH&lt;/code> environment variable&lt;/li>
&lt;li>&lt;code>make&lt;/code>&lt;/li>
&lt;li>Docker (for updating protobuf and yacc files)&lt;/li>
&lt;/ul>
&lt;h2 id="build-locally">Build locally&lt;/h2>
&lt;ol>
&lt;li>
&lt;p>Clone Loki to &lt;code>$GOPATH/src/github.com/grafana/loki&lt;/code>:&lt;/p></description></item></channel></rss>