Monitor Your System with Graphite and a Grafana Dashboard

Updated , by Jared Kobos

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Try this guide to receive $100 at signup on a new account.

What are Graphite and Grafana?

Graphite is an open source monitoring tool for storing and viewing time series data. It does not collect data by itself, but has a simple interface and integrates easily with third-party tools. Grafana allows you to connect to a Graphite installation (or other data source) and build dashboards to view and analyze the data.

This guide uses Docker Compose to run the official Grafana and Graphite containers and connect them to a user-defined network. This makes it easy to securely connect a Grafana dashboard to the Graphite database.


You will need both Docker and Docker Compose to complete this guide.

Install Docker

These steps install Docker Community Edition (CE) using the official Ubuntu repositories. To install on another distribution, or to install on Mac or Windows, see the official installation page.

  1. Remove any older installations of Docker that may be on your system:

    sudo apt remove docker docker-engine
  2. Make sure you have the necessary packages to allow the use of Docker’s repository:

    sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg
  3. Add Docker’s GPG key:

    curl -fsSL | sudo apt-key add -
  4. Verify the fingerprint of the GPG key:

    sudo apt-key fingerprint 0EBFCD88

    You should see output similar to the following:

      pub   rsa4096 2017-02-22 [SCEA]
          9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
    uid           [ unknown] Docker Release (CE deb) <[email protected]>
    sub   rsa4096 2017-02-22 [S]
  5. Add the stable Docker repository:

    sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"

    For Ubuntu 19.04, if you get an E: Package 'docker-ce' has no installation candidate error, this is because the stable version of docker is not yet available. Therefore, you will need to use the edge / test repository.

    sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable edge test"
  6. Update your package index and install Docker CE:

    sudo apt update
    sudo apt install docker-ce
  7. Add your limited Linux user account to the docker group:

    sudo usermod -aG docker $USER
    After entering the usermod command, you will need to close your SSH session and open a new one for this change to take effect.
  8. Check that the installation was successful by running the built-in “Hello World” program:

    docker run hello-world

Install Docker Compose

  1. Download the latest version of Docker Compose. Check the releases page and replace 1.25.4 in the command below with the version tagged as Latest release:

     sudo curl -L`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
  2. Set file permissions:

     sudo chmod +x /usr/local/bin/docker-compose

Docker Compose Configuration

  1. Create a directory:

    mkdir ~/grafana && cd ~/grafana
  2. In a text editor, create docker-compose.yml and add the following content:

    File: docker-compose.yml
    version: "3"
        image: grafana/grafana
        container_name: grafana
        restart: always
          - 3000:3000
          - grafana-net
          - grafana-volume
        image: graphiteapp/graphite-statsd
        container_name: graphite
        restart: always
          - grafana-net
        external: true

    This Compose file uses the official Docker images for both Graphite and Grafana. It also specifies a network to connect the containers.

  3. Since the data volume is external, you will need to create it manually:

    docker volume create --name=grafana-volume
  4. Bring up the configuration:

    docker-compose up -d
  5. Check that both containers started successfully:

    docker ps
      CONTAINER ID        IMAGE                         COMMAND             CREATED             STATUS              PORTS                                                                     NAMES
    494e45f7ab56        grafana/grafana               "/"           19 seconds ago      Up 7 seconds>3000/tcp                                                    grafana
    49881363d811        graphiteapp/graphite-statsd   "/sbin/my_init"     19 seconds ago      Up 7 seconds        80/tcp, 2003-2004/tcp, 2023-2024/tcp, 8080/tcp, 8125-8126/tcp, 8125/udp   graphite

Add a Data Source and Create a Grafana Dashboard

  1. In a browser, navigate to port 3000 on your Linode’s FQDN or public IP address (e.g. You should see the Grafana login page:

  2. Log in using the default admin account (username and password are both admin).

  3. Click Create data source in the main dashboard and fill in the form as follows:

    • Name: Graphite
    • Type: Graphite
    • URL: http://graphite:8080
    • Access: Server (Default)
    • Version: Select the newest available. 1.1.3 in this example.

    Click Save & Test.

  4. Click New dashboard to create and customize a new panel:

    • To import a sample Dashboard, try the Internal Grafana Stats.

      1. Click New dashboard at the top, then Import dashboard.
      2. Type 55 into the Dashboard box, and click Load.
      3. Select Graphite in the data source dropdown, and click Import.
  5. Click the floppy disk icon or press CTRL+S to save.

  6. Click Add users to access the user management configuration tab.

  7. Hover over the user icon in the lower left corner of the sidebar and click Preferences to open a menu where you can replace the default admin username and password with something more secure:

Next Steps

Graphite does not collect data by itself. See the Graphite documentation for a list of third party tools to add data for visualization. In addition, a larger, distributed deployment of Graphite may not be suitable for the containerized approach taken in this guide. If this is your use case, see the documentation for instructions on how to install Graphite from scratch.

This page was originally published on

Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.