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
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:
Set Up Data Sources (Optional)
To test with real data sources during development:Install Docker
Grafana uses Docker to run databases in the background.Install Docker before proceeding.
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).Set up dashboards and data sources
- Data sources named
gdev-<type> - Dashboards in the “gdev dashboards” folder
Troubleshooting
Too Many Open Files (macOS/Linux)
If you encounter “too many open files” errors: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