Updated on 2024-04-30 GMT+08:00

Installing and Configuring Grafana on Linux

Prerequisites

  • An Ubuntu server that is accessible to the Internet is available. If no, the following conditions must be met:
  • You have obtained an ECS. (You are advised to select 8 vCPUs or higher, Ubuntu image of 22.04 version, and 100 GB local storage.) For details, see Purchasing an ECS.
  • You have purchased an EIP and bound it to the ECS. For details, see Assigning an EIP and Binding It to an ECS.

Procedure

  1. Log in to the ECS. Select a login method. For details, see .
  2. Run the following command to install libfontconfig1:
    sudo apt-get install -y adduser libfontconfig1

    The operation is successful if the following information is displayed:

  3. Run the following command to download the Grafana installation package:
    wget https://dl.grafana.com/oss/release/grafana_9.3.6_amd64.deb --no-check-certificate

    Download completed:

  4. Run the following command to install Grafana:
    sudo dpkg -i grafana_9.3.6_amd64.deb

  5. Run the following command to start Grafana:
    sudo /bin/systemctl start grafana-server
  6. Access Grafana configurations on your local PC.
    Ensure that an EIP has been bound to the ECS and the security group configuration is correct (the inbound traffic from TCP port 3000 and all outbound traffic are allowed). Configuration process:
    1. Click the ECS name to go to the ECS details page. Then, click the Security Groups tab, and click Manage Rule.

    2. Click Inbound Rules and allow inbound traffic from TCP port 3000. By default, all outbound traffic is allowed.

  7. Access http://{EIP}:3000 in a browser. The default username and password for the first login are admin. After the login is successful, change the password as prompted.