Skip to main content
Grafana consists of two components that can be built independently: the frontend (TypeScript/React) and the backend (Go).

Quick Start

The fastest way to get started:
Then visit http://localhost:3000 (login: admin / admin).

Building the Backend

The backend is a Go web server that serves the API and frontend assets.

Development Build with Hot-Reload

1

Start the backend with hot-reload

This:
  • Builds the Go binary
  • Starts the server on localhost:3000
  • Watches for changes and automatically rebuilds
  • Uses Air for hot-reload (configured in .air.toml)
First build takes ~3 minutes due to debug symbols. Subsequent hot-reload rebuilds are much faster.
2

Log in to Grafana

Visit http://localhost:3000 and log in:Grafana will prompt you to change the password on first login.

Production Build

Build the backend without hot-reload:
The binary is created at bin/grafana.

Build Without Make

If you prefer not to use Make:

CGO and Static Builds

make run and make build-go detect GCC and enable CGO automatically if available.
  • With CGO: Uses SQLite for the embedded database
  • Without CGO: No SQLite support

Windows-Specific Build Instructions

1

Install Wire tool

2

Generate Wire code

3

Build binaries

Binaries will be in bin\windows-amd64.
On Windows, you can use Make for Windows in a UNIX shell like Git Bash.

Building the Frontend

The frontend is built with webpack and served by the backend in development.

Development Build with Watch

1

Install dependencies (if not already done)

2

Start the webpack dev server

This:
  • Generates SASS theme files
  • Builds all external plugins
  • Compiles frontend assets
  • Watches for changes and rebuilds automatically
  • Serves via webpack dev server (proxied by backend)
First compile takes ~45 seconds. Subsequent rebuilds are incremental and faster.

Production Build

Build optimized frontend assets:
Assets are output to public/build/.

Build Variations

Troubleshooting Frontend Builds

The incremental TypeScript build cache may be stale:
Temporary mismatch for a dependency:

Building Plugins

Some built-in plugins require separate builds:

Build All Plugins

This is resource-intensive as it starts separate build processes for each plugin.

Build Specific Plugins

Build a single plugin:
Build multiple specific plugins:

List All Plugins

Plugins Requiring Separate Builds

  • azuremonitor
  • cloud-monitoring
  • grafana-postgresql-datasource
  • grafana-pyroscope-datasource
  • grafana-testdata-datasource
  • jaeger
  • loki
  • mysql
  • parca
  • tempo
  • zipkin

Building Both Frontend and Backend

Build everything in one command:
This runs:
  1. make build-go - Builds backend
  2. yarn build - Builds frontend

Code Generation

Some changes require regenerating code:

Wire Dependency Injection

After modifying service initialization:

CUE Schemas

After modifying dashboard/panel schemas in kinds/:

Feature Toggles

After adding/modifying feature flags in pkg/services/featuremgmt/:

App SDK Apps

After modifying apps in apps/:
Or for a specific app:

Go Workspace

After adding Go modules:

OpenAPI/Swagger Specs

After API changes:

i18n String Extraction

After adding translatable strings:

Building for Docker

Build a development Docker image:
The image is tagged as grafana/grafana:dev.
On Docker for macOS, increase memory limit to >2 GiB in Docker Desktop → Preferences → Advanced.
Build Ubuntu-based image:

Linting and Formatting

Before committing, ensure your code passes linting:

Backend

Frontend

Build Configuration

Environment Variables

Makefile Targets

View all available targets:
Common targets:
  • make run - Run backend with hot-reload
  • make build - Build frontend and backend
  • make build-backend - Build backend only
  • make test-go - Run backend tests
  • make test-js - Run frontend tests
  • make devenv - Start development services

Next Steps

Testing

Run tests for your changes

Creating Pull Requests

Submit your changes for review