Installation guides

Installing Grafana on Debian

Step-by-Step Guide

  1. Update the Package Index
    Open a terminal and update the package index to ensure you have the latest information about available packages:
   sudo apt update
  1. Install Dependencies
    Install the necessary dependencies for Grafana:
   sudo apt install -y software-properties-common
  1. Add the Grafana APT Repository
    Add the Grafana APT repository to your system:
   sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main"
  1. Add the Grafana GPG Key
    Add the Grafana GPG key to your system:
   wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
  1. Update the Package Index Again
    Update the package index to include the Grafana repository:
   sudo apt update
  1. Install Grafana
    Install Grafana using the apt package manager:
   sudo apt install grafana
  1. Start and Enable Grafana
    Start the Grafana service:
   sudo systemctl start grafana-server

Enable Grafana to start on boot:

   sudo systemctl enable grafana-server
  1. Verify Grafana Installation
    Check the Grafana service status to ensure it is running:
   sudo systemctl status grafana-server

If Grafana is running, you should see an active (running) status.

  1. Access the Grafana Web Interface
    Open your web browser and navigate to http://your_server_ip:3000. You should see the Grafana login screen.
  2. Log In to Grafana
    The default username and password for Grafana are both admin. Log in using these credentials. You will be prompted to change the default password after the first login.
  3. Add a Data Source
    After logging in, you need to add a data source. Click on the gear icon (Configuration) on the left sidebar, then select “Data Sources” and click “Add data source”. Select your preferred data source type (e.g., Prometheus, MySQL, PostgreSQL) and configure the connection settings.
  4. Create a Dashboard
    To create a new dashboard, click on the plus icon (+) on the left sidebar, then select “Dashboard” and click “Add new panel”. You can add various panels (graphs, tables, etc.) and configure them to display data from your data source.
  5. Install Grafana Plugins (Optional)
    Grafana supports various plugins. To install a plugin, use the Grafana CLI. For example, to install the grafana-piechart-panel plugin: sudo grafana-cli plugins install grafana-piechart-panel Restart Grafana to apply the changes: sudo systemctl restart grafana-server
  6. Configure Grafana (Optional)
    You can configure Grafana settings by editing the Grafana configuration file located at /etc/grafana/grafana.ini. After making changes, restart Grafana to apply them: sudo nano /etc/grafana/grafana.ini sudo systemctl restart grafana-server
  7. Secure Grafana (Optional)
    For additional security, consider enabling HTTPS for Grafana. Obtain an SSL certificate (e.g., using Let’s Encrypt) and configure Grafana to use it by editing the configuration file:
    ini

[server]

protocol = https cert_file = /path/to/your/cert.crt cert_key = /path/to/your/cert.key

Other Recent Posts