Debian/Ubuntu Installation
This guide covers installing Grafana on Debian or Ubuntu Linux systems using the APT repository or standalone DEB packages.Installation Methods
You can install Grafana on Debian/Ubuntu using:- APT repository (recommended): Automatic updates via
apt-get update - DEB package: Manual installation from downloaded package
- Standalone binary: Manual installation from tarball
Install from APT Repository
Installing from the APT repository enables automatic updates when you runapt-get update.
Available Repositories
| Edition | Package | Repository |
|---|---|---|
| Grafana Enterprise | grafana-enterprise | https://apt.grafana.com stable main |
| Grafana Enterprise (Beta) | grafana-enterprise | https://apt.grafana.com beta main |
| Grafana OSS | grafana | https://apt.grafana.com stable main |
| Grafana OSS (Beta) | grafana | https://apt.grafana.com beta main |
Grafana Enterprise is the recommended edition. It’s free and includes all OSS features, with the option to upgrade to the full Enterprise feature set.
sudo mkdir -p /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/grafana.asc https://apt.grafana.com/gpg-full.key
sudo chmod 644 /etc/apt/keyrings/grafana.asc
echo "deb [signed-by=/etc/apt/keyrings/grafana.asc] https://apt.grafana.com stable main" | \
sudo tee -a /etc/apt/sources.list.d/grafana.list
echo "deb [signed-by=/etc/apt/keyrings/grafana.asc] https://apt.grafana.com beta main" | \
sudo tee -a /etc/apt/sources.list.d/grafana.list
Install from DEB Package
Manual installation using DEB packages requires you to manually update Grafana for each new version.Visit the Grafana download page and:
sudo apt-get install -y adduser libfontconfig1 musl
wget <deb-package-url>
sudo dpkg -i grafana_<version>_amd64.deb
Install as Standalone Binary
For manual installation with full control over file locations:Download the tarball from the Grafana download page and extract it:
[Unit]
Description=Grafana Server
After=network.target
[Service]
Type=simple
User=grafana
Group=users
ExecStart=/usr/local/grafana/bin/grafana server --config=/usr/local/grafana/conf/grafana.ini --homepath=/usr/local/grafana
Restart=on-failure
[Install]
WantedBy=multi-user.target
Start Grafana Server
Using systemd
Start the Grafana server:Using init.d
Start Grafana:Configuration
After installation, Grafana uses these default paths:| Path | Description |
|---|---|
/etc/grafana/grafana.ini | Configuration file |
/var/lib/grafana | Data directory (SQLite database, plugins) |
/var/log/grafana | Log files |
/usr/share/grafana | Installation directory |
/etc/grafana/provisioning | Provisioning directory |
/etc/default/grafana-server | Environment variables |
Environment Variables File
The systemd service reads environment variables from/etc/default/grafana-server:
Systemd Service Configuration
The Grafana systemd service includes security hardening:- Runs as non-root
grafanauser (UID 472) - Capability restrictions with
CapabilityBoundingSet= - Protected system directories
- Restricted system calls
- File open limit: 10,000
- Stop timeout: 20 seconds
Access Grafana
After starting the server, access Grafana:- Open your browser to
http://localhost:3000 - Sign in with default credentials:
- Username:
admin - Password:
admin
- Username:
- Change the password when prompted
Uninstall Grafana
Troubleshooting
View logs
Check service status
Verify installation
Port already in use
If port 3000 is already in use, edit/etc/grafana/grafana.ini:
Next Steps
- Configure data sources
- Set up authentication (LDAP, OAuth, SAML)
- Configure SMTP for email notifications
- Set up provisioning for dashboards and data sources
- Configure an external database (MySQL or PostgreSQL)