How to uninstall Grafana and remove its data
Remove Grafana packages, containers, or Helm releases, then decide which configuration, dashboards, databases, and persistent storage to keep.
Uninstall Grafana using the tool that installed it, then handle its data separately. Removing an application package or container does not necessarily remove dashboards, users, plugins, or persistent storage.
Before deleting anything, inspect Grafana's configured data paths and database backend. Back up the configuration, provisioning files, plugins, and database you want to retain. Stop Grafana before copying its SQLite database. A deployment using MySQL or PostgreSQL requires a backup of that external database.
Remove the installation
For Debian or Ubuntu packages:
sudo systemctl stop grafana-server
sudo apt-get remove --purge grafana
Use the installed package name, such as grafana-enterprise, if different. Purge removes package-managed configuration; it is not a guarantee that application data disappears. Review the proposed package list before optionally running sudo apt-get autoremove.
For an RPM installation:
sudo systemctl stop grafana-server
sudo dnf remove grafana
Older systems may use yum remove grafana.
For a manually installed binary, stop and disable the service, then remove the installation directory and service unit you actually created:
sudo systemctl stop grafana-server
sudo systemctl disable grafana-server
sudo rm -rf /usr/local/grafana
sudo rm -f /etc/systemd/system/grafana-server.service
sudo systemctl daemon-reload
These paths are examples; a binary installation may live elsewhere.
For Docker:
docker stop grafana
docker rm grafana
docker image rm grafana/grafana
Inspect the container's mounts before removal. A named volume remains unless explicitly deleted. After backing it up and confirming it is no longer needed, docker volume rm grafana-storage removes that example volume. Bind-mounted directories require separate cleanup.
For Helm:
helm uninstall grafana -n monitoring
Inspect any retained PVCs before deleting them. Deleting a PVC may also delete the backing storage, depending on the PV reclaim policy and provisioner.
Remove residual files deliberately
For a typical Linux package installation, these directories may remain:
/var/lib/grafana
/etc/grafana
/var/log/grafana
Delete them only after verifying their ownership and backups. Custom paths, mounted storage, and external databases are outside this list. Removing Grafana does not remove the metrics stored in a separate Prometheus server.
FAQ
Can I reset Grafana without uninstalling it? A fresh SQLite database creates fresh application state, but deleting grafana.db also removes users, data sources, and dashboards. Provisioning and configured initial administrator credentials affect what is recreated; do not assume every installation resets to admin/admin. For a forgotten password, use Grafana's password-reset procedure instead.
Why is port 3000 still occupied? Run sudo lsof -i :3000 and identify the owning process or container. Stop that service through its supervisor; the listener may belong to another application.
Sources
This guide is based on the documentation below; the examples have not been tested against a live deployment.
Contact us
Join the community
to join the community
Try Guance
Start online and pay only for what you use.
Get startedChoose a Guance plan