> ## Documentation Index
> Fetch the complete documentation index at: https://blog.onetsolutions.net/llms.txt
> Use this file to discover all available pages before exploring further.

# VictoriaMetrics: store your Prometheus metrics on your VPS

> Run VictoriaMetrics on a VPS: keep and query your Prometheus metrics for months, with little RAM and disk. Step-by-step Docker Compose setup, OnetSolutions.

![VictoriaMetrics: the VMUI Query page, graphing the query sum(rate(vm\_http\_requests\_total\[5m\])) by(path)](https://mintcdn.com/onetsolutions-blog/-JN_N6qVay_LBSAB/images/2026/11/victoriametrics.webp?fit=max\&auto=format\&n=-JN_N6qVay_LBSAB\&q=85\&s=57c710936f984bbbb16878ef81d9e279)

*Published on November 25, 2026*

Your Prometheus metrics take too much disk, or you want to keep months of history without running a cluster: VictoriaMetrics, on a VPS, stores them in a single process and answers PromQL queries.

## What VictoriaMetrics does for you

* **Keep** your metrics history as long as you choose, with a single flag: `-retentionPeriod`.
* **Receive** data from Prometheus over `remote_write`, or let VictoriaMetrics scrape your exporters itself from a `prometheus.yml` file.
* **Query** your series in MetricsQL, a PromQL-compatible language, from the built-in VMUI or from Grafana.
* **Plug in** other sources: InfluxDB line protocol, Graphite, OpenTSDB, OpenTelemetry, CSV or JSON.
* **Simplify** operations: one binary with no dependencies, all data in a single directory.

## At a glance

| | |
| - | - |
| License | Apache-2.0 |
| Language | Go |
| Latest release | v1.157.0, released November 23, 2026 |
| GitHub stars | 18,192 as of November 25, 2026 |
| Minimum resources | No fixed minimum: CPU and RAM depend on active series and queries. The docs advise keeping 50% of RAM free, 50% of CPU spare and 20% free space in the data directory |
| Repository | [github.com/VictoriaMetrics/VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics) |

## Install VictoriaMetrics on your VPS

Prerequisites: a Linux VPS with [Docker](https://help.onetsolutions.net/tutorials/how-to-install-docker) and its Compose plugin.

The single-node version is one container. It listens on port 8428 for writes, queries and the web interface.

Create the service directory:

```bash theme={null}
# Service directory
sudo mkdir -p /opt/victoriametrics
cd /opt/victoriametrics
```

This `compose.yaml` file follows the `victoriametrics` service of `compose-vm-single.yml` in the official repository. The image is pinned to v1.157.0, and only the HTTP port is published, on the VPS itself. Two flags are added: the retention period and self-scraping of VictoriaMetrics' own metrics:

```yaml theme={null}
# /opt/victoriametrics/compose.yaml
services:
  victoriametrics:
    image: victoriametrics/victoria-metrics:v1.157.0
    ports:
      # Writes, queries and VMUI: VPS only
      - "127.0.0.1:8428:8428"
    volumes:
      - vmdata:/storage
    command:
      - "--storageDataPath=/storage"
      - "--httpListenAddr=:8428"
      # Keep 90 days of data (default: 1 month)
      - "--retentionPeriod=90d"
      # Scrape its own metrics every 10 seconds
      - "--selfScrapeInterval=10s"
    restart: always

volumes:
  vmdata: {}
```

Start the container:

```bash theme={null}
sudo docker compose up -d
```

> [!NOTE]
>
> The original file also publishes the Graphite (2003), OpenTSDB (4242) and InfluxDB (8089) ports. Add the `--graphiteListenAddr`, `--opentsdbListenAddr` or `--influxListenAddr` flags only if you use those protocols. The InfluxDB line protocol is still accepted on port 8428, at `/write`.

## First steps

1. **Open VMUI.** From your workstation, open an SSH tunnel to the VPS, then browse to `http://127.0.0.1:8428/vmui`:

   ```bash theme={null}
   ssh -L 8428:127.0.0.1:8428 user@vps-ip
   ```

   Thanks to self-scraping, data is already there. In the Query tab, run `sum(rate(vm_http_requests_total[5m])) by(path)`: the graph shows the HTTP requests VictoriaMetrics receives, by path.

2. **Send your Prometheus metrics.** If Prometheus runs on the same VPS, add these lines to its configuration file, then reload it:

   ```yaml theme={null}
   remote_write:
     - url: http://127.0.0.1:8428/api/v1/write
   ```

   ```bash theme={null}
   # Reload the Prometheus configuration
   kill -HUP `pidof prometheus`
   ```

   Prometheus keeps its data locally and sends a copy to VictoriaMetrics.

3. **Connect Grafana.** Create a Prometheus data source, or a VictoriaMetrics one with the project's plugin, with the URL `http://<victoriametrics-address>:8428`. Your PromQL dashboards work unchanged.

> [!TIP]
>
> Ingested data can take up to about 30 seconds to show up in query results.

## Check that it works

From the VPS, read the container logs:

```bash theme={null}
sudo docker compose logs victoriametrics | grep 'started server'
```

The line `started server at http://0.0.0.0:8428/` confirms the HTTP server is listening.

Then write a test sample in Prometheus format and read it back:

```bash theme={null}
# Write the series foo{bar="baz"} with the value 123
curl -d 'foo{bar="baz"} 123' -X POST 'http://localhost:8428/api/v1/import/prometheus'

# Export the series
curl -G 'http://localhost:8428/api/v1/export' -d 'match={__name__=~"foo"}'
```

The response is one JSON line containing `"__name__":"foo"`, `"bar":"baz"` and `"values":[123]`.

## Secure access

By default, VictoriaMetrics asks for no authentication. The project's docs are clear: its components must run in a private network, never directly reachable from the Internet.

The `compose.yaml` above publishes the port on `127.0.0.1` only. Add HTTP Basic authentication to every endpoint, with a password read from a file.

Generate the password, readable by root only:

```bash theme={null}
# Random password, no trailing newline
sudo mkdir -p /opt/victoriametrics/secrets
printf '%s' "$(openssl rand -hex 24)" | sudo tee /opt/victoriametrics/secrets/httpauth-password > /dev/null
sudo chmod 600 /opt/victoriametrics/secrets/httpauth-password
```

In `compose.yaml`, add the file mount and the two flags to the service:

```yaml theme={null}
    volumes:
      - vmdata:/storage
      - ./secrets/httpauth-password:/etc/victoriametrics/httpauth-password:ro
    command:
      # ... previous flags ...
      - "--httpAuth.username=admin"
      - "--httpAuth.password=file:///etc/victoriametrics/httpauth-password"
```

Apply the change with `sudo docker compose up -d`. VMUI now asks for the `admin` username and this password. On the Prometheus side, add them to the `remote_write` block:

```yaml theme={null}
remote_write:
  - url: http://127.0.0.1:8428/api/v1/write
    basic_auth:
      username: admin
      password_file: /etc/prometheus/vm-password
```

To receive metrics from other servers, go through a [VPC private network](https://help.onetsolutions.net/vps/vpc) rather than the Internet. If public access is a must, the docs recommend an authentication proxy with TLS termination, such as vmauth, in front of VictoriaMetrics.

> [!TIP]
>
> The [console firewall](https://help.onetsolutions.net/vps/firewall) adds a second barrier: allow inbound SSH only, and port 8428 stays out of reach from outside.

## Limits and alternatives

VictoriaMetrics stores and queries, but does not evaluate alerts or draw dashboards: vmalert and Grafana sit next to it. The single-node version is one process; high availability means several instances fed in parallel, or the cluster version.

| Alternative | Difference |
| - | - |
| [Prometheus](https://github.com/prometheus/prometheus) | The reference: scraping, local storage and alerting rules in one server, Apache-2.0 license. |
| [Thanos](https://github.com/thanos-io/thanos) | Extends Prometheus with object storage (S3…) and a global view across instances, Apache-2.0 license. |
| [Grafana Mimir](https://github.com/grafana/mimir) | Distributed, multi-tenant Prometheus storage built for clusters, AGPL-3.0 license. |

## Going further

* [Single-node documentation](https://docs.victoriametrics.com/victoriametrics/single-server-victoriametrics/): flags, retention, security, backups
* The project's [quick start](https://docs.victoriametrics.com/victoriametrics/quick-start/)
* [Install Docker](https://help.onetsolutions.net/tutorials/how-to-install-docker) on your VPS
* [VPC private network](https://help.onetsolutions.net/vps/vpc): connect your servers to VictoriaMetrics without crossing the Internet
* [Web-Check: audit any website's SSL, DNS and security](https://blog.onetsolutions.net/en/web-check-vps-website-ssl-dns-security-scan.md): another tool to host on the same VPS

No VPS at OnetSolutions yet? [Pick yours](https://onetsolutions.net) and run VictoriaMetrics in a few minutes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.