2015-03-09 11:12:59 -05:00
|
|
|
---
|
2015-03-10 02:51:26 -05:00
|
|
|
page_title: Building from source
|
|
|
|
page_description: Building from source Grafana.
|
|
|
|
page_keywords: grafana, build, contribute, documentation
|
2015-03-09 11:12:59 -05:00
|
|
|
---
|
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
# Building Grafana from source
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
Guide for creating packages from source, and for getting grafana up and running in
|
|
|
|
dev environment.
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
## Dependencies
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
- Go 1.4
|
|
|
|
- NodeJS
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
## Get Code
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
```
|
|
|
|
go get github.com/grafana/grafana
|
|
|
|
```
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
## Building the backend
|
|
|
|
```
|
|
|
|
cd $GOPATH/src/github.com/grafana/grafana
|
|
|
|
go run build.go setup (only needed once to install godep)
|
|
|
|
godep restore (will pull down all golang lib dependecies in your current GOPATH)
|
|
|
|
go build .
|
|
|
|
```
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-04-19 02:44:14 -05:00
|
|
|
# Building on Windows
|
|
|
|
The Grafana backend includes Sqlite3 which requires GCC to compile. So in order to compile Grafana on windows you need
|
|
|
|
to install GCC. We recommend [TDM-GCC](http://tdm-gcc.tdragon.net/download).
|
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
## Building frontend assets
|
2015-03-09 11:12:59 -05:00
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
To build less to css for the frontend you will need a recent version of of node (v0.12.0),
|
|
|
|
npm (v2.5.0) and grunt (v0.4.5). Run the following:
|
|
|
|
|
|
|
|
```
|
|
|
|
npm install
|
|
|
|
npm install -g grunt-cli
|
|
|
|
grunt
|
|
|
|
```
|
|
|
|
|
|
|
|
## Recompile backend on source change
|
|
|
|
To rebuild on source change (requires that you executed godep restore)
|
|
|
|
```
|
|
|
|
go get github.com/Unknwon/bra
|
|
|
|
bra run
|
|
|
|
```
|
|
|
|
|
|
|
|
## Running
|
|
|
|
```
|
2015-04-13 00:34:55 -05:00
|
|
|
./grafana-server
|
2015-03-10 03:03:05 -05:00
|
|
|
```
|
|
|
|
|
|
|
|
Open grafana in your browser (default http://localhost:3000) and login with admin user (default user/pass = admin/admin).
|
|
|
|
|
2015-03-30 04:08:46 -05:00
|
|
|
## Creating optimized release packages
|
|
|
|
```
|
|
|
|
go run build.go build package
|
|
|
|
```
|
|
|
|
|
2015-03-10 03:03:05 -05:00
|
|
|
## Dev config
|
|
|
|
|
|
|
|
Create a custom.ini in the conf directory to override default configuration options.
|
|
|
|
You only need to add the options you want to override. Config files are applied in the order of:
|
|
|
|
|
|
|
|
1. grafana.ini
|
2015-04-13 00:34:55 -05:00
|
|
|
2. custom.ini
|
2015-03-09 11:12:59 -05:00
|
|
|
|
|
|
|
## Create a pull requests
|
|
|
|
|
2015-06-02 10:45:44 -05:00
|
|
|
Before or after your create a pull requests, sign the [contributor license agreement](/docs/contributing/cla.html).
|