For effective infrastructure monitoring with Grafana on a VPS, a virtual server with 2 vCPU, 4 GB RAM, and 50-100 GB SSD will be the optimal choice for most small and medium-sized projects. This configuration will ensure stable operation of Grafana and Prometheus, allowing you to collect and visualize metrics without delays.
Why Grafana and Why Does It Need a Separate VPS?
Grafana is a powerful tool for visualizing metrics, logs, and traces, allowing you to create interactive dashboards, configure alerts, and deeply analyze the state of your systems. In conjunction with Prometheus, it becomes an indispensable solution for anyone involved in supporting or developing complex IT infrastructures.
Why choose Grafana on a VPS, rather than deploying it locally or on shared hosting?
- Resource Isolation: A VPS provides dedicated resources (CPU, RAM, disk), which guarantees stable performance for Grafana and Prometheus, regardless of "neighbors" on the server. This is critical for monitoring systems that must operate without interruption.
- Scalability: As your infrastructure grows and the volume of collected metrics increases, you can easily scale VPS resources (add CPU, RAM, disk space) without migration.
- Control and Security: Full root access to the VPS gives you complete control over the operating system, installed software, and security settings, which is impossible on shared hosting. This is especially important for a Grafana server, which often processes sensitive data.
- Availability: Hosting Grafana on a reliable VPS provider ensures high availability of your monitoring from anywhere in the world.
For reliable and performant
monitoring on a VPS, Grafana in conjunction with Prometheus is the gold standard.
Minimum and Recommended VPS Requirements for Grafana
Choosing the right VPS is a key step towards building effective monitoring. Below are the minimum and recommended configurations for a Grafana VPS, taking into account its joint operation with Prometheus.
Minimum Configuration (for small projects, up to 5-10 servers, 1-2 users)
- vCPU: 1 core
- RAM: 2 GB
- SSD: 20-30 GB (for OS, Grafana, and a small volume of Prometheus data)
- Operating System: Ubuntu Server 20.04+, Debian 11+
Note: With this configuration, Prometheus may store data for no more than a few days or weeks, depending on the volume of collected metrics. Dashboard performance may decrease when building complex queries over long periods.
Recommended Configuration (for medium projects, up to 30-50 servers, 5-10 users)
- vCPU: 2 cores
- RAM: 4 GB
- SSD: 50-100 GB (for longer Prometheus data storage, from 1 month)
- Operating System: Ubuntu Server 22.04+, Debian 12+
This configuration is optimal for most Grafana VPS hosting use cases, providing a good balance between performance and cost. You will be able to store metrics long enough and not worry about interface speed.
Optimal Configuration (for large projects, 50+ servers, 10+ users, long-term storage)
- vCPU: 4+ cores
- RAM: 8+ GB
- SSD: 200+ GB NVMe (for maximum Prometheus data write/read speed)
- Operating System: Ubuntu Server 22.04+, Debian 12+
For very large loads or long-term metric storage, consider separating Grafana and Prometheus onto different VPS instances, as well as using remote storage for Prometheus (e.g., Thanos, Mimir) for horizontal scaling and long-term retention.
Looking for a reliable server for your projects?
Valebyte offers VPS and dedicated servers with guaranteed resources and fast activation.
View offers →
Installing Grafana and Prometheus on a VPS (Ubuntu 22.04)
Let's look at a step-by-step installation of Grafana and Prometheus on a fresh VPS running Ubuntu 22.04. We will install them on a single server, which is a typical scenario for a medium-sized Grafana VPS.
Step 1: VPS Preparation
Connect to your VPS via SSH and update the system:
sudo apt update
sudo apt upgrade -y
Install necessary packages:
sudo apt install -y wget curl gnupg2 software-properties-common apt-transport-https
Step 2: Install Prometheus
Create a system user for Prometheus:
sudo useradd --no-create-home --shell /bin/false prometheus
Create directories for Prometheus:
sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus
Download the latest stable version of Prometheus (check the current version on the official Prometheus website):
wget https://github.com/prometheus/prometheus/releases/download/v2.47.0/prometheus-2.47.0.linux-amd64.tar.gz
tar xvf prometheus-2.47.0.linux-amd64.tar.gz
cd prometheus-2.47.0.linux-amd64/
Copy binary files and assign permissions:
sudo cp prometheus /usr/local/bin/
sudo cp promtool /usr/local/bin/
sudo chown prometheus:prometheus /usr/local/bin/prometheus
sudo chown prometheus:prometheus /usr/local/bin/promtool
Copy the configuration file and assign permissions:
sudo cp prometheus.yml /etc/prometheus/
sudo chown prometheus:prometheus /etc/prometheus/prometheus.yml
Edit prometheus.yml (for starters, the default config that monitors Prometheus itself is sufficient):
sudo nano /etc/prometheus/prometheus.yml
Ensure the content is approximately as follows:
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
Create a systemd service for Prometheus:
sudo nano /etc/systemd/system/prometheus.service
Add the following content:
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
ExecStart=/usr/local/bin/prometheus \
--config.file /etc/prometheus/prometheus.yml \
--storage.tsdb.path /var/lib/prometheus/ \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.listen-address=:9090
Restart=always
[Install]
WantedBy=multi-user.target
Reload systemd, start, and enable Prometheus:
sudo systemctl daemon-reload
sudo systemctl start prometheus
sudo systemctl enable prometheus
Check the status:
sudo systemctl status prometheus
Prometheus should be accessible at http://YOUR_IP:9090.
Step 3: Install Grafana
Add the Grafana GPG key:
wget -q -O - https://apt.grafana.com/gpg.key | sudo apt-key add -
Add the Grafana repository to the APT sources list:
echo "deb https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
Update the package list and install Grafana:
sudo apt update
sudo apt install grafana -y
Start and enable Grafana:
sudo systemctl start grafana-server
sudo systemctl enable grafana-server
Check the status:
sudo systemctl status grafana-server
Grafana should be accessible at http://YOUR_IP:3000. Default login: admin, password: admin. The system will prompt you to change the password upon first login.
Step 4: Configure Prometheus as a Data Source in Grafana
- Open Grafana in your browser (
http://YOUR_IP:3000) and log in.
- In the left menu, click the gear icon (Configuration) -> "Data Sources".
- Click "Add data source".
- Select "Prometheus".
- In the "Name" field, enter "Prometheus" (or any other descriptive name).
- In the "URL" field, enter
http://localhost:9090.
- Click "Save & Test". If everything is configured correctly, you will see the message "Data source is working".
Now you can create dashboards in Grafana using metrics collected by Prometheus. To get started, you can import pre-built dashboards from Grafana Labs, for example, for monitoring Prometheus itself (ID 2).
Recommended Valebyte Plans for Grafana
Valebyte offers a wide selection of VPS, ideally suited for Grafana VPS hosting. Below is a table with recommended plans that correspond to various needs and budgets.
| Valebyte Plan |
vCPU |
RAM |
SSD (NVMe) |
Price (approx./month) |
Ideal for |
| Micro Monitoring |
1 core |
2 GB |
30 GB |
from 500 RUB |
Small personal projects, test environments, up to 5-10 hosts. |
| Standard Monitor |
2 cores |
4 GB |
60 GB |
from 900 RUB |
Most medium projects, up to 30-50 hosts, metric storage up to 1 month. |
| Pro Monitor |
4 cores |
8 GB |
120 GB |
from 1800 RUB |
Large projects, up to 100+ hosts, long-term metric storage, multiple users. |
| Enterprise Monitor |
6+ cores |
16+ GB |
240+ GB |
from 3500 RUB |
Very large infrastructures, high load, critically important monitoring. |
Note: Prices are approximate and may change. Always check the Valebyte website for current information. When choosing a plan, consider not only current needs but also the potential growth of your infrastructure.
Scaling and Optimizing Grafana on a VPS
As your infrastructure and data volume grow, additional steps may be required to optimize your Grafana server and Prometheus:
- Service Separation: If a single VPS becomes insufficient, consider deploying Grafana and Prometheus on different virtual servers. Prometheus is more demanding on disk I/O and CPU.
- Prometheus Optimization:
- Reduce Scrape Interval: Increase
scrape_interval for less critical metrics.
- Remove Unnecessary Metrics: Use
relabel_configs to filter out metrics you don't need.
- Manage Retention Period: Configure
--storage.tsdb.retention.time for Prometheus. For example, --storage.tsdb.retention.time=30d to store metrics for 30 days.
- Monitoring the Monitoring System: Use node_exporter to collect metrics about the VPS itself, where Grafana and Prometheus are running. This will allow you to track their performance and respond to issues promptly.
- Using a Proxy/Load Balancer: To access Grafana via a domain name and ensure HTTPS, configure Nginx or Apache as a reverse proxy.
- Backup: Regularly back up Grafana and Prometheus configurations, as well as Prometheus data.
Conclusion
Deploying Grafana on a VPS is a reliable and flexible way to ensure effective monitoring of your infrastructure. The correct choice of a VPS with sufficient resources, especially RAM and a fast SSD, is key to the stable operation of both Grafana itself and its data sources, such as Prometheus.
Valebyte offers optimal plans that allow you to easily select a configuration for any task, from small personal projects to large-scale corporate monitoring on a VPS. By following the provided installation instructions and optimization recommendations, you can build a powerful and scalable monitoring system that will serve you for years to come.
Ready to choose a server?
Compare VPS and dedicated servers from trusted providers on Valebyte.
Get started now →