Loki was designed to be "like Prometheus, but for logs": the same label model, tight integration with Grafana, and low operating cost. If you already use Prometheus and Grafana for metrics, Loki lets you jump from a spike on a graph to the logs from the same service and time in one click. For small and medium teams, a single VPS can run Loki comfortably.
How Loki Works
Each log stream is identified by a set of labels, such as {job="nginx", host="web1", env="prod"}. Loki indexes those labels only; the log text is compressed into chunks. Queries first select streams by labels, then filter log lines with text or regular expressions. Searches are fast when labels narrow the data, and slower for broad text searches across everything.
Deployment Modes
| Mode | Description | Use |
|---|---|---|
| Monolithic | All components in one process | Single VPS, small to medium volumes |
| Simple scalable | Read, write and backend targets scaled separately | Larger volumes, several servers |
| Microservices | Each component separately | Very large installations, usually on Kubernetes |
Start with monolithic mode on one VPS; it is the simplest to operate.
Storage
Loki stores an index (the TSDB index format in current versions) and chunks. For a single server, local filesystem storage on NVMe works well. For larger volumes, longer retention or future scaling, use S3-compatible object storage, which is cheap and durable. Set the schema configuration carefully from the start, since changing it later requires adding new schema periods.
Retention
Retention is handled by the compactor. Enable retention in the compactor configuration and set a retention period globally or per tenant or stream. Without it, logs are kept indefinitely and storage grows forever. Monitor disk use on local storage and alert well before it fills.
Shipping Logs: Promtail and Alloy
Promtail was Loki's original agent for tailing files and the systemd journal. Grafana has deprecated Promtail in favour of Grafana Alloy, a collector that handles logs, metrics and traces and includes a conversion tool for Promtail configurations. For new setups, use Alloy; for existing Promtail installations, plan a migration. Other agents such as the OpenTelemetry Collector, Fluent Bit and Vector can also send to Loki (see our OpenTelemetry guide).
Label Design
- Use a small set of bounded labels: environment, service, host, log type.
- Never use high-cardinality values (user IDs, request IDs, IP addresses, full URLs) as labels; keep them in the log line and filter at query time.
- Prefer structured logs (JSON or logfmt) so LogQL can parse fields when querying.
- Too many streams hurts performance and can hit limits; check stream counts per tenant.
Querying with LogQL
LogQL selects streams with labels and then filters and parses lines: for example, {service="api"} |= "error" | json | status >= 500. Metric queries such as rates of error lines over time can power dashboards and alerts. In Grafana, link metrics panels to logs so investigations move from "what" to "why" quickly.
Alerting
Loki's ruler evaluates LogQL alert rules and sends alerts to Alertmanager, the same way Prometheus does (see our Grafana and Prometheus guide). Alert on patterns such as spikes in error lines, authentication failures or specific critical messages. Grafana-managed alerts can also query Loki.
Security
- Loki's HTTP port (3100) has no authentication in single-tenant mode; keep it on a private network or behind a reverse proxy with authentication.
- Use TLS between agents and Loki across untrusted networks.
- Avoid sending secrets or personal data in logs, or drop and mask them in the agent.
- Restrict Grafana access to log data sources by team where needed.
Monitoring Loki
Loki exposes Prometheus metrics: ingestion rate, rejected samples, request latency, compactor runs and storage operations. Alert on ingestion errors and rate-limit rejections, which mean logs are being dropped.
Sizing
| Log volume | Suggested plan |
|---|---|
| Up to several GB per day, monolithic mode | 2 vCores / 8 GB |
| Tens of GB per day or heavy queries | 4 vCores / 16 GB with object storage |
| Larger volumes | Simple scalable mode across several servers |
Query load often matters more than ingestion: broad searches over long time ranges use the most CPU and memory.
Loki or ELK?
Loki is cheaper and simpler, especially alongside Grafana. Elasticsearch indexes full text and suits heavy search and analytics on log content (see our ELK guide). Many teams choose Loki for operational logs and keep full-text search for specific use cases.
Example: A SaaS Team
A SaaS team runs Loki in monolithic mode on a 2 vCore / 8 GB VPS with chunks in object storage and 30-day retention via the compactor. Grafana Alloy on each application server ships JSON logs from the journal and Nginx with labels for service, env and host. Grafana dashboards link API error-rate panels to the matching logs, and a LogQL rule alerts when payment errors exceed a threshold.
Common Mistakes
- High-cardinality labels such as user or request IDs.
- Retention not enabled in the compactor.
- Port 3100 exposed without authentication.
- Starting new deployments on deprecated Promtail.
- Expecting full-text search speed across all logs without label filters.
In Short
Run Loki in monolithic mode on a VPS with local or object storage, enable compactor retention, ship logs with Grafana Alloy, keep labels bounded, query with LogQL in Grafana, alert through the ruler and keep the endpoint private.
SkyRainCloud Plans for This Workload
Loki is lighter than full-text log stores because it indexes only labels. 2 vCores / 8 GB handles several GB of logs per day in monolithic mode; 4 vCores / 16 GB suits heavier volumes and queries.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.
Frequently Asked Questions
What is Grafana Loki?
Is Promtail still recommended?
Which port does Loki use?
Where does Loki store logs?
How do I set log retention in Loki?
Which labels should I use?
What is LogQL?
Can Loki send alerts?
Loki or Elasticsearch?
Which plan suits Loki?
Related Guides
- VPS Hosting for ELK Stack
- VPS Hosting for Grafana and Prometheus
- VPS Hosting for OpenTelemetry Collectors
- How to Set Up Monitoring and Logging for Applications on a VPS
- Best VPS Hosting in India with NVMe SSD
- How to Add a Custom Minecraft Server Icon (64x64, 2 Min)
- How to Backup Your Minecraft Server
- How to Change Minecraft Server Version