Prerequisites
Ensure you have the following installed:Required Dependencies
- Git: For cloning the repository
- Go: See go.mod for the minimum required version (currently 1.25.8)
- Node.js (LTS): Version 24.x with corepack enabled (see .nvmrc)
- GCC (optional): Enables CGO for smaller, dynamically-linked binaries with SQLite support
Platform-Specific Instructions
- macOS
- Windows
- Linux
Install dependencies using Homebrew:
Clone the Repository
1
Clone the repository
2
Enable and install Yarn via corepack
Grafana uses Yarn 4.11.0 for frontend dependency management:
3
Install frontend dependencies
Troubleshooting: Checksum mismatch errors
Troubleshooting: Checksum mismatch errors
If you get an error about remote archive checksum mismatch:
Configure Pre-commit Hooks (Optional)
Pre-commit hooks lint, fix, and format code as you commit. They’re opt-in for contributors.We strongly encourage frontend contributors to install pre-commit hooks to keep
eslint-suppressions.json in sync, even if your IDE formats on save.Configure Development Environment
Create Custom Configuration
The default configuration is inconf/defaults.ini. To override settings:
1
Create custom.ini
2
Enable development mode
Add this to
conf/custom.ini:3
Add any other overrides (optional)
You only need to add settings you want to override from
defaults.ini.Set Up Data Sources (Optional)
To test with real data sources during development:1
Install Docker
Grafana uses Docker to run databases in the background.Install Docker before proceeding.
2
Start data source containers
From the repository root:This generates a Docker Compose file with your specified data sources and runs them.
Available data sources
Available data sources
See the devenv/docker/blocks directory for all available sources.Some have macOS-specific images (e.g.,
nginx_proxy_mac).3
Set up dashboards and data sources
- Data sources named
gdev-<type> - Dashboards in the “gdev dashboards” folder
4
Stop data sources when done
Troubleshooting
Too Many Open Files (macOS/Linux)
If you encounter “too many open files” errors:1
Check current limit
2
Increase the limit
3
Make it permanent
Add to your shell initialization file (
~/.zshrc or ~/.bashrc):File Watchers Limit (Linux)
If you see “System limit for number of file watchers reached”:File Watchers Limit (macOS)
JavaScript Heap Out of Memory
If Node.js runs out of memory:IDE Configuration
Configure your IDE to use the TypeScript version fromnode_modules/.bin/tsc (should match package.json).
Grafana previously used Yarn PnP, but now uses standard node_modules. If you have custom ESLint, Prettier, or TypeScript paths configured, you can remove them.
Next Steps
Project Structure
Learn how the monorepo is organized
Building
Build and run Grafana locally