How to Install Grafana on Ubuntu 24.04
Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus, and InfluxDB. As an example, when using InfluxDB as your data source,data stored on InfluxDB will be visualized using Grafana Graphs.
First, check for any pending system upgrade
Let's update software packages first. To perform updates, run the following command:
apt update
Add the Grafana
APT Repository on Ubuntu 24.04
apt install -y gnupg2 curl software-properties-common
curl -fsSL https://packages.grafana.com/gpg.key|sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/grafana.gpg
Install the Grafana
CE on Ubuntu 24.04
add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
Install Grafana
on Ubuntu 24.04
apt -y install grafana
Output:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
sudo /bin/systemctl start grafana-server
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3) ...
Scanning processes...
Scanning candidates...
Scanning linux images...
Running kernel seems to be up-to-date.
Restarting services...
/etc/needrestart/restart.d/systemd-manager
systemctl restart cron.service packagekit.service polkit.service rsyslog.service ssh.service systemd-journald.service
Service restarts being deferred:
systemctl restart ModemManager.service
/etc/needrestart/restart.d/dbus.service
systemctl restart networkd-dispatcher.service
systemctl restart systemd-logind.service
systemctl restart unattended-upgrades.service
systemctl restart user@0.service
To Start and grafana-server
systemctl enable --now grafana-server
Output:
root@vps:~# systemctl status grafana-server.service
● grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2022-11-21 17:26:04 UTC; 8s ago
Docs: http://docs.grafana.org
Main PID: 32650 (grafana-server)
Tasks: 8 (limit: 2241)
Memory: 40.4M
CPU: 1.191s
CGroup: /system.slice/grafana-server.service
└─32650 /usr/sbin/grafana-server --config=/etc/grafana/grafana.ini --pidfile=/run/grafana/grafana-server.pid --packa>
Allow Ports on Firewall
apt -y install ufw
To enable the firewall service:
ufw enable
To Open the port on the firewall:
ufw allow ssh
ufw allow 3000/tcp
Output:
root@vps:~# sudo ufw allow 3000/tcp
Rule added
Rule added (v6)
To restrict access to a specific subnet, use:
sudo ufw allow from yourserver.ip.address/24 to any port 3000
Accessing Grafana
Now open the IP address or Domain name from your browser, this will redirect you to the Appwrite.
http://server.ip.address:3000/login
Replace the server.ip.address with the actual IP or domain configured on the server.
The default logins are defined as,
Username: admin Password: admin
Follow the below steps:
This concludes the Installation and Grafana on Ubuntu 24.04.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS