A Go application with a web UI to export Grafana dashboards and their linked libraries.
- Web-based interface for selecting dashboards to export
- Multi-organization support — switch between Grafana organizations from the UI
- Dual authentication — Bearer token (API key) or Basic auth (username/password)
- Automatically exports linked library panels
- Preserves folder structure for dashboards and libraries
- Supports nested folder hierarchies (clicking a folder shows all sub-folder dashboards)
- Sort dashboards by name or last updated date with version tracking
- Export as individual JSON files or ZIP archive
- Alert rules export (modern and legacy Grafana API)
- Search and filter capabilities
- Works with Grafana v10.x / v11.x
- Go 1.22 or higher
- Access to a Grafana instance
- Grafana API key with viewer permissions, or username/password with basic auth enabled
Download the appropriate package for your system from the releases page:
.debpackage for Debian/Ubuntu.rpmpackage for RHEL/CentOS/Fedora.exefor Windows- Binary files for other Linux distributions
git clone https://github.com/yourusername/grafana-exporter.git
cd grafana-exporter
go mod download
go buildCreate a .env file based on .env.example:
# Grafana connection
GRAFANA_URL=https://your-grafana-instance
# Authentication (choose one method):
# Option 1: API key (Bearer token) — single org
GRAFANA_API_KEY=your-api-key-here
# Option 2: Basic auth (username/password) — supports multi-org switching
GRAFANA_USER=admin
GRAFANA_PASSWORD=your-password
# General settings
SKIP_TLS_VERIFY=true
GRAFANA_VERSION=11.1
EXPORT_DIRECTORY=./exported
SERVER_HOST=127.0.0.1
SERVER_PORT=8080
FORCE_ENABLE_ZIP_EXPORT=false| Method | Env Vars | Multi-Org | Notes |
|---|---|---|---|
| API Key | GRAFANA_API_KEY |
No | Default. Create via Grafana > Administration > Service accounts |
| Basic Auth | GRAFANA_USER + GRAFANA_PASSWORD |
Yes | Auto-detected when both are set. Requires [auth.basic] enabled = true in Grafana config |
When using basic auth, the organization selector appears in the UI allowing you to switch between orgs.
- Start the application:
./grafana-exporter- Open your web browser and navigate to:
http://localhost:8080
- Use the web interface to:
- Switch between organizations (if using basic auth)
- Browse folders and dashboards (clicking a folder includes subfolders)
- Sort by name or last updated date
- Select dashboards and alert rules to export
- Export as JSON files or ZIP archive with linked library panels
-
In your Grafana instance, go to:
- Configuration > API Keys (Grafana < v9)
- Administration > API Keys (Grafana v9+)
- Administration > Service accounts (Grafana v10+)
-
Add a new API key with
Viewerrole permission -
Copy the generated API key to your
.envfile
Exported files maintain the original folder structure:
exported/
├── 20240228_123045/ # Timestamp of export
│ ├── dashboards/
│ │ ├── General/ # General folder
│ │ │ └── Dashboard1.json
│ │ └── FolderName/ # Named folders
│ │ └── Dashboard2.json
│ └── libraries/
│ ├── General/
│ │ └── Panel1.json
│ └── FolderName/
│ └── Panel2.json
docker build -t grafana-exporter .
docker run -p 8080:8080 --env-file .env -v $(pwd)/exported:/app/exported grafana-exporterYou can pull the pre-built image from GitHub Container Registry:
docker pull ghcr.io/fulgerx2007/grafana-exporter:latest
docker run -p 8080:8080 --env-file .env -v $(pwd)/exported:/app/exported ghcr.io/fulgerx2007/grafana-exporter:latestOr use a specific version:
docker pull ghcr.io/fulgerx2007/grafana-exporter:v1.0.0
docker run -p 8080:8080 --env-file .env -v $(pwd)/exported:/app/exported ghcr.io/fulgerx2007/grafana-exporter:v1.0.0This project is licensed under the MIT License - see the LICENSE file for details.
