Code Monkey home page Code Monkey logo

grafana_on_dokku's Introduction

Grafana Dokku Maintenance

Run Grafana on Dokku

Perquisites

What is Grafana?

Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.

What is Dokku?

Dokku is the smallest PaaS implementation you've ever seen - Docker powered mini-Heroku.

Requirements

Setup

Note: We are going to use the domain grafana.example.com for demonstration purposes. Make sure to replace it to your domain name.

App and plugins

Create the app

Log onto your Dokku Host to create the Grafana app:

dokku apps:create grafana

Add plugins

Install, create and link PostgreSQL and Redis plugins:

# Install postgres plugin on Dokku
dokku plugin:install https://github.com/dokku/dokku-postgres.git postgres
# Create running plugin
dokku postgres:create grafana
# Link plugin to the main app
dokku postgres:link grafana grafana

Configuration

Add GF_DATABASE_URL and GF_SERVER_HTTP_PORT to environement variables

# Show all enironement variables to copy content of DATABASE_URL variable
dokku config grafana
# Set GF_DATABASE_URL
dokku config:set grafana GF_DATABASE_URL='previously_copied_database_url'
# Set port to 5000
dokku config:set grafana GF_SERVER_HTTP_PORT=5000

Setting secret key

dokku config:set grafana GF_SECURITY_SECRET_KEY=$(echo `openssl rand -base64 45` | tr -d \=+ | cut -c 1-32)

Domain setup

To get the routing working, we need to apply a few settings. First we set the domain.

dokku domains:set grafana grafana.example.com

Push Grafana to Dokku

Grabbing the repository

First clone this repository onto your machine.

Via SSH

git clone [email protected]:D1ceWard/grafana_on_dokku.git

Via HTTPS

git clone https://github.com/D1ceWard/grafana_on_dokku.git

Set up git remote

Now you need to set up your Dokku server as a remote.

git remote add dokku [email protected]:grafana

Push Grafana

Now we can push Grafana to Dokku (before moving on to the next part).

git push dokku master

SSL certificate

Last but not least, we can go an grab the SSL certificate from Let's Encrypt.

# Install letsencrypt plugin
dokku plugin:install https://github.com/dokku/dokku-letsencrypt.git

# Set certificate contact email
dokku config:set --no-restart grafana [email protected]

# Generate certificate
dokku letsencrypt grafana

In case of an error Challenge validation has failed, please check your proxy settings:

dokku proxy:report                          # you should see http:80:5000
dokku proxy:ports-add grafana http:80:5000  # otherwise, add the proxy to the port

Wrapping up

Your Grafana instance should now be available on https://grafana.example.com.

grafana_on_dokku's People

Contributors

alvinsj avatar d1ceward avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.