How to monitor VPS/Dedicated server with Grafana

Michael Schmidt
Published: Aug 19, 2024 by Michael Schmidt
How to monitor VPS/Dedicated server with Grafana

What is Grafana #

Grafana is an open-source platform used for monitoring, visualization, and analyzing data from a variety of data sources in real-time. It is primarily known for creating interactive and dynamic dashboards that display metrics and logs, allowing users to observe the performance and health of their systems, applications, and services.

https://storage.selfhost.guru/images/4742d9a8-650f-46c7-b33b-51e2c4b34d4d.webp

Register to Grafana-Cloud #

Grafana can be selfhosted, but unless your are using in a home environment where collection metrics should not be effected by internet connection, Grafana-cloud is your way to go.

Forever free plan includes:

  • 50GB logs
  • 50GB traces
  • 50GB profiles
  • 3 active users
  • 14-day retention!
  • and much more...

This is a lot of Metrics only real restriction are the 14-day retention, this only allow to look back 2 weeks of logs, not ideal for getting yearly insight of your application performance.

Register here: https://grafana.com/auth/sign-up/create-user?refCode=gr8zEPmXdDewWfA

Install Agent/Alloy and add your server to the Dashboard #

Go to your Grafana dashboard:

https://storage.selfhost.guru/images/749f6585-1da1-4e2a-8d9e-05723c6f14dd.webp

Choose Platform and Architecture then Click to Install button:

https://storage.selfhost.guru/images/fafb3414-5834-4429-9d13-06b061bebb2c.webp

Create a new token:

  • Use some deterministic token name rule, e.g. token-server-NUMBER

https://storage.selfhost.guru/images/7675d7e9-1013-40c8-965c-d09f70d5ace1.webp

Copy the script at the bottom and paste into your server terminal and hit enter:

https://storage.selfhost.guru/images/8fa660f0-2188-47e1-aa06-397031e582c3.webp

Test the install with the tested bottom on the page:

https://storage.selfhost.guru/images/9f1d3c00-d296-41b4-aa42-9466d9406092.webp