Quick Start
The fastest way to get started: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
- 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:bin/grafana.
Build Without Make
If you prefer not to use Make:CGO and Static Builds
- Development (Default)
- Production
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
Follow the Wire installation instructions.
2
Generate Wire code
3
Build binaries
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
- 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:public/build/.
Build Variations
Troubleshooting Frontend Builds
Type-checking errors after git pull
Type-checking errors after git pull
The incremental TypeScript build cache may be stale:
Checksum mismatch on yarn install
Checksum mismatch on yarn install
Temporary mismatch for a dependency:
Building Plugins
Some built-in plugins require separate builds:Build All Plugins
Build Specific Plugins
Build a single plugin: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:make build-go- Builds backendyarn build- Builds frontend
Code Generation
Some changes require regenerating code:Wire Dependency Injection
After modifying service initialization:CUE Schemas
After modifying dashboard/panel schemas inkinds/:
Feature Toggles
After adding/modifying feature flags inpkg/services/featuremgmt/:
App SDK Apps
After modifying apps inapps/:
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:grafana/grafana:dev.
On Docker for macOS, increase memory limit to >2 GiB in Docker Desktop → Preferences → Advanced.
Linting and Formatting
Before committing, ensure your code passes linting:Backend
Frontend
Build Configuration
Environment Variables
Makefile Targets
View all available targets:make run- Run backend with hot-reloadmake build- Build frontend and backendmake build-backend- Build backend onlymake test-go- Run backend testsmake test-js- Run frontend testsmake devenv- Start development services
Next Steps
Testing
Run tests for your changes
Creating Pull Requests
Submit your changes for review