Running Loki with Docker Compose for evaluation: what it proves and when to use it
A team that needs to see whether Loki fits its logs before committing to a cluster should start with a single-host proof of concept. Grafana supports installing Loki and Alloy with Docker or Docker Compose for evaluation, testing or development, running Loki as a single binary. Grafana recommends Helm or Tanka for production, so a Compose stack answers fit questions but not operating questions. Treat it as a way to test assumptions, not as a preview of the production deployment.
Define the questions the proof of concept must answer before anyone writes a Compose file. Typical questions are whether your log sources can reach Alloy and push to Loki at the volume you expect, whether the labels you plan to use keep queries practical in Grafana, whether your team can write the LogQL it needs, and whether the retention and tenant model you want is achievable with the settings Loki exposes. Write the expected daily volume, the sources and the query examples down first. Confirm the volume figure with your own log sources, because a single host cannot tell you how a cluster will behave at your scale.
Loki is licensed under AGPLv3, a change Grafana Labs announced on April 20, 2021 when it moved Loki and its other core projects from Apache License 2.0. Legal and procurement reviewers should read the license terms against how the team plans to modify, host and offer Loki before a sign-off. Confirm the obligations with your counsel, and record the evaluation build version, which the Loki releases on GitHub page lists, so the decision is tied to a known release.
Which deployment path fits which stage
This table compares the four Loki paths a team meets on the way from a proof of concept to production: Docker Compose, monolithic mode, simple scalable mode and microservices. Read each row to see what the path is for, the scale Loki documents for it, and what changes for storage, retention and authentication. The main takeaway is that the Compose setup is for evaluation only, and production work moves to Helm or Tanka.
| Path | Intended use | Documented scale | Storage, retention and authentication |
|---|---|---|---|
| Docker Compose evaluation | Proof of concept, testing or development on a workstation or lab host | Not a sizing target; Grafana recommends Helm or Tanka for production | Local or test storage; confirm retention is set deliberately and add a reverse proxy before any shared access |
| Monolithic mode on one server | Small single-binary deployment with one Loki process running all components | Up to about 20 GB of logs per day, per Loki's deployment modes docs | Object storage is recommended for production; retention is off by default and must be enabled; put an authenticating reverse proxy in front |
| Simple scalable mode | Separate read, write and backend targets for growing volumes | Approaching 1 TB per day, per Loki's deployment modes docs | Deprecated and scheduled for removal with Loki 4.0; plan a move to microservices before adopting it |
| Microservices with Helm or Tanka | Production clusters and very large log volumes operated on Kubernetes | Designed for very large clusters; confirm sizing with the sizing guidance for your volume | Object storage for chunks and index, compactor-driven retention, and a gateway or proxy you configure for authentication |
Setting up a Loki and Alloy proof of concept with Compose
This sequence takes a team from an empty host to a single-binary Loki instance receiving sample logs from Alloy and queryable in Grafana. It is built for evaluation and testing, not for production.
Install Docker and Compose on the host
Install Docker Engine and the Compose plugin on a Linux host you control, following the install instructions in the Loki Docker guide. Confirm the daemon is running and that a test container starts, so later failures point to Loki or Alloy rather than the container runtime. Check that
docker compose versionreturns a version string before going further.Obtain the official Loki and Alloy images
Pull the official Grafana Loki and Grafana Alloy images, pinning explicit version tags instead of relying on latest so the proof of concept stays reproducible. Choose a Loki tag from the Loki releases page and record it with the Alloy tag you selected. Confirm both images appear in
docker image ls.Write the single-binary Loki configuration
Create a Loki configuration file that runs the single binary in monolithic mode with local filesystem storage, which the Loki documentation supports for evaluation but not typically for production. Set auth_enabled deliberately: true enables multi-tenancy and requires the X-Scope-OrgID header on every request, while false is simpler for a first test. Decide whether retention_enabled stays off, which keeps logs indefinitely, or is set on with a compactor configuration, and note that retention is disabled by default. Confirm the file parses by starting Loki with it in the next step.
Mount volumes with matching UID and GID ownership
The Loki image runs as user loki with UID 10001 and GID 10001 by default, so the host directories mounted for configuration data and chunks must be owned by that UID and GID or Loki cannot write. Create the directories, set ownership with
chownto 10001:10001, and reference them in the Compose file for the Loki service. Start the stack and check the container logs for permission errors on the data path.Add Alloy to send sample logs
Add an Alloy service to the same Compose file with a configuration that tails a sample log file or the Docker container logs and pushes them to Loki's push endpoint on the Compose network. Use Alloy because Grafana names it the supported log shipper for Loki and Promtail has reached end of life. Confirm Alloy reports successful sends in its own logs or its component UI before moving on.
Confirm the Loki ready endpoint responds
Before querying, call Loki's ready endpoint on the published HTTP port from the host and confirm it returns a ready response. If the request fails, check the container logs for configuration errors or volume permission problems and correct them before continuing. This check separates Loki startup problems from ingestion or Grafana problems later.
Run a test query from Grafana
Add Loki as a data source in Grafana, pointing it at the Loki service address, and set the X-Scope-OrgID header if auth_enabled is true. Write a test log line through the sample source, then run a LogQL query that selects its stream label and filters on a unique marker string. The step is complete when the marker line appears in Grafana Explore, which shows the full path from Alloy through Loki to the query layer works.
How logs move through the Compose proof of concept
Logs start at a source container or host, where Grafana Alloy collects them and pushes them to a single Loki process. Loki writes chunks and its index to a local filesystem or object store inside the same Docker host. Grafana then queries Loki over HTTP. Check that the dashed boundary holds only evaluation components, and confirm that the storage volume and the user that owns it match the image's non-root UID and GID before you rely on the data.
Log flow from source to Grafana on one Docker host.
Security gaps an evaluation setup leaves open
A single-binary Loki stack is quick to start, but its defaults favor a proof of concept over a shared environment. The cards below cover the gaps that most often carry over unnoticed when an evaluation moves toward real logs, real users or a shared host.
No built-in authentication
Loki ships without an authentication layer of its own. Its documentation says you must place an authenticating reverse proxy, such as nginx, HAProxy, OAuth2 Proxy or Pomerium, in front of it. In a Compose file, the port mapping for Loki's HTTP listener can expose the push and query API directly to anyone who can reach the host. Check that Loki's port is bound only to the internal network and that every client reaches it through the proxy.
Loki authentication docsTenant separation depends on auth_enabled
Multi-tenancy only takes effect when auth_enabled is set to true, and tenants are then identified by the X-Scope-OrgID header on each request. Loki does not verify that header. Any client that can reach Loki can set any tenant ID and read another tenant's data. Confirm that the proxy overwrites or strips this header from incoming requests and sets it from the verified identity.
Non-root user and volume permissions
The Loki image runs as user loki with UID 10001 and GID 10001. A host directory bind-mounted for chunks or the index must be writable by that UID, and a common workaround is to make it world-writable, which weakens the host. Use named volumes or set ownership to 10001 explicitly, and confirm the container cannot write outside its data path.
Retention disabled by default
Retention is applied by the compactor and is disabled by default, so logs persist indefinitely until retention_enabled is set. An evaluation that runs for months will keep every log it ingests, which may include personal data or secrets. Decide the retention period before pointing real sources at the stack, and verify that the compactor is running with retention enabled.
Host-level port exposure
Docker publishes ports on all host interfaces by default unless the mapping names a specific address. Loki's HTTP port, Alloy's UI and any Grafana port can each become reachable from the wider network without anyone deciding that. Bind published ports to 127.0.0.1 or a private interface, keep internal component ports off the host, and check the result with a port scan from another machine on the network.
Why Grafana points production to Helm or Tanka
Platform engineers own the cluster once the proof of concept ends. The Compose file runs Loki as one container with local storage, which suits evaluation. Grafana points production to Helm or Tanka because those paths carry the component layout, storage wiring and upgrade steps that a single file leaves to your team. Compare your daily log volume with the documented deployment modes before choosing a path.
- Scaled components: Monolithic mode runs every component in one binary and is documented for up to about 20 GB of logs per day. Simple scalable mode is being deprecated and will be removed with Loki 4.0, so a plan that depends on it needs another target.
- Object storage: Grafana's recommended production stores are Amazon S3, Google Cloud Storage and Azure Blob Storage. The local filesystem and S3-compatible stores such as MinIO are supported but not typically recommended for production, so the Compose volume is only a starting point.
- Upgrade handling: A Compose file pins an image tag that someone edits by hand. Helm and Tanka keep configuration in versioned files you can review, which matters when schema and configuration changes arrive with a new release.
- Shipper migration: Promtail reached end of life on March 2, 2026, with no further updates or commercial support. Grafana Alloy is the migration target, so carry it into the production design rather than copying the evaluation agent.
Check the deployment mode, object store and shipper choices against the Loki deployment modes documentation before you copy the evaluation file forward.
Security reviewers test what the deployment exposes and how access is proven. Loki has no built-in authentication layer, so the Compose evaluation usually leaves the API reachable without any identity check. That is acceptable for a test on isolated hardware and is the first gap a production review will raise. The review should confirm how identity, tenancy and deletion are enforced before any production logs arrive.
- Authentication: Loki's documentation says to run an authenticating reverse proxy, such as nginx, HAProxy, OAuth2 Proxy or Pomerium, in front of it. Compose examples do not add this layer, so it is a separate build item for the Helm or Tanka design.
- Tenant identification: Multi-tenancy applies when auth_enabled is true, and each request carries an X-Scope-OrgID header. The header only names a tenant. The proxy must authenticate the caller and set or check the header, or any client can claim another tenant.
- Retention and deletion: Retention is disabled by default, so logs are kept until retention_enabled is set and retention rules are defined. Evaluation data often contains personal or secret values, so set a deletion policy before sample logs are shared.
- Access control features: Token authorization, label-based access control and cross-tenant queries belong to Grafana Enterprise Logs, not the open-source build. Decide early whether your access model needs them.
Confirm the proxy design, the tenant header policy, the retention settings and the access model in writing before production logs are sent.
Finance and procurement teams compare the Compose evaluation with the cost of a production service. Loki is licensed under AGPLv3, so adopting the software carries no license fee, but the production path adds costs that recur for as long as the service runs. Those costs come from infrastructure, operating effort, implementation work and any commercial license chosen. Ask for each as a separate line so the trade-offs stay visible.
- License review: Grafana Labs announced on April 20, 2021 that Loki would move from Apache License 2.0 to AGPLv3. Ask legal counsel to confirm how the AGPLv3 terms apply to your modifications and to any service you expose over a network.
- Recurring infrastructure: Object storage capacity, compute for each Loki component and network transfer recur with log volume and retention. Because retention is off until enabled, unbounded growth is a configuration choice that should appear in the cost model.
- Commercial alternative: Grafana Enterprise Logs is Grafana Labs' commercial product based on Loki. It adds token authorization, label-based access control and cross-tenant queries, with long-term support from version 3.6 until February 1, 2029. Request its license terms as a separate item.
- Services scope: Implementation, Helm or Tanka configuration, proxy setup, upgrade work and ongoing support are separate scopes with separate costs. Ask any provider for a written scope that lists deliverables, exclusions and who maintains the platform after handover.
Ask for a quote that separates one-time build work from recurring infrastructure, support and any Grafana Enterprise Logs license.
Limits to confirm before the proof of concept becomes production
A Compose stack proves that Loki ingests and queries your logs, but it does not prove the setup will hold in production. The cards below list the decisions to settle in your own environment before you copy the evaluation configuration into a longer-lived system.
Pin the Loki version
Choose one Loki release and pin the image tag in your Compose file and in every later deployment. The GitHub releases page lists v3.7.8 as the latest release at the time of writing, but your team should confirm the version it will support, read its release notes and plan how upgrades will be tested. Avoid the latest tag in anything that outlives the evaluation.
Size daily ingestion against the monolithic tier
Measure the log volume your sources would send per day, including peaks, before you choose a deployment mode. Loki documents single-binary monolithic mode for up to about 20 GB per day, and anything above that moves you toward simple scalable or microservices layouts. Confirm the number with a real sample from your hosts and containers, not with a guess.
Deployment modes docsChoose a production object store
The Compose proof of concept typically writes to the local filesystem, which Loki documents as unsuitable for production. Decide which object store your organization will use, such as Amazon S3, Google Cloud Storage or Azure Blob Storage, and confirm that your platform team can provision buckets, credentials and lifecycle policies for it. S3-compatible stores need separate validation.
Storage docsSet retention before data accumulates
Retention is disabled by default, so Loki keeps logs indefinitely until you enable it. Decide how long each log class must be kept, whether retention differs by tenant or stream selector, and who approves deletion. Remember that each stream rule must cover at least 24 hours, and test deletion on a copy before you rely on it in production.
Retention docsDesign authentication in front of Loki
Loki has no built-in authentication, so the Compose stack exposes an unauthenticated write and query endpoint. Before production, place an authenticating reverse proxy such as nginx, HAProxy, OAuth2 Proxy or Pomerium in front of it, and decide how collectors and Grafana will authenticate. Enable auth_enabled only when you have settled how tenant IDs are assigned through the X-Scope-OrgID header.
Decide whether Enterprise Logs features are needed
Open-source Loki does not provide label-based access control or cross-tenant queries. If your teams must restrict which users see which log streams, or query across tenants from one place, confirm those requirements now and compare them with Grafana Enterprise Logs. Treat this as a licensing and architecture decision to settle before the design is built around open-source features.
Enterprise Logs docsQuestions teams ask before running Loki with Compose
Is Docker Compose enough to run Loki in production?
No. Grafana supports installing Loki and Alloy with Docker or Docker Compose for evaluation, testing or development, and recommends Helm or Tanka for production. A Compose stack runs Loki as a single binary, which is the monolithic deployment mode, and the Loki documentation places that mode at up to about 20 GB of logs per day. Production needs decisions Compose does not make for you: durable object storage instead of local filesystem storage, retention settings, a reverse proxy for authentication, backups, upgrades and monitoring. Treat the Compose stack as a way to learn the configuration and test your log sources, then move the validated settings to a production path.
How long does a Loki proof of concept take, and what drives that time?
The duration depends on the scope you set, and no fixed figure applies to every team. The main drivers are the number of log sources you need to connect, how many log formats you must parse, whether you need Grafana dashboards and alerts, and whether the proof of concept must prove a storage target such as S3, Google Cloud Storage or Azure Blob Storage. Each source adds configuration and validation work, and each storage target adds access setup. Agree on a short list of success criteria, such as query speed on a representative sample and retention behavior, before you start, so the proof of concept has a defined end.
What skills and staff time does a Loki evaluation need from our team?
A Compose evaluation needs someone comfortable with Docker, YAML configuration and basic Linux administration, plus a Grafana user who can judge whether the queries answer real questions. Expect at least one engineer to own the stack, and someone from security or compliance to review the retention and access questions early. Staff time is usually the largest cost of an evaluation, so confirm who will do the work and how many hours they can give it. If the team lacks Docker or Kubernetes experience, plan time for that learning, because it affects the production path as well.
Should we hire an outside partner for a Loki evaluation or production rollout?
An outside partner is worth considering when your team lacks time, experience with object storage, or the security review capacity to take a Loki design through to production. DeployOpen plans, implements, hardens, backs up, upgrades and documents self-hosted open-source platforms inside your own infrastructure, and most engagements are fixed-scope with scope, deliverables and timelines agreed in writing before work starts. A quote follows from that written scope, so ask for the scope to include the storage target, authentication design, retention rules, tenancy model and the handover material you need.
What does a quote for Loki work depend on?
A quote depends on the written scope rather than a list price. DeployOpen does not publish a price list. The items that move cost most are the deployment mode and target environment, the number and type of log sources, the object storage and identity systems to connect, the retention and access controls to configure, the security review and documentation expected, and whether you want ongoing support or upgrades through a retainer. Ask each bidder to state assumptions, what is one-time work, and what recurs, such as support, upgrades and continuous testing.
Should we use Grafana Alloy or Promtail to ship logs to Loki?
Use Grafana Alloy. Promtail reached end of life on March 2, 2026, with no further updates or commercial support, and Grafana directs Promtail users to migrate to Grafana Alloy. Alloy is Grafana's supported log shipper for Loki and is a vendor-neutral distribution of the OpenTelemetry Collector. Loki also accepts OpenTelemetry logs over HTTP and data from Fluent Bit, Fluentd and the Docker logging driver, so confirm which collector your hosts already run before you choose. For a new evaluation, start with Alloy so you do not build configuration you will need to replace.
How does the AGPLv3 license affect our Loki evaluation?
Grafana Labs announced on April 20, 2021 that Loki and its other core projects would move from Apache License 2.0 to AGPLv3, so Loki is licensed under AGPLv3. Evaluation inside your own environment is usually straightforward, but the license terms matter once you modify Loki or offer it to others over a network. Have your legal or licensing team review the AGPLv3 obligations against your intended use, including any internal modifications and any customer-facing services. This page does not give legal advice. Grafana's licensing page is the starting point for the vendor's own position.
How DeployOpen scopes a Loki proof of concept
DeployOpen treats a Docker Compose evaluation of Loki as a bounded proof of concept with written exit criteria. We agree the scope first, build the single-binary stack inside your environment, and document what it does and does not show about a production path.
How we scope
- Agree in writing which log sources, volumes and query patterns the proof of concept will test.
- Record the Loki and Alloy versions to be evaluated and confirm the current release before work starts.
- Define success criteria, including whether the team needs multi-tenancy, retention or Grafana access to be tested.
How we build
- Stand up the single-binary Loki configuration with Alloy in Docker Compose, with the non-root container user set and verified.
- Test ingestion from your agreed sources and confirm that queries and Grafana data source access behave as expected.
- Record which settings differ from a production layout, such as the object store choice and the authentication proxy gap.
How we hand over
- Deliver the Compose files, configuration, and a short runbook that the evaluating team can repeat.
- Document the findings against the agreed criteria, with a clear statement of what must change before production.
- Recommend a production path, such as Helm or Tanka, and list the decisions your team must make before moving on.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer once the proof of concept moves forward.
- Ask any partner for the written scope, the named deliverables and the handover format before you sign.

