Grafana installation on Linux server step-by-step DevOps monitoring guide

How to Install Grafana on Linux Server for DevOps Monitoring (Step-by-Step Beginner Guide)

If you're setting up monitoring for your Linux server, Grafana is one of the best tools you can use. In this guide, you’ll learn how to install Grafana on a Linux server step by step, with real commands and simple explanations that are easy to follow—even if you're just starting out.


Step 1: Update Your Linux Server

Start by updating your system to make sure all packages are up to date and secure.

sudo apt update
sudo apt upgrade -y

If you encounter a 429 Too Many Requests error while running apt update or apt upgrade, it’s a common issue. You can fix it easily by following this guide: How to Fix 429 Too Many Requests Error in Ubuntu APT Update

Ubuntu apt update successful terminal output after fixing error

This ensures your server is running the latest updates and avoids installation issues later.


Step 2: Install Required Packages

sudo apt install wget curl software-properties-common net-tools -y
Linux install required packages terminal output wget curl net-tools

These tools help with downloading Grafana and checking network-related configurations.


Step 3: Add Grafana Repository

wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -

echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
Add Grafana repository on Ubuntu terminal output

Step 4: Install Grafana

sudo apt update
sudo apt install grafana -y
Grafana installation terminal output on Ubuntu Linux server

Step 5: Start and Enable Grafana Service

sudo systemctl start grafana-server
sudo systemctl enable grafana-server
sudo systemctl status grafana-server
Grafana service status running active on Linux server

Step 6: Verify Grafana Port

netstat -tpln
Check Grafana running on port 3000 using netstat command

Step 7: Access Grafana in Browser

http://your-server-ip:3000
Grafana login page on port 3000 Linux server DevOps monitoring
  • Username: admin
  • Password: admin

Step 8: First Password Change

After logging in with the default credentials, Grafana will prompt you to change the password. This is an important security step and should not be skipped.

Grafana password change screen after first login

Step 9: Grafana Dashboard

Grafana dashboard home monitoring interface

Step 10: Configure Firewall

If you want to access Grafana from an external network or public IP, you need to allow port 3000 through the firewall.

sudo ufw enable
sudo ufw allow 3000/tcp
sudo ufw reload

This step ensures that external users can access the Grafana dashboard securely through your server’s IP address.

Allow Grafana port 3000 using UFW firewall command output

Final Thoughts

Installing Grafana on a Linux server is a valuable DevOps skill. By following this step-by-step approach, you ensure everything is working correctly in a real-world setup.


Frequently Asked Question

Is Grafana free to use?

Yes, Grafana offers a free and open-source version that you can install on a Linux server for monitoring and visualization.

What port does Grafana run on by default?

Grafana runs on port 3000 by default. You need to allow this port in your firewall if you want to access it from outside your server.

How can I check if Grafana is running?

sudo systemctl status grafana-server

This command shows whether the Grafana service is active and running on your system.

Why is the first password change important?

Grafana uses default credentials for the first login. Changing the password immediately helps protect your dashboard from unauthorized access.

Do I always need to configure the firewall?

No. Firewall configuration is only required if you want to access Grafana from an external network. For local or internal use, it may not be necessary.

Please share this with your fellow developers.

Selvaraj Iyyappan
April 20, 2026
f X W