Skip to content

Grafana DEB Package Installation Guide | Compatible with Ubuntu/Debian ​

Grafana RPM installation diagram

Preface ​

As the most popular open-source data visualization platform, Grafana is widely used in the monitoring field. On Ubuntu/Debian systems, in addition to using the APT package manager,DEB package installation It is the most direct and controllable approach, especially suitable for the following scenarios:

  • Development and testing environment: Quickly verify Grafana functionality

  • Standalone monitoring: Only need to monitor a few physical machines or virtual machines and build a lightweight monitoring platform

  • Version lock: Need precise control over the Grafana version to avoid automatic APT upgrades

  • Offline environment: Intranet servers cannot access the APT repository

This article documents in detail in Ubuntu 22.04 Complete process for installing Grafana OSS open-source edition via DEB package on the system, from downloading, installation, configuration, and firewall opening to service management, covering all key steps and troubleshooting experience.

💡 Version selection tip:

Grafana provides OSS (Open Source Version) and Enterprise (Enterprise Edition) Two versions. This article uses the OSS open-source version for demonstration. It includes all core Grafana features such as visualization, alerting, and data sources, and fully meets the needs of personal development, testing, and most production scenarios. The Enterprise version additionally provides advanced features such as reporting, RBAC, and SAML, and is suitable for environments with enterprise-level requirements. The installation process is exactly the same for both; you can replace the download link according to your own needs.

Whether you are an operations engineer, developer, or Homelab enthusiast, you can quickly set up a usable Grafana monitoring platform through this article.

Environment Description ​

Projectinformation
Operating systemUbuntu 22.04 LTS+ / Debian 11+
Architecturex86_64 (amd64)
Grafana version13.2.0
Installation methodDEB package
Service Managementsystemd

Part 1: Download the Grafana DEB package ​

1.1 Download from GitHub Releases ​

bash
# Enter the temporary directory
cd /tmp

# Download the Grafana OSS open-source DEB package
wget https://github.com/grafana/grafana/releases/download/v13.2.0/grafana_13.2.0_32077357341_linux_amd64.deb

1.2 Installing from the APT repository (alternative) ​

If the network permits, you can install directly from the official Grafana APT repository:

bash
# Add the official Grafana APT repository
sudo apt-get install -y software-properties-common wget
sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key
echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list

# Update and install
sudo apt-get update
sudo apt-get install grafana -y

1.3 Version Selection Instructions ​

Version typeApplicable scenariosExplanation
OSS (Open Source Version)Development testing, personal HomelabFully open source, with enough features for most scenarios, no license required.
Enterprise (Enterprise Edition)Enterprise production environmentIncludes advanced commercial features; a License must be applied for.

Part 2: Installing the DEB Package ​

2.1 First installation ​

bash
# Install DEB packages using dpkg
sudo dpkg -i grafana_13.2.0_linux_amd64.deb

Expected output:

Selecting previously unselected package grafana.
(Reading database ... 123456 files and directories currently installed.)
Preparing to unpack grafana_13.2.0_linux_amd64.deb ...
Unpacking grafana (13.2.0) ...
Setting up grafana (13.2.0) ...
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service.

2.2 Handling Dependency Issues ​

If a dependency missing prompt appears during installation:

bash
# Fix dependencies
sudo apt-get install -f

2.3 Upgrade Installation ​

If an older version of Grafana is already installed on the system:

bash
# Use dpkg -i to overwrite-install (will automatically upgrade)
sudo dpkg -i grafana_13.2.0_linux_amd64.deb

2.4 Verify the Installation ​

bash
# View the list of installed files
dpkg -L grafana

# View version
/usr/sbin/grafana-server -v
# Output: Version 13.2.0 (commit: f681b1359f, branch: HEAD)

# View Grafana CLI version
/usr/sbin/grafana-cli -v

Part 3: Configuring Grafana ​

3.1 Default Configuration File Location ​

filepathExplanation
Main configuration file/etc/grafana/grafana.iniGrafana Core Configuration
Systemd service/usr/lib/systemd/system/grafana-server.serviceService Management
Data Catalog/var/lib/grafanaStored data (default)
Log directory/var/log/grafanalog file
Plugin directory/var/lib/grafana/pluginsPlugin storage location
Default configuration file/usr/share/grafana/conf/defaults.iniDefault configuration reference

3.2 Modify the configuration file ​

bash
# Back up the original configuration
sudo cp /etc/grafana/grafana.ini /etc/grafana/grafana.ini.bak

# Edit configuration
sudo vim /etc/grafana/grafana.ini

Key configuration items:

ini
[server]
# Protocol (http, https, h2, socket, socket_h2)
protocol = http

# Minimum TLS version allowed. By default, this value is empty. Accepted values are: TLS1.2, TLS1.3. If nothing is set TLS1.2 would be taken
;min_tls_version = ""

# The ip address to bind to, empty will bind to all interfaces
http_addr =

# The http port to use
http_port = 3000

# The public facing domain name used to access grafana from a browser
domain = 192.168.0.231

3.3 Modify data directory permissions ​

bash
# Installing the DEB package automatically creates the grafana user, ensuring correct directory permissions.
sudo chown -R grafana:grafana /var/lib/grafana
sudo chown -R grafana:grafana /var/log/grafana

Part Four: Start the Grafana Service ​

4.1 Managing with systemd ​

bash
# Reload systemd configuration
sudo systemctl daemon-reload

# Start service
sudo systemctl start grafana-server

# Set to start on boot
sudo systemctl enable grafana-server

# Check service status
sudo systemctl status grafana-server

4.2 Verify that the service is running normally ​

bash
# Check port listening
sudo netstat -lntp | grep 3000

# Expected output:
# tcp  0  0 0.0.0.0:3000  0.0.0.0:*  LISTEN  12345/grafana-server

# or use the ss command
ss -lntp | grep 3000

# Test local access
curl http://192.168.0.231:3000 | head -20

# View service logs
sudo journalctl -u grafana-server -f

Part Five: Open the Firewall ​

This is Easiest to overlook a step, and also the main reason why external access is unavailable.

5.1 Using ufw (Ubuntu default) ​

bash
# Check firewall status
sudo ufw status

# Open port 3000
sudo ufw allow 3000/tcp

# Reload firewall
sudo ufw reload

# validation rules
sudo ufw status | grep 3000

5.2 Using iptables ​

bash
# Add rule
sudo iptables -A INPUT -p tcp --dport 3000 -j ACCEPT

# Save rules (Ubuntu)
sudo apt-get install iptables-persistent -y
sudo netfilter-persistent save

5.3 Disable the firewall (test environment only) ​

bash
# Temporarily closed
sudo ufw disable

# Permanently disable (not recommended for production environment)
sudo ufw disable

Part Six: SELinux/AppArmor Configuration ​

6.1 Ubuntu Uses AppArmor ​

Ubuntu uses AppArmor by default instead of SELinux, and usually does not block Grafana. If you encounter permission issues:

bash
# Check AppArmor status
sudo aa-status

# View Grafana-related logs
sudo journalctl -u grafana-server | grep -i apparmor

6.2 If AppArmor is blocking Grafana ​

bash
# Temporarily disable Grafana's AppArmor profile (not recommended)
sudo aa-disable /etc/apparmor.d/usr.sbin.grafana-server

# Restart the service
sudo systemctl restart grafana-server

Part 7: Accessing Grafana ​

7.1 Web Login ​

bash
# Browser access
http://<server IP>:3000

# Default credentials
Username: admin
Password: admin

7.2 First Login ​

On first login,Force password change required It is recommended to set a strong password.

7.3 Validation API ​

bash
# Check Grafana health status
curl http://localhost:3000/api/health

# Expected return:
# {
#   "database": "ok",
#   "version": "13.2.0",
#   "commit": "f681b1359f6a0b8ecb9f2c49a88ac72b75bde73b"
# }

Part 8: Common Issues and Troubleshooting ​

Q1:dpkg -i reports missing dependencies ​

dpkg: dependency problems prevent configuration of grafana:
 grafana depends on libc6 (>= 2.34); however:

Solution:

bash
# Fix dependencies
sudo apt-get install -f

Q2: Service startup failed; the port is already in use ​

bash
# Check port usage
sudo lsof -i:3000
sudo netstat -tlnp | grep 3000

# Kill the occupying process
sudo kill -9 <PID>
sudo systemctl start grafana-server

Q3: Cannot access externally (Connection refused) ​

检查顺序:

bash
# 1. Is the service running?
sudo systemctl status grafana-server

# 2. Whether the port is listening
sudo netstat -lntp | grep 3000

# 3. Is the firewall open?
sudo ufw status

# 4. Whether the configuration binds to 0.0.0.0
cat /etc/grafana/grafana.ini | grep http_addr

# 5. Cloud provider security groups (e.g., AWS, Alibaba Cloud)
# Port 3000 needs to be opened in the console.

Q4: Forgot admin password ​

bash
# Reset the password to admin
sudo /usr/sbin/grafana-cli admin reset-admin-password admin

# Restart the service
sudo systemctl restart grafana-server

Q5: DEB package and APT version conflict ​

If both the APT-installed version and the manually installed DEB package exist:

bash
# View installed version
dpkg -l | grep grafana

# Completely uninstall
sudo dpkg -r grafana
sudo apt-get autoremove -y

# Reinstall the DEB package
sudo dpkg -i grafana_13.2.0_linux_amd64.deb

第九部分:常用管理命令速查 ​

OperationCommand
Start servicesudo systemctl start grafana-server
Stop servicesudo systemctl stop grafana-server
Restart the servicesudo systemctl restart grafana-server
View statussudo systemctl status grafana-server
Set to start on bootsudo systemctl enable grafana-server
View logssudo journalctl -u grafana-server -f
View version/usr/sbin/grafana-server -v
Reset passwordsudo /usr/sbin/grafana-cli admin reset-admin-password <新密码>
Install pluginsudo /usr/sbin/grafana-cli plugins install <插件名>
View configurationcat /etc/grafana/grafana.ini

Part Ten: Upgrade Guide ​

10.1 View the current version ​

bash
/usr/sbin/grafana-server -v

10.2 Download the New Version ​

bash
wget https://github.com/grafana/grafana/releases/download/v13.2.0/grafana_13.2.0_linux_amd64.deb

10.3 Execute Upgrade ​

bash
# Stop service
sudo systemctl stop grafana-server

# Back up configuration and data
sudo cp -r /etc/grafana /etc/grafana.bak
sudo cp -r /var/lib/grafana /var/lib/grafana.bak

# Upgrade installation
sudo dpkg -i grafana_13.2.0_linux_amd64.deb

# Start service
sudo systemctl start grafana-server

# Verification version
/usr/sbin/grafana-server -v

Part 11: DEB vs RPM vs Docker Comparison ​

Comparison itemDEB installationRPM installationDocker container
Applicable systemsUbuntu/DebianCentOS/RHELAll Linux
Dependency management✅ APT Automatic Processing✅ YUM automatic processing✅ Included in the image
Service Management✅ systemd✅ systemd⚠️ Container Management
Installation speed⚡ Extremely fast⚡ Extremely fast⚡ Fast
Data persistence✅ Local directory✅ Local directory⚠️ Volume mount required
learning curvelowlowmiddle
Applicable scenariosUbuntu/Debian production environmentCentOS/RHEL production environmentcloud-native environment

Conclusion ​

Through this article, you have mastered the complete process of installing Grafana via DEB package on Ubuntu/Debian systems:

  • ✅ Download and install the Grafana DEB package

  • ✅ Configure Grafana (bound to 0.0.0.0, allow external access)

  • ✅ Manage services with systemd

  • ✅ Open firewall (ufw) configuration

  • ✅ Access the Grafana web interface

  • ✅ Common troubleshooting

  • ✅ Version upgrade process

The core advantages of the DEB installation method: Simple, fast, and controllable—the best choice for single-machine and traditional O&M scenarios on Ubuntu/Debian systems.

Related resources:

All operations in this article have been verified in an Ubuntu 22.04 LTS environment and are applicable to Debian 11+ and compatible distributions.

Last updated on11/07/2026, 02:16 PM
@fishfinal | @fishfinals | [email protected]