How to Install and Run Grafana Docker (Step-by-Step 2025 Guide)

Grafana Docker

Table of Contents

Get up to 50% off now

Become a partner with CyberPanel and gain access to an incredible offer of up to 50% off on CyberPanel add-ons. Plus, as a partner, you’ll also benefit from comprehensive marketing support and a whole lot more. Join us on this journey today!

Grafana is a top open-source tool for monitoring and observability. It enables you to query, visualize, alert on, and comprehend your metrics regardless of their storage location.

With Grafana, you can build, explore, and share dashboards with your team, promoting a data-driven culture.

Here’s a straightforward guide to installing and running Grafana Docker using official Docker resources. And tell you why you need to run Grafana on Docker in 2025.

Prerequisites for Running Grafana Docker

Before you begin, ensure your system meets these requirements:

  • Docker installed: You must have Docker Engine installed and operational on your system. For a quick start, Hostinger provides a one-click Docker installation template with our VPS hosting plans.
  • Command-line familiarity: You should be comfortable using a terminal to execute Docker commands. Hostinger offers a user-friendly browser console that enables you to run commands directly within the browser.
  • Sudo access: On Linux, you need to prefix Docker commands with sudo or add your user to the Docker group.

Once these are set up, you’ll be ready to start.

How to Install Grafana with Docker

To begin, download the Grafana image from Docker Hub. This image has everything you need to install and run Grafana in a container.

Tech Delivered to Your Inbox!

Get exclusive access to all things tech-savvy, and be the first to receive 

the latest updates directly in your inbox.

Here’s the basic command:

docker pull grafana/grafana

Docker will automatically get the latest stable version if you don’t specify a version tag. If you want a specific version, like 10.3.1, your command should be:

docker pull grafana/grafana:10.3.1

You can find all available Grafana version tags on Docker Hub.

Running this will:

Download the official Grafana Docker image and save it on your machine.

Make sure Docker can create containers using this image by adding the required dependencies.
Terminal window showing the command docker pull grafana executed and its results.
You only need to run docker pull once, unless you want to update your image for the latest changes.

Running Grafana container with docker run

After each successful build of the main branch, two tags are updated: grafana/grafana:main and grafana/grafana:main-ubuntu. In addition, two new tags are created: grafana/grafana-dev: and grafana/grafana-dev:-ubuntu, where represents a prerelease version of Grafana.

Like, if the GitHub Run ID of the build is 1234, the version would be 12.2.0-1234. These tags allow access to the latest Grafana main builds.

This maintains stability and consistency. We highly recommend using the grafana/grafana-dev: tag when deploying the Grafana main branch in a production setting. This tag guarantees that you are utilizing a specific version of Grafana rather than the latest commit, which might introduce bugs or problems. It also helps prevent cluttering the tag namespace for the main Grafana images with numerous pre-release tags.

Using Docker Compose For Easier Setup

After pulling the Grafana image, you can launch a Docker container using a single Docker run command. This is the quickest method to run Grafana either locally or on a server.

Enhance Your CyerPanel Experience Today!
Discover a world of enhanced features and show your support for our ongoing development with CyberPanel add-ons. Elevate your experience today!

Here’s a simple example:

docker run -d -p 3000:3000 --name=grafana grafana/grafana

Let’s explain what this command does:

  • docker run: Instructs Docker to create and launch a new container.
  • -d: Runs the Docker container in detached mode, meaning it operates in the background.
  • -p 3000:3000: Connects port 3000 on your host to port 3000 in the Docker container, which is the default port for Grafana.
  • –name=grafana: Assigns a recognizable name (grafana) to your Docker container, making it easier to reference in future commands.
  • grafana/grafana: Indicates the Docker image to be used.

When the container begins, Grafana will be configured. You can check if the Grafana Docker container is running by executing:

docker ps
In the output, you should see a running Docker container called grafana, like this:

Terminal window showing the executed Docker ps command with Grafana highlighted in the output.
This approach allows you to quickly set up Grafana in just a few seconds, with no configuration files or manual setup required. It’s perfect for quick testing or local development.

Summary!

Running Grafana Docker is still one of the quickest and most effective methods for setting up monitoring and visualization in 2025.

Whether you’re new to trying out dashboards or a DevOps engineer implementing observability on a large scale, Docker guarantees that Grafana operates in a portable, consistent, and reproducible setting.

Use this guide, and explore how Grafana Docker is the easiest way to enter the realm of data visualization.

FAQ’s

1. Is it possible to run Grafana and Prometheus together in the same Docker environment?

Yes, you can use Docker Compose to run both, which makes networking and volume management easier. This setup is commonly used for monitoring stacks.

2. How can I keep Grafana dashboards when using Docker?

You should mount /var/lib/grafana to your host machine using volumes. This way, your dashboards and configurations will remain intact even when the container restarts.

3. Is it okay to use Grafana Docker in a production environment?

Yes, but you need to adhere to best practices: use specific versioned images (avoid latest), set up persistent storage, secure admin credentials, and run Grafana behind a reverse proxy with SSL.

4. What is the default login for Grafana in Docker?

The default username is admin and the password is admin (this can be changed using the GF_SECURITY_ADMIN_PASSWORD environment variable).

5. How does running Grafana in Docker differ from running it natively?

Using Docker for Grafana provides portability, simpler setup, and isolation. A native installation might be preferable for deeper system integration or if Docker is not supported.

Areeba Nauman
Areeba is a Content Writer with expertise in web content and social media, she can simplify complex concepts to engage diverse audiences. Fueled by creativity and driven by results, she brings a unique perspective and a keen attention to detail to every project she undertakes with her creativity and passion for delivering impactful content strategies for success. Let's connect on Linkedin: https://www.linkedin.com/in/areeba-bhatti/
Unlock Benefits

Become a Community Member

SIMPLIFY SETUP, MAXIMIZE EFFICIENCY!
Setting up CyberPanel is a breeze. We’ll handle the installation so you can concentrate on your website. Start now for a secure, stable, and blazing-fast performance!