Skip to content

Linux VPS & VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04

Cloud Infrastructure Expert
Linux VPS & VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04

 

 

Grafana and Prometheus are powerful tools for monitoring and visualizing system performance. In this guide, we’ll show you how to install and configure Grafana and Prometheus on Ubuntu 24.04. Using a can enhance your monitoring setup, providing reliable performance and scalability on your VPS server.

Step 1: Prepare Your VPS Server

Before installing Grafana and Prometheus, ensure that your VPS server is up to date. We recommend using a for optimal performance and stability. First, update your Ubuntu 24.04 system:

sudo apt update && sudo apt upgrade -y

Step 2: Install Prometheus

Prometheus is an open-source system monitoring and alerting toolkit. To install it, follow these steps:

    • Create a Prometheus user:
sudo useradd --no-create-home --shell /bin/false prometheus
    • Download the Prometheus package:
wget https://github.com/prometheus/prometheus/releases/download/v2.42.0/prometheus-2.42.0.linux-amd64.tar.gz
    • Extract the package and move the binaries:

tar -xvzf prometheus-2.42.0.linux-amd64.tar.gz
sudo mv prometheus-2.42.0.linux-amd64/prometheus /usr/local/bin/
sudo mv prometheus-2.42.0.linux-amd64/promtool /usr/local/bin/

Next, configure Prometheus by creating a configuration file:

sudo nano /etc/prometheus/prometheus.yml

Add the following basic configuration:


global:
  scrape_interval: 15s

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']

Start the Prometheus service:


sudo systemctl enable prometheus
sudo systemctl start prometheus

Step 3: Install Grafana

Grafana is a visualization tool that works perfectly with Prometheus to create monitoring dashboards. To install Grafana:

    • Add the Grafana repository:

sudo apt install -y software-properties-common
sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
sudo apt update
    • Install Grafana:
sudo apt install grafana -y
    • Start and enable the Grafana service:

sudo systemctl enable grafana-server --now

Step 4: Configure Prometheus as a Data Source in Grafana

Once both Prometheus and Grafana are installed, the next step is to connect them. Open Grafana in your web browser at http://your-server-ip:3000 and log in using the default credentials (admin/admin).

After logging in:

  • Go to “Configuration” and click on “Data Sources.”
  • Add a new data source and select “Prometheus.”
  • In the URL field, enter http://localhost:9090 and click “Save & Test” to connect Grafana to Prometheus.

Step 5: Create a Monitoring Dashboard

With Prometheus connected, you can now create custom dashboards in Grafana to visualize your server’s performance. Grafana provides various templates and panels to customize your monitoring setup. Consider hosting your monitoring stack on a to benefit from the increased reliability and dedicated resources offered by a VPS server.

Step 6: Access Grafana and Monitor Your System

Now that you have Grafana and Prometheus set up on Ubuntu 24.04, you can access your monitoring dashboards anytime to keep an eye on your system’s performance. This setup is ideal for monitoring CPU, memory, disk usage, and network activity in real-time.

For businesses looking for a robust and scalable solution, hosting your monitoring stack on a is an excellent choice. A VPS ensures better performance, security, and resource management compared to shared hosting environments.

Conclusion

Installing Grafana and Prometheus on Ubuntu 24.04 is a great way to create a powerful monitoring solution for your systems. By using a , you can ensure that your monitoring setup is scalable, reliable, and optimized for your needs. Whether you’re running a personal project or managing multiple servers, a VPS server offers the flexibility and control needed to maintain your infrastructure.

For more information on hosting your monitoring stack or getting started with a VPS server, visit for the best options available.

© 2024 Windows VPS – All Rights Reserved

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.

Linux VPS & VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04

Cloud Infrastructure Expert
Linux VPS & VPS Windows Setup Guide | NetCloud24 Grafana and Prometheus on Ubuntu 24.04

 

 

Grafana and Prometheus are powerful tools for monitoring and visualizing metrics. Follow these steps to install Grafana and Prometheus on your VPS server running Ubuntu 24.04.

Prerequisites

  • A VPS server running Ubuntu 24.04
  • Root or sudo access
  • Basic knowledge of the command line

Step 1: Update Your System

Ensure your system is up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install Prometheus

First, create a user for Prometheus:

sudo useradd --no-create-home --shell /bin/false prometheus

Create the necessary directories:

sudo mkdir /etc/prometheus
sudo mkdir /var/lib/prometheus

Download the latest version of Prometheus:

wget https://github.com/prometheus/prometheus/releases/latest/download/prometheus-*.tar.gz

Extract the downloaded file:

tar xvf prometheus-*.tar.gz

Move the binaries to the appropriate directory:

sudo mv prometheus /usr/local/bin/
sudo mv promtool /usr/local/bin/

Move the configuration file and set the permissions:

sudo mv prometheus.yml /etc/prometheus/
sudo chown -R prometheus:prometheus /etc/prometheus
sudo chown -R prometheus:prometheus /var/lib/prometheus

Step 3: Create a Prometheus Service File

Create a service file 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.listen-address=:9090

[Install]
WantedBy=multi-user.target

Reload the systemd daemon and start Prometheus:

sudo systemctl daemon-reload
sudo systemctl start prometheus
sudo systemctl enable prometheus

Step 4: Install Grafana

Add the Grafana APT repository:

sudo apt install -y software-properties-common
sudo add-apt-repository ppa:grafana/stable

Install Grafana:

sudo apt update
sudo apt install grafana

Start and enable Grafana:

sudo systemctl start grafana-server
sudo systemctl enable grafana-server

Step 5: Access Grafana

Open your web browser and go to http://your_domain.com:3000. The default login is:

  • Username: admin
  • Password: admin

You will be prompted to change the password on the first login.

Step 6: Configure Prometheus as a Data Source in Grafana

Once logged into Grafana, navigate to Configuration > Data Sources > Add data source and select Prometheus. Enter the URL:

http://localhost:9090

Click Save & Test to verify the connection.

Conclusion

You have successfully installed Grafana and Prometheus on your Ubuntu 24.04 VPS server. You can now start monitoring your applications!

Windows VPS Deutschland

Windows VPS España

Windows VPS Nederland

Windows VPS Italia

Windows VPS Portugal

VPS Windows Italia

Windows VPS

Windows VPS

Windows VPS Sverige

Windows VPS Norge

Windows VPS

Windows VPS Türkiye

Windows RDS (Remote Desktop Services)

Windows VPS

Explore more

More on this topic

Netcloud24
Netcloud24
Cloud Infrastructure Expert · NetCloud24

Comments are closed.