Understanding the Tools
Linux
What are Grafana and InfluxDB?
InfluxDB is a special type of database made specifically for handling time-series data. This means it is very good at storing information that changes over time, like the temperature of a room every minute or the CPU usage of a computer every second. Instead of keeping data in traditional tables, InfluxDB organizes it by time so you can quickly search and find trends from the past.
Grafana is an open-source tool used to create visual dashboards and graphs. While InfluxDB is great at storing the data behind the scenes, it does not give you an easy way to look at it. Grafana acts as the display layer, taking the raw numbers from InfluxDB and turning them into colorful charts, gauges, and alerts that anyone can understand at a glance.
Together, these two tools create a powerful monitoring system. InfluxDB collects and safely stores all the continuous streams of data coming from your servers, apps, or sensors. Then, Grafana connects directly to InfluxDB to read that data and display it in real-time, helping you monitor system health and spot problems quickly.
Prerequisites
- A computer, server, or virtual machine running Debian or Ubuntu Linux.
- Command-line access to the system with
sudo(administrator) privileges. - A stable internet connection to download the required software packages.
- Network access to ports 8086 (InfluxDB) and 3000 (Grafana) on your machine.
Step-by-Step Installation
Install Prerequisites and InfluxDB v2
# 1. Install prerequisites required for downloading keys and adding repositories sudo apt-get update sudo apt-get install -y apt-transport-https software-properties-common wget gnupg # 2. Download the current InfluxData GPG key to the modern keyrings directory sudo mkdir -p /etc/apt/keyrings wget -q -O - https://repos.influxdata.com/influxdata-archive.key | gpg --dearmor | sudo tee /etc/apt/keyrings/influxdata-archive.gpg > /dev/null # 3. Add the InfluxData repository using the new keyring path echo 'deb [signed-by=/etc/apt/keyrings/influxdata-archive.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list # 4. Update your package manager and install InfluxDB v2 sudo apt-get update sudo apt-get install -y influxdb2 # 5. Start the service and enable it to run on boot sudo systemctl enable --now influxdb
Initialize InfluxDB and Generate a Token
- Open your web browser and navigate to
http://<your-server-ip>:8086(usehttp://localhost:8086if installing locally). - Click Get Started.
- Enter a Username, Password, Initial Organization Name (e.g.,
my-org), and an Initial Bucket Name (e.g.,system-metrics). - Click Continue, then click Configure Later.
- In the left-hand sidebar, navigate to the up-arrow icon (Load Data) > API Tokens.
- Click Generate API Token and select All Access API Token (or a Custom token strictly for your specific bucket).
- Copy this token and paste it into a safe notepad; you will need it in Step 4.
Install Grafana OSS
# 1. Download the Grafana GPG key sudo mkdir -p /etc/apt/keyrings wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null # 2. Add the Grafana stable repository echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list # 3. Update your package manager and install Grafana sudo apt-get update sudo apt-get install -y grafana # 4. Start the service and enable it to run on boot sudo systemctl enable --now grafana-server
Connect Grafana to InfluxDB
- Open your web browser and navigate to
http://<your-server-ip>:3000(usehttp://localhost:3000if installing locally). - Log in using the default credentials: Username:
admin/ Password:admin(you will be prompted to change this). - In the left-hand menu, go to Connections (or the gear icon) > Data sources.
- Click Add data source and select InfluxDB.
- Configure the connection exactly as follows:
- Query Language: Change this from InfluxQL to Flux (critical for v2).
- URL:
http://localhost:8086(or your server's IP if hosted elsewhere). - Basic Auth: Leave this turned off.
- Organization: Enter the exact Organization name you created in Step 2.
- Token: Paste the API token you generated in Step 2.
- Default Bucket: Enter the exact Bucket name you created in Step 2.
- Scroll to the bottom and click Save & test. You should see a green checkmark saying "Data source is working" or "3 buckets found".
CTCservers Recommended Tutorials
Web, Network
Step-by-Step Guide: Install AMD ROCm on Ubuntu with RX 6600 GPU
Learn how to quickly and easily set up AMD ROCm on Ubuntu for your RX 6600 GPU, enabling powerful machine learning, AI workloads, and GPU-accelerated computing right on your system.
Web, Network, Linux, Mysql, Ubuntu
LAMP Setup Guide 2026: Ubuntu & Debian | CTCservers
Install a secure LAMP stack on Debian or Ubuntu. Follow our step-by-step guide to configure Linux, Apache, MySQL, and PHP for your web server.
Web, Network, Ubuntu
Deploy Phi-3 with Ollama on Ubuntu GPU | CTCservers
Learn how to easily deploy the Phi-3 LLM on an Ubuntu 24.04 GPU server using Ollama and WebUI. Follow our step-by-step tutorial for seamless AI hosting.
Discover CTCservers Dedicated Server Locations
CTCservers servers are available around the world, providing diverse options for hosting websites. Each region offers unique advantages, making it easier to choose a location that best suits your specific hosting needs.