---
title: "Grafana Docker Compose and one-click hosting"
description: "Grafana is open-source dashboards and alerting over Prometheus, PostgreSQL, Loki and more. A Datadog alternative you self-host in one click."
---

[← All templates](https://pethost.dev/templates/) · [Analytics and monitoring](https://pethost.dev/templates/monitoring/)

# Deploy Grafana in one click

Dashboards and alerts over your metrics, logs and databases

A self-hosted alternative to Datadog and New Relic.

[Deploy on Pethost](https://console.pethost.dev/?template=grafana)

## What is Grafana?

Grafana is the open-source tool for querying, visualizing and alerting on data wherever it is stored, and a common alternative to Datadog. It comes with data sources for Prometheus, Loki, InfluxDB, Graphite, Elasticsearch, PostgreSQL, MySQL, Microsoft SQL Server, CloudWatch, Azure Monitor and Google Cloud Monitoring, and more arrive as plugins. A dashboard holds panels such as time series, gauges, tables and logs, and alert rules watch the same queries and notify you by email, Slack, Telegram, Discord, PagerDuty, a webhook and more.

People self-host Grafana to see their servers, apps, sensors or business data in one place, with no price per user or per dashboard. This template runs Grafana’s open-source edition with its SQLite database in a volume, its administrator made from the fields and sign-up closed. The catch: Grafana stores no metrics itself. It needs something to read, such as a Prometheus that scrapes your servers or the PostgreSQL database of your app.

## Hosting Grafana on Pethost

1. You sign in to Pethost with a passkey, GitHub or Google. No machine yet? You pick a plan, and the link waits until it is ready.
2. New project opens at Grafana. You fill in what it asks for and click Create project: **Username**, **Admin password**.
3. In a minute or two Grafana is live at its own address with HTTPS. Its secrets are made at random, and its data is in the nightly backup.
4. It is a project like any other: you or your agent can change it, roll it back or restore it.

## Questions about Grafana

**Is Grafana free?**

Yes. Grafana’s open-source edition is under the AGPLv3 license, with no limit on users or dashboards when you run it yourself. Grafana Labs also sells Grafana Cloud and an Enterprise edition.

**Does Grafana store my data?**

No. Grafana queries its data sources each time a panel is drawn, and keeps only its dashboards, users, alert rules and settings in its own database. The metrics, logs and rows stay in Prometheus, Loki, PostgreSQL or wherever they are.

**Grafana vs Datadog: what is the difference?**

Datadog is a hosted service that collects metrics, logs and traces with its own agent and is priced by usage. Grafana draws and alerts on data that lives elsewhere, so self-hosted it costs only the server, and you choose the stores it reads.

**How do I reset the Grafana admin password?**

Open a terminal in the grafana service and run grafana cli admin reset-admin-password followed by the new password. The ADMIN_PASSWORD in .env is used only at the first start, so changing it there does nothing.

**Can Grafana send alerts?**

Yes. Grafana Alerting evaluates rules on the queries of your data sources and notifies contact points: email, Slack, Telegram, Discord, Microsoft Teams, PagerDuty, a webhook and more. Email needs an SMTP server, set with the GF_SMTP_ settings in the project’s .env.

**How much memory and disk does Grafana need?**

Grafana is moderate: about 300 MB of memory, and its own disk holds only dashboards and settings, since the data stays where Grafana queries it. On Pethost the Starter plan is enough for it, with room for other apps beside it.

## Grafana Docker Compose file

The template is this compose.yaml and the variables written into the project’s .env as it is created. Pethost runs the file as it is written.

**Containers:** grafana (grafana/grafana:13.2).

**Volumes, in the nightly backup:** data.

```
services:
  grafana:
    image: grafana/grafana:13.2
    restart: unless-stopped
    # Any setting of Grafana can be added to the project's .env as GF_<SECTION>_<KEY>, such as
    # GF_SMTP_ENABLED=true and GF_SMTP_HOST for email alerts.
    env_file: .env
    environment:
      GF_SERVER_ROOT_URL: ${URL}
      # The administrator is made from these at the first start, before Grafana answers anyone;
      # later the password is changed in Grafana, not here.
      GF_SECURITY_ADMIN_USER: ${ADMIN_USERNAME}
      GF_SECURITY_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      # Encrypts the data sources' passwords and tokens: the stock key is public.
      GF_SECURITY_SECRET_KEY: ${SECRET_KEY}
      GF_USERS_ALLOW_SIGN_UP: "false"
    volumes:
      - data:/var/lib/grafana

volumes:
  data:
```

[compose.yaml](https://pethost.dev/templates/grafana/compose.yaml)[See it on GitHub](https://github.com/pethost-dev/templates/tree/main/grafana)

## [More in Analytics and monitoring](https://pethost.dev/templates/monitoring/)

- [**Umami**Web analytics for your sites, without cookies](https://pethost.dev/templates/umami/)
- [**Uptime Kuma**Uptime monitoring with alerts and status pages](https://pethost.dev/templates/uptime-kuma/)
- [**Kener**A status page with uptime monitors and incidents](https://pethost.dev/templates/kener/)
- [**Beszel**Lightweight server monitoring: CPU, memory, disk, network and Docker stats, with history and alerts](https://pethost.dev/templates/beszel/)
- [**changedetection.io**Watches web pages and tells you when they change: prices, restocks, news](https://pethost.dev/templates/changedetection/)
- [**Checkmate**Uptime, page speed and infrastructure monitoring, with status pages](https://pethost.dev/templates/checkmate/)

Pethost · Stephan Gomer · NIP 1133096755

Pethost

- [Templates](https://pethost.dev/templates/)
- [About](https://pethost.dev/about/)
- [Docs](https://pethost.dev/docs/)
- [Blog](https://pethost.dev/blog/)
- [API](https://pethost.dev/docs/api/)
- [CLI](https://pethost.dev/docs/cli/)
- [Plugin](https://github.com/pethost-dev/plugin)
- [Terms](https://pethost.dev/terms/)
- [Privacy](https://pethost.dev/privacy/)
- [Refunds](https://pethost.dev/refunds/)
- [support@pethost.dev](mailto:support@pethost.dev)

Databases

- [Postgres](https://pethost.dev/postgres/)

Comparisons

- [Coolify vs Dokploy vs CapRover vs Dokku](https://pethost.dev/blog/coolify-vs-dokploy-vs-caprover-vs-dokku/)
- [Coolify Cloud vs Dokploy Cloud](https://pethost.dev/blog/coolify-cloud-vs-dokploy-cloud/)
- [Railway vs Render vs Fly.io pricing](https://pethost.dev/blog/railway-vs-render-vs-fly-io-pricing/)
- [Managed Docker Compose hosting](https://pethost.dev/blog/managed-docker-compose-hosting/)

Alternatives

- [Railway alternatives](https://pethost.dev/blog/railway-alternatives/)
- [Heroku alternatives](https://pethost.dev/blog/heroku-alternatives/)
- [Dokploy alternatives](https://pethost.dev/blog/dokploy-alternatives/)
- [Coolify alternatives](https://pethost.dev/blog/coolify-alternatives/)
- [Render alternatives](https://pethost.dev/blog/render-alternatives/)
- [Sliplane alternatives](https://pethost.dev/blog/sliplane-alternatives/)
