---
title: "Deploy VictoriaMetrics"
description: "VictoriaMetrics 1.152 Prometheus-compatible metrics DB with auth and OTLP."
category: "Observability"
url: https://railway.com/deploy/victoriametrics-1
---

# Deploy VictoriaMetrics

VictoriaMetrics 1.152 Prometheus-compatible metrics DB with auth and OTLP.

**[Deploy VictoriaMetrics on Railway](https://railway.com/template/victoriametrics-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/victoriametrics-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Observability

## Template content

### victoriametrics https://cdn.simpleicons.org/victoriametrics

- **Image:** victoriametrics/victoria-metrics:v1.152.0
- **Start command:** `/victoria-metrics-prod -envflag.enable -storageDataPath=/storage`
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host VictoriaMetrics on Railway

VictoriaMetrics is a fast, cost-efficient open-source time series database and a drop-in Prometheus replacement. It accepts metrics through Prometheus remote write, the Prometheus text format, InfluxDB line protocol and OpenTelemetry. You query it with PromQL-compatible MetricsQL from Grafana or from its built-in vmui web interface for exploring data.

## About Hosting VictoriaMetrics

This template deploys single-node VictoriaMetrics v1.152.0 with a Railway volume at `/storage` and a public domain. Every endpoint except the `/health` and `/ping` checks requires HTTP basic auth, using the `admin` user and a password generated at deploy time. Metrics are kept for 30 days by default. VictoriaMetrics compresses data heavily, so a Hobby volume (5 GB) holds a lot of metrics for small projects, but watch disk use as series grow. It also listens on Railway's private network over IPv6, so services and Grafana in the same project can reach it without the public domain.

## Common Use Cases

- A long-term Prometheus remote-write target for apps, exporters and Grafana Alloy
- Receiving OpenTelemetry metrics directly from application SDKs
- A cheaper, lighter metrics backend for Grafana dashboards and alerting

## Dependencies for VictoriaMetrics Hosting

- `victoriametrics/victoria-metrics:v1.152.0` (official image)
- A Railway volume mounted at `/storage`
- Grafana, Prometheus, vmagent or an OpenTelemetry SDK to send and read metrics

### Deployment Dependencies

- [VictoriaMetrics documentation](https://docs.victoriametrics.com/victoriametrics/)
- [VictoriaMetrics v1.152.0 release notes](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.152.0)
- [OpenTelemetry ingestion](https://docs.victoriametrics.com/victoriametrics/integrations/opentelemetry/)
- [Railway volumes](https://docs.railway.com/reference/volumes)

### Implementation Details

| Service | Image | Networking | Storage |
| --- | --- | --- | --- |
| victoriametrics | `victoriametrics/victoria-metrics:v1.152.0` | public domain on 8428; private IPv6 | volume at `/storage` |

Send metrics:

```yaml
# Prometheus / Grafana Alloy remote_write
remote_write:
  - url: https:///api/v1/write
    basic_auth: { username: admin, password:  }
```

```env
# OpenTelemetry SDK (http/protobuf only; JSON is not accepted)
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=https:///opentelemetry/v1/metrics
OTEL_EXPORTER_OTLP_METRICS_HEADERS=Authorization=Basic 
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
```

In Grafana, add a Prometheus data source with URL `${{victoriametrics.VICTORIAMETRICS_PRIVATE_URL}}` and basic auth.

| Variable | Default | Purpose |
| --- | --- | --- |
| `httpAuth_username` | `admin` | Basic auth user |
| `httpAuth_password` | generated secret | Basic auth password |
| `retentionPeriod` | `30d` | How long samples are kept (e.g. `90d`, `1y`) |
| `enableTCP6` | `true` | Listen on IPv6 for Railway's private network |

Notes:

- Flags are read from environment variables (`-envflag.enable`); any `-flag.name` can be set as `flag_name`.
- The vmui query interface is at `/vmui`.
- Samples newer than about 30 seconds are hidden from queries by default (`-search.latencyOffset`).

This is a community-maintained deployment package and does not imply affiliation with or endorsement by VictoriaMetrics.

## Why Deploy VictoriaMetrics on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying VictoriaMetrics on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rootprint](https://railway.com/deploy/rootprint-1) — Open-source logs and traces with full-text search on object-storage.
- [Pyroscope profiling](https://railway.com/deploy/pyroscope-profiling) — Protected continuous profiling with durable Pyroscope storage.
- [SigOnly](https://railway.com/deploy/sigonly) — Deploy SigNoz with a working demo app & config in one click

Open this page in a browser: https://railway.com/deploy/victoriametrics-1
