news
Serverspace has added a new Rocky Linux OS
BM
September 12, 2022
Updated June 7, 2023

Installing Grafana on Ubuntu 20.04

Linux Ubuntu

What's important to know before installation

Grafana supports the following databases:

  • SQLite
  • MySQL
  • PostgreSQL

Requirements for the stable operation of Grafana:

  • Processor - 1 CPU
  • RAM - 500 mb
  • Free space on disk - 25 gb


Creating a server under Softaculous thanks to Serverspace.

Let's create a server that will meet the recommended characteristics.

To create servers, do the following steps:

  • Login to your personal area, go to the vStack cloud > Servers tab and click Create Server:

112121

  • Select the recommended requirements and click Create:

pic2

pic3

  • If you need to install any applications, you can do this during the deployment phase:

1231231

  • Don't forget to configure access to the server. (Either via a private ssh key or using login + password)

1. The installation of Grafana comes from the official developer's repository.

Download the GPG key and add it to the list of trusted keys.

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

granfa 1

2. Now you have to add it to the Grafana repository.

sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"

granfa 2

3. Once it has been added, we need to update the ART cache and continue the installation of Grafana.

sudo apt update

granfa3

sudo apt install grafana

granfa4
If you get this error at the end of the installation:

granfa5
Type "apt -fix-broken install" and try again, it may work.

apt -fix-broken install

4. After the installation, add grafana to the autostart and start the Grafana daemon itself.

sudo systemctl enable grafana-server

granfa6

sudo systemctl start grafana-server

granfa71

5. The installation of the Grafana repository on Ubuntu is finished and it is ready to be used.

And finally, check the status of Grafana:

sudo systemctl status grafana-server

If everything is set up correctly, the result will be the output:

granfa7

Demonstration of the firewall configuration to allow access to Grafana.

The default configuration shows that Grafana is only available on port 3000. However, if we want to use the iptables or firewall, we have to grant them access to the network on this port. firewalld command set. (a new rule needs to be added and the firewalld service needs to be restarted for the configuration to be applied)

firewall-cmd --zone=public --add-port=3000/tcp –permanent

granfa8

systemctl reload firewalld

granfa9

instruction set iptables:

nano /etc/sysconfig/iptables

Then find the OUTPUT ACCEPT section and enter the following line:

-A INPUT -p tcp -m tcp --dport 3000 -m state --state NEW -j ACCEPT

granfa10

And reload iptables:

sudo systemctl restart iptables

granfa11

After all the manipulations described above, the firewall will allow access to the connection via port 3000. You can easily check this by opening a new tab in the Grafana interface. The default login information is admin (login and password).

granfa12

After entering the login and password, we are prompted to enter a new password (enter your ultra-complicated password).

granfa13

And after that we successfully enter Grafana.

granfa14

If you are unable to log in to Grafana or if you have changed your password, you can reset the password of the administrative WEB interface via the CLI :

grafana-cli admin reset-admin-password --homepath "/usr/share/grafana" new_password

After these operations, you can try again to access the Grafana WEB interface by entering your new password.

Conclusion:

Using this publication, you can easily install Granfana monitoring system on a server with Ubuntu 20.04 operating system.


Vote:
4 out of 5
Аverage rating : 4
Rated by: 8
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
ITGLOBAL.COM NL
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.