[{"data":1,"prerenderedAt":189},["ShallowReactive",2],{"seo-verification":3,"blog-self-host-victoriametrics-vps-prometheus-storage-en":6},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-self-host-victoriametrics-vps-prometheus-storage-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":27,"featuredImage":29,"bgImage":30,"posterImage":31,"relatedSolution":32,"intro":35,"sections":36,"ctaTitle":125,"ctaBody":126,"ctaButton":127,"ctaUrl":128,"relatedPosts":129},533,"self-host-victoriametrics-vps-prometheus-storage",{"fr":12,"en":10,"ar":13,"es":14},"self-host-victoriametrics-vps","استضافة-victoriametrics-على-vps-تخزين-مقاييس-prometheus","autoalojar-victoriametrics-vps-metricas-prometheus","Self-Host VictoriaMetrics on a VPS: Long-Term Prometheus Storage","Install VictoriaMetrics on a VPS: a Prometheus-compatible time series database that keeps months of metrics, queryable from Grafana.",7,0,false,"2026-10-30T00:00:00+00:00","2026-10-31T01:54:05+00:00",{"id":17,"name":23,"slug":24,"color":25,"icon":26},"Self-hosting","self-hosting","bg-indigo-500\u002F10 text-indigo-400","cloud",[28],{"id":17,"name":23,"slug":24,"color":25,"icon":26},null,"\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fself-host-victoriametrics-vps-poster.svg",{"categorySlug":33,"appSlug":34},"monitoring-observability","victoriametrics","Prometheus is excellent at collecting metrics and much less so at keeping them. By default it retains fifteen days of history, and extending it grows the disk and memory of the very machine doing the monitoring. VictoriaMetrics is an open-source time series database (Apache-2.0 licensed) that takes over: it receives metrics via `remote_write`, compresses them and keeps them for months, while answering the same query API as Prometheus. This guide installs it as a single Docker container on a VPS, protects it with a password, puts it behind an HTTPS reverse proxy and connects Prometheus and Grafana to it.",[37,41,51,81,84,100,104,107,110,113,116,119,122],{"type":38,"title":39,"body":40},"h2","Why dedicated storage for your metrics","A standalone Prometheus mixes two jobs: scraping your services' metrics every fifteen seconds, and storing them. The first is light; the second grows with every series and every day of history. You end up cutting retention to a few weeks, and the question \"was latency already this high last quarter?\" goes unanswered.\n\nVictoriaMetrics separates the two. Prometheus — or Grafana Alloy, vmagent, Telegraf — keeps scraping, then sends every sample to VictoriaMetrics, which compresses and keeps it. Because it answers the Prometheus query API, Grafana queries it without changing a single dashboard.",{"type":42,"title":43,"items":44},"ul","What VictoriaMetrics brings",[45,46,47,48,49,50],"**Prometheus-compatible** — `remote_write` target, Prometheus query API, Grafana data source with no plugin.","**PromQL and MetricsQL** — your PromQL queries work as-is; MetricsQL adds handier functions.","**Compact storage** — strong series compression, several months of retention on a modest disk.","**Multi-protocol** — InfluxDB line protocol, Graphite, OpenTSDB, OpenTelemetry, CSV and JSON import.","**vmui interface** — series exploration, graphs, cardinality analysis and slowest queries.","**A single binary** — one container, no external dependency, a few tens of megabytes of RAM at rest.",{"type":52,"title":53,"headers":54,"rows":57},"comparison","VictoriaMetrics versus Prometheus local storage",[5,55,56],"VictoriaMetrics","Prometheus alone",[58,62,66,70,74,77],[59,60,61],"Typical retention","Several months to several years","Fifteen days by default",[63,64,65],"Centralise several servers","Yes, via remote_write","No, one instance per scope",[67,68,69],"Query language","PromQL and MetricsQL","PromQL",[71,72,73],"Ingestion formats","Prometheus, InfluxDB, Graphite, OpenTSDB, OTLP","Prometheus scraping",[75,76,76],"Grafana","Prometheus data source",[78,79,80],"Target scraping","Possible, but left to Prometheus or vmagent","Yes, that is its job",{"type":38,"title":82,"body":83},"Prerequisites","An Ubuntu 24.04 VPS with **1 GB of RAM** is enough to start; plan 2 GB and more disk if you centralise many servers. You need Docker with the Compose plugin, and a **domain name** pointing to the VPS, with nginx and an HTTPS certificate: your servers will send their metrics there and Grafana will query it, so the address must be stable and encrypted.\n\nIdeally, install VictoriaMetrics on a machine **separate** from the servers it monitors: if it goes down with them, you lose precisely the data that explains the outage.",{"type":85,"title":86,"steps":87},"steps","Install VictoriaMetrics with Docker Compose",[88,91,94,97],{"title":89,"body":90},"Prepare the directory and the password","Create the application directory and a `.env` file holding the password of the `admin` user.\n```bash\nmkdir -p \u002Fopt\u002Fvictoriametrics && cd \u002Fopt\u002Fvictoriametrics\necho \"ADMIN_PASSWORD=$(openssl rand -hex 16)\" > .env\nchmod 600 .env\n```",{"title":92,"body":93},"Write the docker-compose.yml","The port is published on the loopback interface only: only nginx reaches it. The two `-httpAuth` options protect **every** endpoint — interface, queries and ingestion. `-retentionPeriod=12` keeps twelve months of data.\n```yaml\nservices:\n  victoriametrics:\n    image: victoriametrics\u002Fvictoria-metrics:v1.155.0\n    restart: unless-stopped\n    ports:\n      - \"127.0.0.1:8428:8428\"\n    command:\n      - -storageDataPath=\u002Fstorage\n      - -retentionPeriod=12\n      - -httpAuth.username=admin\n      - -httpAuth.password=${ADMIN_PASSWORD}\n      - -selfScrapeInterval=30s\n    volumes:\n      - victoriametrics-data:\u002Fstorage\n\nvolumes:\n  victoriametrics-data: {}\n```",{"title":95,"body":96},"Start the container","Startup takes less than a second. The log should show \"started VictoriaMetrics\" followed by the start of self-scraping.\n```bash\ndocker compose up -d\ndocker compose logs --tail 20\n```",{"title":98,"body":99},"Publish over HTTPS with nginx","In your domain's vhost (certificate obtained with certbot), proxy to the local port. Raise `client_max_body_size`: `remote_write` batches quickly exceed the default limit.\n```nginx\nlocation \u002F {\n    proxy_pass http:\u002F\u002F127.0.0.1:8428;\n    proxy_set_header Host $host;\n    proxy_set_header X-Forwarded-Proto $scheme;\n    client_max_body_size 64m;\n}\n```",{"type":101,"title":102,"body":103},"tip","Without a password, the database is open for writing","Without the `-httpAuth` options, anyone who knows the address can read all your metrics **and** write fake ones, or even delete series through the admin API. Keep authentication enabled, and never publish port 8428 directly on the public IP: always go through the HTTPS reverse proxy.",{"type":38,"title":105,"body":106},"Send metrics from Prometheus","On each server running Prometheus, add a `remote_write` block to `prometheus.yml`, then reload Prometheus. It keeps scraping as before and duplicates every sample to VictoriaMetrics.\n```yaml\nremote_write:\n  - url: https:\u002F\u002Fmetrics.example.com\u002Fapi\u002Fv1\u002Fwrite\n    basic_auth:\n      username: admin\n      password: \"\u003CADMIN_PASSWORD>\"\n```\n\nThen check that data arrives: the `up` series of your targets should answer. Recent samples appear after about thirty seconds, a normal delay VictoriaMetrics applies to instant queries.\n```bash\ncurl -u admin:\u003CADMIN_PASSWORD> \\\n  'https:\u002F\u002Fmetrics.example.com\u002Fapi\u002Fv1\u002Fquery?query=up'\n```",{"type":38,"title":108,"body":109},"Query VictoriaMetrics from Grafana","In Grafana, add a data source of type **Prometheus** with the URL `https:\u002F\u002Fmetrics.example.com`, tick **Basic auth** and enter the `admin` user and the password. Your existing dashboards — Node Exporter Full, for example — work unchanged, over the whole depth of history kept.\n\nTo explore without Grafana, open `https:\u002F\u002Fmetrics.example.com\u002Fvmui`: the built-in interface graphs queries, lists series and shows, in the cardinality tab, which metrics cost the most storage.",{"type":38,"title":111,"body":112},"Retention, disk and backup","Retention is set with `-retentionPeriod`: a bare number counts months, and the suffixes `d`, `w` or `y` count days, weeks or years. Disk usage depends mostly on the **number of active series** and the scrape frequency: measure it after a week (`du -sh` on the volume) rather than estimating it. To back up, the official `vmbackup` tool takes consistent snapshots without stopping the database; otherwise, stop the container before copying the volume.",{"type":38,"title":114,"body":115},"Send metrics without Prometheus","Prometheus is not mandatory. VictoriaMetrics directly accepts the Prometheus text format, the InfluxDB line protocol, Graphite, OpenTSDB and OpenTelemetry. An application can therefore push its own counters with a single HTTP call — handy for a business metric, a backup script or a scheduled job that does not run long enough to be scraped.\n```bash\ncurl -u admin:\u003CADMIN_PASSWORD> \\\n  -d 'orders_total{shop=\"casa\"} 1284' \\\n  https:\u002F\u002Fmetrics.example.com\u002Fapi\u002Fv1\u002Fimport\u002Fprometheus\n```\n\nIf you already use **Telegraf**, point its InfluxDB output to `https:\u002F\u002Fmetrics.example.com` with the same credentials: VictoriaMetrics presents itself as an InfluxDB database for writes. To scrape targets without installing Prometheus on every machine, the lightweight **vmagent** reads the same `scrape_configs` as Prometheus and ships everything via `remote_write`; it buffers samples on disk if VictoriaMetrics is briefly unreachable.",{"type":38,"title":117,"body":118},"Keep cardinality under control","The cost of a time series database does not depend on the number of samples but on the **number of series**: every unique combination of metric name and labels creates one. A label carrying a user ID, an IP address or a full URL multiplies series by the thousand, and that is what fills memory and disk — with VictoriaMetrics as with Prometheus.\n\nThe **Cardinality** tab of vmui lists the metrics and labels producing the most series. Check it after connecting a new service: a label with unbounded values is fixed at the source, in the application or with a `metric_relabel_configs` rule on the Prometheus side, before it fills months of storage.",{"type":38,"title":120,"body":121},"Update VictoriaMetrics","The project ships a new release several times a month, with detailed release notes. The storage format stays compatible across versions: updating means changing the image number in `docker-compose.yml`, then restarting the container. The data volume is kept, and the short gap during the restart is absorbed by the Prometheus or vmagent buffer, which resends pending samples.\n```bash\ncd \u002Fopt\u002Fvictoriametrics\ndocker compose pull\ndocker compose up -d\n```",{"type":38,"title":123,"body":124},"One-click install from the ServOrbit Marketplace","The ServOrbit Marketplace installs VictoriaMetrics on your VPS without a command line: it deploys the official container, generates the password of the `admin` user, enables authentication on every endpoint and publishes the interface over HTTPS on a subdomain of your domain or on the VPS's free subdomain. The password is shown in your client area; all that is left is to add the `remote_write` block to your servers and the data source in Grafana.","Your metrics for the long run, on your VPS","A ServOrbit Ubuntu 24.04 VPS with 1 GB of RAM is enough to start VictoriaMetrics. One-click install from the Marketplace, HTTPS on your domain or on the VPS's free subdomain, password generated for you.","Install VictoriaMetrics","\u002Fmarketplace\u002Fmonitoring-observability\u002Fvictoriametrics",[130,154,172],{"id":131,"slug":132,"slugs":133,"title":137,"excerpt":138,"readTime":139,"views":140,"isPinned":19,"publishedAt":141,"updatedAt":142,"category":143,"categories":149,"featuredImage":29,"bgImage":30,"posterImage":151,"relatedSolution":152},147,"prometheus-on-a-vps-clear-durable-monitoring",{"fr":134,"en":132,"ar":135,"es":136},"installer-prometheus-vps","prometheus-على-vps-مراقبة-واضحة-ومستدامة","instalar-prometheus-en-un-vps","Prometheus on a VPS: clear, durable monitoring","Install Prometheus on a VPS to collect metrics, export the state of your services and prepare reliable alerts.",3,1,"2026-01-29T00:00:00+00:00","2026-09-07T11:26:10+00:00",{"id":144,"name":145,"slug":146,"color":147,"icon":148},8,"Security & Monitoring","securite-monitoring","bg-rose-500\u002F10 text-rose-400","security",[150],{"id":144,"name":145,"slug":146,"color":147,"icon":148},"\u002Fblog\u002Fcovers\u002Finstaller-prometheus-vps-poster.svg",{"categorySlug":33,"appSlug":153},"prometheus",{"id":155,"slug":156,"slugs":157,"title":161,"excerpt":162,"readTime":163,"views":140,"isPinned":19,"publishedAt":164,"updatedAt":165,"category":166,"categories":167,"featuredImage":29,"bgImage":30,"posterImage":169,"relatedSolution":170},106,"vps-monitoring-with-grafana-and-prometheus",{"fr":158,"en":156,"ar":159,"es":160},"monitoring-vps-grafana-prometheus","مراقبة-الخادم-الافتراضي-vps-باستخدام-grafana-و-prometheus","monitorizacion-vps-grafana-prometheus","VPS Monitoring with Grafana and Prometheus","Deploy Prometheus 3.x, Grafana 13.x, Node Exporter and Alertmanager on your VPS with Docker Compose. Dashboards, alerts and hardening.",11,"2026-03-06T00:00:00+00:00","2026-10-05T14:05:27+00:00",{"id":144,"name":145,"slug":146,"color":147,"icon":148},[168],{"id":144,"name":145,"slug":146,"color":147,"icon":148},"\u002Fblog\u002Fcovers\u002Fmonitoring-vps-grafana-prometheus-poster.svg",{"categorySlug":33,"appSlug":171},"grafana",{"id":173,"slug":174,"slugs":175,"title":179,"excerpt":180,"readTime":181,"views":18,"isPinned":19,"publishedAt":182,"updatedAt":183,"category":184,"categories":185,"featuredImage":29,"bgImage":30,"posterImage":187,"relatedSolution":188},497,"grafana-alloy-on-a-vps-install-and-migrate-from-promtail",{"fr":176,"en":174,"ar":177,"es":178},"grafana-alloy-vps-monitoring","تثبيت-grafana-alloy-على-vps-والانتقال-من-promtail","grafana-alloy-en-un-vps-instalar-y-migrar-desde-promtail","Grafana Alloy on a VPS: install it and migrate from Promtail","Install Grafana Alloy on your VPS, collect logs and metrics with a single agent, and migrate from Promtail without losing logs or sending them twice.",12,"2026-10-22T00:00:00+00:00","2026-10-23T13:27:02+00:00",{"id":144,"name":145,"slug":146,"color":147,"icon":148},[186],{"id":144,"name":145,"slug":146,"color":147,"icon":148},"\u002Fblog\u002Fcovers\u002Fgrafana-alloy-vps-monitoring-poster.svg",{"categorySlug":33,"appSlug":171},1793414294865]