This is documentation for the next version of Grafana Loki documentation. For the latest stable release, go to the latest version.

Open source

Loki network ports

Loki components communicate with each other over the network, and clients such as Grafana and Grafana Alloy reach Loki over HTTP. Use this page to plan firewall rules, Kubernetes NetworkPolicies, or service mesh configuration for a Loki deployment.

All port numbers on this page are defaults. If you change a port in your configuration, use your value instead.

Ports that Loki listens on

Every Loki process opens the HTTP and gRPC ports. Components that share hash rings through memberlist also open the memberlist port.

PortProtocolConfiguration parameterPurpose
3100HTTP over TCPserver.http_listen_portThe Loki HTTP API for pushing and querying logs, the /metrics endpoint, and the /ready health check endpoint.
9095gRPC over TCPserver.grpc_listen_portRequests between Loki components, such as distributors sending logs to ingesters.
7946TCPmemberlist.bind_portGossip messages that keep the hash rings in sync between components.

Memberlist in Loki sends all gossip traffic over TCP, so you don’t need to open UDP for port 7946.

If you enable TLS with server.http_tls_config, server.grpc_tls_config, or memberlist.tls_enabled, the encrypted traffic uses the same ports. For details, refer to the server and memberlist configuration blocks.

Connections between components

The following table lists the main connections between Loki components. In monolithic and simple scalable modes, one process runs several components, but the components still use these ports to reach each other, including across replicas.

SourceDestinationPortProtocolPurpose
Log collectors, such as Grafana AlloyDistributor3100HTTPPush logs.
Grafana and other query clientsQuery frontend3100HTTPRun queries.
DistributorIngester9095gRPCSend log streams for ingestion.
DistributorPattern ingester9095gRPCSend log lines for pattern detection, when the pattern ingester is enabled.
Query frontendQuery scheduler9095gRPCEnqueue queries.
Query frontendQuerier3100HTTPProxy live tail requests, when frontend.tail_proxy_url is set.
QuerierQuery scheduler9095gRPCPull queries to run.
QuerierQuery frontend9095gRPCReturn query results.
Querier and rulerIngester9095gRPCRead recent logs that aren’t flushed to object storage yet.
Querier and rulerIndex gateway9095gRPCLook up the index, when an index gateway is configured.
Querier and rulerCompactor9095 or 3100gRPC or HTTPFetch delete requests, to filter deleted logs out of query results. Loki uses gRPC when common.compactor_grpc_address is set, and HTTP when only common.compactor_address is set.
Index gatewayBloom gateway9095gRPCFilter chunks with bloom filters, when bloom filters are enabled.
Bloom builderBloom planner9095gRPCReceive bloom build tasks, when bloom filters are enabled.
Components that use hash ringsEach other7946TCPShare hash ring state through memberlist.
RulerAlertmanagerAlertmanager port, usually 9093HTTPSend alerts.
Prometheus or Grafana AlloyAll components3100HTTPScrape the /metrics endpoint.

Loki also connects to services outside the deployment, such as object storage and caches. Use the ports that those services expose, for example 443 for HTTPS object storage endpoints.

Additional ports in the Helm chart

The Loki Helm chart deploys some components that aren’t part of Loki itself. These components use the following ports:

ComponentContainer portService portProtocolHelm value
Gateway (NGINX)808080HTTPgateway.containerPort, gateway.service.port
Chunks cache and results cache (Memcached)1121111211Memcached protocol over TCPchunksCache.port, resultsCache.port
Memcached exporter91509150HTTPNone
Loki Canary35003500HTTPNone

When the gateway is enabled, clients send push and query requests to the gateway Service on port 80. The gateway forwards them to the Loki components on port 3100.

Some Services, such as the query frontend Service, also expose port 9096, named grpclb. This port forwards to the gRPC container port, so it doesn’t open another port in the pod.

The chart can create NetworkPolicies for this traffic. To enable them, set networkPolicy.enabled: true. For the related values, such as networkPolicy.alertmanager.port, refer to the Helm chart values.