A server is ready for monitoring, and you need a place to view the measurements it collects. Grafana queries a configured data source and displays its values in dashboard panels.
This article walks through installing Grafana from its signed APT repository and checking the service and sign-in page.
TL;DR: Install Grafana from its APT repository
Install the grafana package from Grafana’s signed stable APT repository on Ubuntu or Debian. Then start grafana-server and open its web interface on port 3000.
- Use the official APT repository for ongoing package updates.
- Bind the repository to Grafana’s key with the signed-by option.
- Change the initial administrator password at first sign-in.
What is Grafana?
Grafana is dashboard software that queries a configured data source and displays the returned values in panels.
Prometheus is one time-series metrics source. Grafana sends queries to it and visualizes the results, while Prometheus remains responsible for storing the measurements.
A dashboard groups panels around an application or service. For a local setup, configure a source that the Grafana server can reach. A remote server may need a private address and credentials to query that source.
Which installation method should you use?
The APT repository is the sensible default on Ubuntu and Debian because package-index updates can include later Grafana releases. Use a downloaded .deb when you need to select a specific version and are prepared to manage updates yourself.
| Method | Package | Update behavior |
|---|---|---|
| Grafana stable APT repository | grafana (OSS) | Available through APT package updates |
| Downloaded .deb | Selected edition and release | Manually download each update |
| Standalone archive | Binary files | Manually manage files and service setup |
For a short explanation of package-index commands, see the Linux apt command guide.
How to install Grafana on Ubuntu or Debian step by step
Use an Ubuntu or Debian system with an account that has sudo access. The host also needs network access to Grafana’s package server.
The commands below change system package and service configuration, so run them on the machine where Grafana should live. Grafana’s current Debian/Ubuntu instructions use this repository URL and key path. Review those values before running the commands on a production host.
Step 1: Install the APT prerequisites
apt-transport-https enables HTTPS package transport. wget retrieves the key, and gnupg provides OpenPGP utilities. A minimal system may already have some prerequisites installed.
sudo apt-get install -y apt-transport-https wget gnupg
Step 2: Save Grafana’s signing key
Save Grafana’s signing key in a dedicated keyring file for the repository entry that follows.
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
Step 3: Add the stable Grafana repository
On a machine following an older Grafana guide, inspect APT list files for a retired packages.grafana.com/oss/deb entry. Disable only that obsolete Grafana line to avoid duplicate sources. The signed-by field ties this stable source to Grafana’s keyring, so APT does not trust that key for other repositories.
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
The repository line is saved in a .list file under APT’s sources directory. The -a option appends the line to that file. If you rerun the command, inspect the file first so you do not add the same source twice.
Step 4: Refresh package lists and install Grafana OSS
APT repositories publish package records in an index that your machine downloads before installing software. Refresh that index after adding Grafana so the package appears in APT’s local search results.
sudo apt-get update
sudo apt-get install grafana
When you want a later Grafana update, refresh the package index and ask APT to upgrade the installed grafana package. These are separate operations: the index refresh does not change installed software. Review dependency changes before confirming.
sudo apt-get update
sudo apt-get install grafana
Step 5: Start and verify the Grafana service
The package service runs under Grafana’s system user rather than an interactive account. Enabling the unit is a separate policy choice from starting it, so a machine used only for a temporary test can omit the enable command.
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server
sudo systemctl enable grafana-server.service
The status command should show the unit as active when startup succeeds. If it reports a failure, inspect the service journal before changing firewall rules.
Step 6: Open the Grafana sign-in page
From a browser on the same machine, visit http://localhost:3000. The address localhost refers to the device running the browser, not a separate server. From another device, use the server’s reachable hostname or IP address with port 3000, provided its network and firewall policy permits that connection.
Sign in with Grafana’s documented initial administrator credentials. Grafana prompts you to replace the initial password after the first sign-in, so set a unique value before other users can access the instance.
For remote access, allow TCP port 3000 only from the clients or network that need it. Do not enable a firewall blindly on a remote server because an incorrect rule can cut off your existing SSH session. The UFW firewall guide covers reviewing firewall rules before applying them.
What should you check after installation?
Use the table to choose a first check for each symptom.
| Symptom | Check | Next action |
|---|---|---|
| Package “grafana” cannot be found | Confirm the grafana.list entry and key file path, then refresh APT indexes | Correct the repository line or key path and run apt-get update again |
| APT reports a signature or key error | Check that gpg-full.key downloaded to /etc/apt/keyrings/grafana.asc and that signed-by points there | Fix the path and permissions. Leave signature verification enabled. |
| Service is inactive or failed | Run systemctl status grafana-server and inspect the system journal | Resolve the reported startup or configuration error before opening ports |
| Service is active but the page times out | Check the URL, listener port, host firewall and upstream network rules | Test locally first, then allow only the intended remote source |
| Do I need the Grafana server CLI to install the package? | No. APT installs the server and systemd controls its service. | Use the bundled CLI for separate admin or plugin tasks. See the official CLI reference. |
| Can Grafana OSS send email alerts immediately? | No. SMTP settings are required before email contact points can send notifications. | Configure the [smtp] section in grafana.ini, restart Grafana, then test a contact point with the official email guide. Keep relay credentials private. |
Investigate a failed service
If the unit is failed, inspect its service-specific journal before changing settings.
sudo journalctl -u grafana-server --no-pager
Look for the first error before the service stopped, then correct its cause and restart Grafana. Do not bypass package-signature checks to make APT continue.
The Debian package stores its main settings in /etc/grafana/grafana.ini. Keep the default listener unless a deployment requires a different port, because changing it also changes the browser address and firewall rule. Restart Grafana after editing the file so the new settings take effect.
- Download a selected package with the Linux wget guide.
- Configure follow-up monitoring with the Prometheus alerting guide.
- Review firewall changes with the UFW firewall guide.
Conclusion: Use the signed APT repository
Use Grafana’s current installation page as the reference when repository instructions change.
- Official install instructions: Install Grafana on Debian or Ubuntu.
- Service details: Start the Grafana server.
- Initial access: Sign in to Grafana.
- APT updates: apt and apt-get compared.
FAQ
These answers cover the first decisions after installing Grafana.
Is Grafana totally free?
Grafana OSS is free and open source. The Enterprise package includes OSS features, while Enterprise-only features require a license.
Which port does Grafana use by default?
Grafana uses port 3000 by default. Use localhost:3000 on the server itself, or the server address with port 3000 from a permitted remote client.
Does Grafana collect metrics by itself?
No. Grafana queries a configured data source such as Prometheus. Install or configure a data source separately before expecting dashboards to show monitoring data.
