Learn how to install and configure Grafana and Prometheus on Ubuntu 22.04 LTS

Requirements
In order to complete this tutorial, the following is a list of items that may be needed to complete this tutorial successfully:
1) 2 physical servers, 2 virtual machines, or 2 cloud-hosted VPS subscriptions
2) A fully qualified domain name point to the public IP address of the Ubuntu 22.04 server
3) Grafana and Prometheus dependencies and binaries
4) An SSH client such as Putty or the built-in terminal app for MacOS / Linux Desktop
5) A web browser such as Google Chrome, Internet Explorer, Safari, Firefox
Overview
The following is an overview of the steps covered in this tutorial:
1) Add the package repository and install Grafana
2) Install and configure the NGINX web server
3) Download, install, and configure Prometheus
4) Set up the node_exporter, add node_exporter to Prometheus
5) Integrate Prometheus with Grafana and set up dashboard monitoring
On Server 1
Step 1: Add the package repository and install Grafana
The first step in completing this setup is to install system dependencies for Graphana, Add the GPG key as well as the Graphana repository. Run the following command to install dependencies:
When the dependencies installation is complete, run the following command to the GPG key for Grafana. The GPG key ensures secure communication when downloading Grafana and also ensures that the Graphana package that you download is authentic
Next, run the commands shown below to add the Grafana repository to the Ubuntu server
Now that you have installed system dependencies, and added the GPG keys as well as the repository, you can now install Grafana. Run the commands below to start the installation
When the installation process is complete, use systemctl to start Grafana and set it to start automatically at system boot
Scroll down to the [server] section and configure the following:
1) http_addr = localhost
2) http_port = 3000
3) domain = yourhostname.yourdomain.com (this is the publicly facing domain name that you use to open grafana from a web browser)
To save changes, press CONTROL + O, press ENTER and press CONTROL + X to exit the file. Restart the grafana service so that the changes made to the grafana.ini configuration file take effect
Step 2: Install and configure NGINX
In step 2, download NGINX web server and configure it to operate as a reverse proxy server for Grafana. Run the command shown below to install NGINX:
Proceed to create a virtual host configuration file that will instruct NGINX how to handle HTTP traffic for Grafana
Copy and paste into the file the configuration below. The configuration creates a reverse proxy on port 3000 such that if a user enters yourserver.yourdomain.com in the browser address bar, the traffic will redirect to yourserver.yourdomain.com:3000. Ensure to replace yourhostname.yourdomain.com with the domain that is pointing to the public IP address of the Ubuntu server.
Then run an nginx configuration test to ensure that you have configured everything correctly