How to Install and Use Grafana for Real-Time Data Visualization
Grafana is a powerful, self-hosted tool that turns complex metrics into clear, interactive dashboards and real-time charts. The best part is that you can install Grafana on multiple platforms via Docker, making setup quick, clean, and platform-agnostic. This guide will show you how to install Grafana using Docker and how to use it to effectively monitor system metrics and visualize real-time data.
Install Grafana using Docker
Before installing Grafana, make sure Docker is installed on your system.
To get started, execute the following command to pull the Grafana image:
sudo docker pull grafana/grafana
Now, start a new Grafana container in the background and map it to port 3000 with the following command:
sudo docker run -d -p 3000:3000 --name=grafana grafana/grafana
After running the Docker container, open your browser and go to http://localhost:3000 to access the Grafana dashboard. Use the default username and password, both set to admin , to log in to Grafana:
After you hit the login button, it will prompt you to update your password to avoid security risks. You can update and submit (recommended) the modified password or skip to continue with the default password:
After you log in successfully, the following dashboard will appear:
Apart from Grafana, you can also use any of these tools to monitor your Linux system.
Connect data sources and visualize data
Grafana lets you monitor multiple services and containers from a single dashboard. You can add multiple data sources (like Prometheus, MySQL, MongoDB, etc.) and visualize your data with pre-built or custom dashboards.
Let's connect Prometheus as our first data source. To do this, we'll install and run Prometheus using Docker:
sudo docker pull prom/prometheus
Run the Prometheus container using the following command:
sudo docker run -d -p 9090:9090 --name=prometheus prom/prometheus
Once the container is running, you can access the Prometheus web interface by visiting http://your_ip:9090.
Add data source
Now that Grafana and Prometheus are up and running, you can start by adding your first data source:
Select the data source you want to add, then enter the URL , such as http://your_ip:9090. Then click Save & Test and you should get the following message: Successfully queried the Prometheus API .
Create your first dashboard
Once connected, you can create dashboards to visualize your metrics with graphs, charts, and other dashboards. To do this, click the Create Dashboard button or New -> New dashboard .
Now, click the + Add a new visualization button to start a new dashboard by adding a visualization:
Finally, select Prometheus as the data source:
Use any of the available metrics, e.g. process_cpu_seconds_total and click the Run Queries button to visualize the data:
Similarly, you can add more visualizations (like CPU usage, memory, etc.) and drag and drop them into your layout.
This way, you can build real-time interactive views of your system or application data for easier monitoring and analysis.
Use the pre-built dashboard
Grafana allows importing community dashboards. For example, you can go to the official Grafana website and use any of the pre-built dashboards:
To use a pre-built dashboard, you can copy the ID of any dashboard from the official website and paste it into the Grafana dashboard section.
Now that Grafana is up and running, the next step is to explore advanced visualizations, install useful plugins, or integrate it with tools like Prometheus, MySQL, or Elasticsearch for a complete observability stack. You can also explore running other GUI-based applications in Docker to create a more interactive and flexible environment.
You should read it
- How to install Solus Linux
- How to install Kali Linux on macOS
- 5 reasons to install Linux on old computers
- How to install Kali Linux on Android using Linux Deploy
- How to install NVIDIA drivers on Kali Linux
- How is Arch Linux different from other Linux versions?
- Steps to install Webex for Linux
- How to install Windows Game on Linux with Winepak
May be interested
- INSTALL A FAMOUS LAN NETWORK ONLY ON ONE COMPUTER - PART IIlast time we installed part i to install a virtual lan on the computer. the purpose is to help you have no conditions to practice on a real lan. this is a really useful program for those who want to study network administration and network configuration. hopefully the article will help you, we hope to receive comments for them to make the article more complete.
- Consolidating the ambition of self-driving cars, Intel plans to spend billions on acquiring Moovit trip planning applicationwith 800 million users worldwide, moovit's data and algorithms can be a powerful support to the self-driving car technology that intel is building.
- How to turn off the RTT feature on iPhonereal time text is a standard accessibility feature that apple includes on iphone models. rtt supports instant visibility of typed content, allowing near-instant communication.
- Smart paper has the ability to create electronic drawings in real timewith this set of products, users will just draw and write on paper, immediately a digital version will appear from time to time on adobe illustrator software to share or print.
- AI erases objects in footage in real time, making filming more 'leisurely'yolov8, a new ai developed by a research team at kaunas university of technology (lithuania), has the ability to identify and remove unwanted objects in videos in real time, promising to create a breakthrough in the field. video processing.
- How to turn off real-time protection in Microsoft Defender on Windows 10by default, windows 10's built-in antivirus program, called microsoft defender, will scan your pc for real-time threats. here's how to turn off real-time protection in microsoft defender on windows 10.
- Invite download of Cortex Command game worth 450,000 VND, currently freecortex command is an extremely attractive real-time strategy game, it costs 450,000 vnd and is currently free of data realms entirely on steam. this special promotion only lasts until february 4.
- The real-time translation feature officially docked the Google Translate appgoogle translate lacks another feature to make it perfect, which is real-time translation. and today, google has officially announced the implementation of this feature with initial support for 8 different languages.
- How to install Microsoft Teams on Windows 10on windows 10, microsoft teams is a real-time messaging and collaboration platform designed for businesses that compete directly with slack.
- Can iCloud Drive be used to back up Time Machine data on a Mac? Why?if you use a mac device, you probably already know time machine. this is basically a backup feature built into macos. time machine is responsible for automatically backing up users' personal data including apps, music, photos, emails, and other documents.