Loki network ports and firewall rules

Loki needs TCP 3100 for its HTTP API, 9095 for gRPC between components and 7946 for memberlist gossip. This page explains which clients and components must reach each port and how to plan the rules.

On this page

Loki network ports and firewall rules: what to open and why

If you are about to deploy Loki, the firewall and security group changes need approval before any cluster is built or any collector is connected. Three ports carry almost all of the traffic you need to plan for: TCP 3100 for the HTTP API, including push, query, /metrics and /ready; TCP 9095 for gRPC between Loki components such as distributors and ingesters; and TCP 7946 for memberlist gossip, which lets components find each other and form the ring. For 7946, only TCP needs to be opened, since UDP does not need to be opened for memberlist according to the Loki network ports reference.

Plan these rules by traffic direction, not by a single "allow Loki" rule. Port 3100 must be reachable from every log collector that pushes data, from Grafana or other query clients, and from whatever monitoring system scrapes /metrics. Port 9095 and port 7946 should stay internal to the Loki components themselves. Confirm with your platform team whether your topology places any of these components in different subnets, availability zones or clusters, because each cross-boundary path needs its own rule. Also confirm whether your load balancer or reverse proxy sits between clients and port 3100, since that changes which hosts actually need to connect.

Ask the team that runs your network or cloud security groups to record the source, destination and port for each rule, and to name the owner of each. Then ask the Loki deployment owner to confirm that the component layout in your chosen deployment mode matches the rules before approval. Because the port list comes from the Loki network ports reference, check it against the version you deploy, since the documentation for your release is the final authority for your environment.

How clients and Loki components talk over each port

Log collectors, Grafana and API clients reach Loki on TCP 3100 through the authenticating reverse proxy, which sits on the trust boundary between your network and the cluster. Inside the cluster, distributors, ingesters, queriers and the query frontend talk to each other on TCP 9095 (gRPC), while memberlist peers exchange gossip on TCP 7946. Check that the proxy is the only path into port 3100 and that 7946 is open over TCP only.

Client traffic enters on port 3100 through the proxy, while cluster traffic uses 9095 and 7946.

Which ports to open for each traffic path

This table maps each Loki port to the traffic it carries, the side that starts the connection, and the network segment where it should be allowed. Read it row by row when writing firewall or security group rules, and confirm the final paths against your own topology and proxy layout.

Port and protocolTraffic it carriesWho initiates itWhere it should be allowed
TCP 3100HTTP API for push, query, /ready and /metricsLog collectors, Grafana and other API clients, plus health checks and metrics scrapersFrom collectors, Grafana and monitoring hosts to Loki or its authenticating proxy, not from general user networks
TCP 9095gRPC between Loki components such as distributors and ingestersLoki components themselvesOnly between Loki components on the cluster or internal network, never exposed outside it
TCP 7946Memberlist gossip for the hash ring (TCP only, UDP not required)Loki components that join the memberlist ringOnly between Loki instances that share the ring, on the internal network
Collector path to port 3100Log shipping from Grafana Alloy, Fluent Bit, Fluentd, OpenTelemetry or Docker logging driverThe log collector or agent on each source hostFrom each source network to the proxy in front of Loki, with the tenant header passed through
Grafana path to port 3100Queries from Grafana data source connectionsGrafana serverFrom the Grafana host to the authenticating proxy in front of Loki, confirm the data source URL

What log collectors need to reach

Log collectors need a network route to Loki's push endpoint, and that route usually goes through the authenticating reverse proxy rather than straight to port 3100. Grafana Alloy, OpenTelemetry clients, Fluent Bit, Fluentd and the Docker logging driver all send logs to Loki over HTTP, so the firewall rule you write for them is an HTTP path from each source network to the proxy's listener, not an inbound rule to the Loki pods or processes. Loki has no built-in authentication layer, so the proxy is where credentials are checked. Decide that boundary first, then open only the proxy port to collector subnets and keep 3100 reachable from the proxy alone.

When multi-tenancy is on, every push request must carry the X-Scope-OrgID header, so the collector configuration and the proxy both need to pass that header through unchanged. A missing or mismatched tenant header is a common reason a collector connects successfully but its logs never appear in the expected tenant. Confirm the exact push path for your Loki version in the official documentation before writing proxy rules, and test it with one collector from each source network. Promtail reached end of life on March 2, 2026 and receives no further updates, so any Promtail agents that still need network access should be moved to Grafana Alloy. The Loki send data documentation lists the supported clients and their configuration.

Collectors on the public side of a firewall or in a separate cloud account need the same route, plus an outbound rule on their own side. Check that egress from each collector host to the proxy is allowed, that TLS is terminated where you expect, and that any load balancer timeouts are longer than the longest push your collectors make. Record each collector's source range and the tenant it writes to, because those two facts are what a firewall reviewer and an auditor will ask for when the rule set is reviewed.

How to plan and open Loki ports step by step

This sequence turns a list of Loki components and clients into a set of firewall rules that expose only what each flow needs. The result is a tested port map that your network and security teams can review before rollout.

  1. Inventory every component and client

    List every Loki process, every node it runs on, and every system that sends logs or runs queries, including Grafana, Grafana Alloy, Fluent Bit, OpenTelemetry clients, scripts and monitoring tools. Record the deployment mode you chose, because a monolithic install has far fewer internal flows than a microservices or simple scalable layout. The output is a table with one row per source, destination and purpose. Confirm the final list with the platform owner and the network team before writing any rule.

  2. Map each flow to a Loki port

    Assign every row in the inventory to one of three ports. HTTP 3100 carries the push API, query API, /ready and /metrics. gRPC 9095 carries traffic between Loki components such as distributors and ingesters. Memberlist gossip uses 7946. Flows that do not match one of these ports, such as traffic from a log shipper to a reverse proxy, belong to a different rule set and should be documented separately. The check for this step is that every row maps to exactly one port and one direction.

  3. Place the authenticating reverse proxy in front of port 3100

    Loki has no built-in authentication layer, so the documentation expects an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of the HTTP API. Configure the firewall so that clients and Grafana reach the proxy, and only the proxy reaches port 3100 on Loki nodes. Confirm with your security team how the proxy handles the X-Scope-OrgID header for tenant routing. The check is that a direct request to port 3100 from a client subnet is refused while the same request through the proxy succeeds.

  4. Open 9095 and 7946 only between Loki nodes

    Create rules that allow TCP 9095 and TCP 7946 between Loki node addresses and deny them from every other network. Clients, log shippers and users should never reach these ports. If you run Loki on Kubernetes, express the same restriction with network policies that select Loki pods. Memberlist gossip needs TCP 7946 only, so do not open UDP 7946 unless a separate, documented requirement calls for it. The check is a connection test from a node inside the Loki subnet that succeeds and a test from an outside host that fails.

  5. Confirm TCP-only rules for 7946

    Review the rule set and remove any UDP entry for port 7946 that was added by a template or a default policy. Check your load balancers, security groups and host firewalls, since each layer can add rules independently. Ask your cloud or infrastructure team to confirm that no intermediate device changes the TCP session behavior between nodes. The check is a written rule export that shows TCP 7946 as the only protocol for that port.

  6. Test readiness and metrics from an allowed host

    From a host inside the allowed management or monitoring network, request /ready and /metrics on each Loki component through the path your rules permit. A ready response confirms the component is serving, and a metrics response confirms your scraper can reach it. Repeat the request from a host that should be blocked and confirm it fails. Record the results with timestamps so the change record shows the expected behavior. The check is a passing test from the allowed host and a failing test from every disallowed host.

  7. Confirm ring membership after the rules are live

    After the rules are in place, check that every Loki node has joined the memberlist ring and that component rings report healthy members. Failed ring joins after a rule change usually point to blocked TCP 7946 or a blocked gRPC path on 9095. Confirm with the platform owner which ring status views your team will monitor from now on. The check is a ring view with all expected members present and healthy, saved as part of the change record.

Security risks of exposing Loki ports

Loki's network surface is small, but several of its ports carry data or control traffic that should never reach users or networks outside the cluster. The cards below cover the exposure mistakes that most often turn a working deployment into an open log store, and the checks to run against your own firewall and proxy rules.

Port 3100 without a proxy

Loki has no built-in authentication layer, so the HTTP API on port 3100 serves push, query and management requests to anyone who can reach it. Put an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of it, and allow inbound traffic to 3100 only from that proxy. Confirm in your environment that no load balancer, ingress or security group forwards 3100 directly to Loki.

Loki authentication docs

Internal gRPC and gossip exposed

Port 9095 carries gRPC traffic between components such as distributors and ingesters, and port 7946 carries memberlist gossip. Neither is meant for clients, and reaching them from outside the cluster lets a host join or disrupt the ring. Restrict both to the Loki components themselves, and confirm that node security groups, Kubernetes network policies and host firewalls block them from other subnets.

Open metrics and readiness endpoints

The /metrics and /ready endpoints on port 3100 reveal internal state, including tenant activity, ingestion limits and component health. Exposing them publicly gives outsiders a map of your cluster and its load. Route monitoring scrapes over an internal network or restrict these paths at the proxy, and confirm that your Prometheus or Alloy scrape targets still reach them after the change.

Trusting the tenant header

When auth_enabled is true, Loki selects the tenant from the X-Scope-OrgID header on each request. A client that can set this header directly can read or write another tenant's logs. The proxy should authenticate the caller, then set or overwrite the header itself, stripping any value the client supplied. Test this by sending a request with a foreign tenant ID through the proxy and confirming it is rejected.

Loki multi-tenancy docs

Mesh sidecars breaking gRPC and gossip

A service mesh sidecar can intercept traffic on 9095 and 7946, changing how pods reach each other and how the ring forms. Loki components may fail to join the ring or see unhealthy peers even when the firewall rules look correct. Decide whether these ports are excluded from sidecar interception, and confirm ring health after injection, since the mesh and firewall policies must agree.

Firewall rule drift over time

Port rules tend to drift as components are added, nodes are replaced or a proxy is moved. A rule opened for a temporary test can remain for years, and a new collector may be added without a matching rule. Keep the port matrix in version control, review it after every topology change, and periodically scan the cluster from outside to confirm that 3100, 9095 and 7946 are reachable only where the design allows.

Questions teams ask about Loki ports and firewall work

Does UDP 7946 need to be open for Loki memberlist?

No. Loki uses TCP 7946 for memberlist gossip, and UDP does not need to be opened for that port. Open TCP 7946 between every Loki component that joins the ring, including the replicas of each component in every network zone where they run. Keep the other Loki ports as they are: HTTP 3100 for push, query and metrics, and gRPC 9095 between components such as distributors and ingesters. Confirm the exact list against the port reference for your Loki version before you write the rule set, since component names and targets differ between deployment modes.

Who does the Loki firewall work, and how much effort does it take?

The work is shared. Your network and security teams own the change requests, firewall rules and approvals in your environment, and a partner can produce the port inventory, rule set and verification steps for them. The effort depends on the number of Loki components and replicas, how many log collectors must reach the push endpoint, how many network zones and cloud accounts sit between clients and Loki, and how many approval steps your change process requires. Ask any partner for a quote that lists each flow, its source, destination, port and owner, because that inventory is what determines the scope.

What does the client need to provide before port work starts?

Plan to provide the following before any rule is requested:

  • A current network diagram showing zones, subnets, load balancers, proxies and any service mesh.
  • The intended Loki deployment mode and the list of components and replicas per component.
  • Every log source and collector that must push to Loki, with its network location.
  • Access to change windows, firewall administrators and the people who approve security exceptions.
  • Your policy on east-west traffic inside clusters and on which networks may reach the Grafana and query path.

With these inputs, the firewall plan can be reviewed in one pass rather than discovered during a change window.

Can our own team plan and open the Loki ports without outside help?

Often yes, if your team already runs firewall and Kubernetes network policy in the target environment and has someone who knows the Loki component layout. The risk is in the details: missing a gRPC flow between components, opening gossip on the wrong protocol, or forgetting that a collector path crosses a proxy. A partner can review your plan, write the port matrix and test each flow after the change, which is useful when the team has not run Loki before. Decide based on your staff's experience with both Loki and your network controls, and ask for a written scope if you want outside help.

How does port planning change with the Loki deployment mode?

The ports stay the same, but the number of flows changes. Loki documents three deployment modes: monolithic, which runs as a single binary for up to about 20 GB of logs per day; simple scalable, with separate read, write and backend targets that approach 1 TB per day; and microservices for very large clusters. A single monolithic process needs fewer internal flows than a microservices layout with many gRPC paths and a memberlist ring across replicas. Simple scalable mode is being deprecated and will be removed with the Loki 4.0 release, so if you plan a new deployment, check the deployment modes documentation and design the port matrix for the mode you intend to run long term.

Which log collectors need network access to Loki?

Every collector must reach the Loki HTTP endpoint on port 3100 for push, which is the path Grafana Alloy, OpenTelemetry clients, Fluent Bit, Fluentd and the Docker logging driver use when they send data. Collectors do not need access to the internal gRPC or gossip ports. Promtail reached end of life on March 2, 2026, so agents still running it should be scheduled for migration to Grafana Alloy, and the firewall rule for them should be reviewed as part of that change. If collectors sit in a separate zone, the rule must allow that zone to reach the gateway or proxy that fronts Loki, not the internal ring.

Do Loki's ports need to be exposed outside the cluster or network?

Generally no for the internal ports. Port 9095 for gRPC and TCP 7946 for memberlist should stay between Loki components only. Port 3100 is the one that needs a controlled path, and it should sit behind an authenticating reverse proxy, because Loki has no built-in authentication layer. Expose only the gateway or proxy to users and collectors, restrict metrics on /metrics to your monitoring network, and confirm the approach with your security team. Confirm the exact exposure model against the Loki authentication documentation for your environment.

Official Loki network ports reference

The Loki network ports reference is the primary source for which ports each Loki component needs, and it should be read before any firewall change is requested. Loki uses port 3100 for its HTTP API, including push, query, /metrics and /ready, port 9095 for gRPC traffic between components such as distributors and ingesters, and port 7946 over TCP for memberlist gossip. The reference also notes that UDP does not need to be opened for 7946. Use it as the baseline for your change request, then confirm each rule against the deployment mode and version you actually run, since the set of components that talk to each other differs between monolithic, simple scalable and microservices layouts. Check the current version's page at the time of rollout, because port assignments and component roles can change between releases.

Access control is a separate question from port reachability. Loki has no built-in authentication layer, so the documentation requires an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of the HTTP API. Read the Loki authentication page before you decide which network segment can reach port 3100 directly. In most designs only the proxy should be reachable from users and log collectors, while the Loki HTTP port stays on an internal network. Confirm with your security team which proxy will terminate authentication and where TLS ends, because that choice determines which firewall rules you open and which you close.

How DeployOpen plans Loki network access

DeployOpen plans Loki network ports and firewall rules as part of the wider deployment, so each path between clients, components and the reverse proxy is written down, tested and handed over. We work inside your own cloud accounts, data centers or air-gapped networks, and every rule is agreed with your security and network teams before it is opened.

How we scope

  • Map every flow between log collectors, the authenticating proxy, Loki components and Grafana against your network zones
  • Confirm which hosts need TCP 3100, TCP 9095 and TCP 7946, and which must stay closed
  • Agree the written scope, deliverables and timeline in writing before any firewall change is made

How we build

  • Write security group, network policy or host firewall rules for each flow, with the source and destination named
  • Confirm memberlist gossip uses TCP 7946 only, and that no UDP rule is added for it unless your environment requires one
  • Test each path from the intended source, including a check that /ready and /metrics answer only where expected

How we hand over

  • Deliver a rule register listing each port, direction, source, destination, owner and business reason
  • Document the reverse proxy placement, so that clients reach HTTP 3100 only through the authentication layer
  • Run a walkthrough with your platform and security teams so they can review and maintain the rules

How we support

  • Retest the rule set after component scaling, topology changes or a Loki version upgrade
  • Review rule changes against your change process and update the rule register as the cluster grows
  • Ongoing support and continuous testing are available as a retainer if your team wants us to keep the rules current

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.