Deploy VictoriaLogs
High-performance, cost-effective, scalable, open-source logs database
VictoriaLogs
Just deployed
/victoria-logs-data
Deploy and Host VictoriaLogs on Railway
VictoriaLogs is a high-performance, open-source logs database designed for efficiency and ease of use. It offers exceptional data compression and low resource usage, allowing you to ingest and query massive volumes of structured and unstructured logs without the high complexity or costs associated with traditional solutions like Elasticsearch or Loki.
About Hosting VictoriaLogs
Hosting VictoriaLogs on Railway requires configuring the official Docker container to handle dynamic networking and persistent storage. This template automatically provisions a persistent Railway Volume mounted at /victoria-logs-data to ensure your log data survives deployments and restarts. It also utilizes a custom shell-based startup command to properly handle environment variables for basic authentication and port binding. The result is a secure, persistent, and production-ready log management instance that scales vertically with your needs.
Common Use Cases
- Centralized Application Logging: Aggregate logs from distributed microservices, Python scripts, or Go applications into a single queryable source.
- Long-term Log Archival: Store logs for weeks or months (configurable via retention policies) with minimal storage costs due to high compression.
- Debug & Audit Trails: perform high-speed full-text searches across millions of log lines to identify errors or track user activity.
Dependencies for VictoriaLogs Hosting
- Railway Volume: Required to persist log data (mounted at
/victoria-logs-data). - Docker Image: Uses the official
victoriametrics/victoria-logsimage.
Deployment Dependencies
Implementation Details
This template uses a specific Custom Start Command to ensure environment variables are expanded correctly and persistence is enabled:
/bin/sh -c "exec /victoria-logs-prod -httpListenAddr 0.0.0.0:$PORT -storageDataPath /victoria-logs-data -retentionPeriod ${RETENTION_PERIOD} -httpAuth.username $VL_USERNAME -httpAuth.password $VL_PASSWORD -enableTCP6=true"
Required Environment Variables:
PORT: Managed automatically by Railway.RETENTION_PERIOD: (e.g.,30d,1y)VL_USERNAME: Your chosen username for Basic Auth.VL_PASSWORD: Your secure password.
Test Your Deployment
Once deployed, you can test ingestion directly from your browser console or a Node.js script.
1. Insert a Log (JavaScript/Fetch) You can run this snippet in your browser's Developer Console (F12) or a Node.js environment (v18+). Change your-railway-url/, username and password.
const url = "https:///your-railway-url/jsonline";
const username = "user";
const password = "password";
fetch(url, {
method: "POST",
headers: {
"Content-Type": "application/json",
// Create the Basic Auth header (user:password base64 encoded)
"Authorization": "Basic " + btoa(`${username}:${password}`)
},
body: JSON.stringify({
_msg: "Test log entry",
level: "info",
env: "railway"
})
}).then(response => {
if (response.ok) console.log("Log sent successfully!");
else console.error("Error:", response.status);
});
Why Deploy VictoriaLogs 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 VictoriaLogs 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.
Template Content
VictoriaLogs
victoriametrics/victoria-logs:latestVL_USERNAME
The username for the VictoriaLogs instance
