Self-host Grafana in one click

Run free, open source Grafana on your own VPS, with HTTPS on your subdomain and no limits on users, series or retention.

Terminal
$ curl -fsSL https://sshworkbench.com/install.sh | bash

Free 7-day trial. No sign-up, no credit card.

Deploy Grafana dialog in SSH Workbench

Last updated November 16, 2026

Is self-hosted Grafana free?

Yes. Grafana OSS is open source under the AGPLv3 license, and Grafana Labs moved Grafana, Loki and Tempo to that license in 2021. You can self-host it for your own company or your clients with no limit on users, dashboards, data sources or retention.

AGPLv3 matters only if you change Grafana's source code and let other people use your changed version over a network. Then you have to publish those changes. Running the official image, building dashboards and writing plugins against its API do not trigger that.

Grafana ships two images, and both are free to run:

  • grafana/grafana is the open source edition.
  • grafana/grafana-enterprise is the one Grafana's docs recommend. Without a license it behaves like OSS. Add a paid license and it unlocks the Enterprise features.

What is paid when you self-host: SAML login, team sync, PDF reporting, data source permissions and the Enterprise data source plugins. Google, GitHub and generic OAuth logins work in the free edition.

Self-hosted Grafana vs Grafana Cloud: what it costs

Grafana Cloud has a real free tier, so the comparison is about limits more than price. Cloud prices are in US dollars per month; the VPS price is Hetzner's cheapest shared plan, excluding VAT.

OptionPer monthPer yearWhat you get
Self-hosted on a VPSfrom €5.49from €66No caps; retention is up to your disk
Grafana Cloud Free$0$010k metric series, 50 GB logs, 3 users, 14 days retention
Grafana Cloud Pro, 3 usersfrom $19 + usagefrom $228Same included usage, 13 months of metrics
Grafana Cloud Pro, 10 usersfrom $75 + usagefrom $900$8 for each active user past 3

On Pro, metrics past the included 10,000 series cost from $6.50 per 1,000, and logs are billed per GB processed, written and retained. Grafana Cloud Enterprise starts at a $25,000 yearly commitment.

The takeaway: a hobby project fits in Cloud Free. A team of 10 on Pro pays at least $900 a year before any usage, while a small VPS runs Grafana, Prometheus and Loki for everyone for under €100 a year, and keeps the data on your own server.

With SSH Workbench, add $199 once or $9 a month.

Grafana self-hosted requirements

  • A Linux VPS. Grafana's documented minimum is 512 MB of RAM and 1 CPU core. That covers Grafana alone. Prometheus and Loki on the same server need more, so start with 2 GB if you plan to run the whole stack.
  • A domain or subdomain, such as grafana.example.com, with an A record pointing at the server.
  • Docker or Podman on the server.
  • A database. Grafana uses SQLite by default, stored in its data folder. Grafana's docs say SQLite is fine for small instances but not recommended for production, and support MySQL 8.0+ and PostgreSQL 12+ instead. See self-hosting PostgreSQL if you outgrow SQLite.

Self-host Grafana in one click with SSH Workbench

  1. Connect your server in SSH Workbench, open Apps, then Deploy app, and pick Grafana.
  2. Keep the container name grafana or type your own.
  3. Under Where should this app live?, choose On a subdomain with HTTPS and type your domain. SSH Workbench checks that the DNS A record points at the server and that port 80 is free, then sets up a Caddy reverse proxy with a Let's Encrypt certificate.
  4. Click Deploy. SSH Workbench generates a random admin username (admin-xxxx) and a 24-character password. Both appear once, on the screen after the deploy, so save them before you close it.
  5. Optional: open Advanced to set a CPU limit, so a heavy dashboard cannot starve other apps on the server.

Prefer to keep Grafana off the internet? Choose Localhost only. The port is bound to 127.0.0.1, and SSH Workbench shows you the SSH tunnel command to open Grafana from your own machine.

Grafana self-hosted docker compose

To set it up by hand, this compose file runs Grafana behind a reverse proxy on the same server. Replace the domain and the password.

services:
  grafana:
    image: grafana/grafana:13.3
    restart: unless-stopped
    ports:
      - "127.0.0.1:3000:3000"
    environment:
      - GF_SERVER_ROOT_URL=https://grafana.example.com/
      - GF_SECURITY_ADMIN_USER=admin
      - GF_SECURITY_ADMIN_PASSWORD=change-this-password
    volumes:
      - grafana_data:/var/lib/grafana

volumes:
  grafana_data:

Binding to 127.0.0.1 keeps port 3000 closed to the internet. With Caddy installed on the server, this Caddyfile adds HTTPS:

grafana.example.com {
	reverse_proxy 127.0.0.1:3000
}

Start it with docker compose up -d and sign in at https://grafana.example.com. Every setting in grafana.ini can be set the same way, as GF_<SECTION>_<KEY>. To install plugins at startup, list them in GF_PLUGINS_PREINSTALL, for example grafana-clock-panel.

Self-hosted Grafana with Prometheus and Loki

Grafana only draws the charts. The data comes from somewhere else, and on a VPS that is usually Prometheus for metrics and Loki for logs. This compose file runs all three, plus Node Exporter to read the server's own CPU, memory and disk:

services:
  grafana:
    image: grafana/grafana:13.3
    restart: unless-stopped
    ports:
      - "127.0.0.1:3000:3000"
    environment:
      - GF_SERVER_ROOT_URL=https://grafana.example.com/
    volumes:
      - grafana_data:/var/lib/grafana

  prometheus:
    image: prom/prometheus:v3
    restart: unless-stopped
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus_data:/prometheus

  node-exporter:
    image: prom/node-exporter:v1
    restart: unless-stopped
    command: --path.rootfs=/host
    pid: host
    volumes:
      - /:/host:ro,rslave

  loki:
    image: grafana/loki:3.7
    restart: unless-stopped
    volumes:
      - loki_data:/loki

volumes:
  grafana_data:
  prometheus_data:
  loki_data:

And prometheus.yml next to it:

scrape_configs:
  - job_name: node
    static_configs:
      - targets: ["node-exporter:9100"]

Only Grafana publishes a port, and only on 127.0.0.1. In Grafana, add a Prometheus data source at http://prometheus:9090 and a Loki one at http://loki:3100, then import dashboard 1860 (Node Exporter Full). Loki stores logs but does not collect them; Grafana's Alloy agent ships container and system logs into it. Node Exporter's network graphs show the container's own traffic unless you run it with network_mode: host.

Backups

Everything Grafana keeps lives in /var/lib/grafana, the grafana_data volume: the SQLite database grafana.db with your dashboards, users, alerts and data source passwords, plus installed plugins. Grafana's docs say to stop Grafana before copying the SQLite file, so the copy is consistent:

docker compose stop grafana
docker run --rm -v grafana_data:/data:ro -v "$PWD":/backup alpine tar czf /backup/grafana.tar.gz -C /data .
docker compose start grafana

To restore, stop Grafana, extract the archive back into the volume and start it again. Docker compose prefixes volume names with the project folder, so check the real name with docker volume ls.

In SSH Workbench, Back up now in the app's menu does the same: it stops Grafana for a few seconds, archives the whole data volume and starts it again. Restore from backup puts it back. If you moved Grafana to PostgreSQL, back up that database with pg_dump as well.

Updating self-hosted Grafana

Take a backup, then pull the new image and recreate the container:

docker compose pull
docker compose up -d

Grafana upgrades are backward compatible, but some releases carry breaking changes, so read the upgrade notes for your target version first, especially across a major version such as 12 to 13. Pin a version tag like 13.3 rather than latest, so a restart never upgrades you by surprise.

Troubleshooting

GF_PATHS_DATA='/var/lib/grafana' is not writable. The Grafana image runs as user 472, not root, and a bind-mounted host folder usually belongs to someone else. Use a named volume as in the compose files above, or run sudo chown -R 472:0 on the folder. If the container keeps restarting for this reason, see Docker container keeps restarting.

The admin password from your compose file does not work. GF_SECURITY_ADMIN_PASSWORD is only read on the very first start. After that the password lives in the database, so reset it with grafana cli admin reset-admin-password inside the container.

Redirects to localhost:3000 or OAuth callback errors. Grafana does not know its public address. Set GF_SERVER_ROOT_URL to your full HTTPS URL, including the trailing slash, and recreate the container.

Self-hosting Grafana: questions

Is Grafana Enterprise free?

The grafana-enterprise image costs nothing to run, and without a license it works exactly like the open source build. The license that unlocks the Enterprise features has no public price for self-hosting; Grafana Labs quotes it through sales. For a sense of scale, Grafana Cloud Enterprise starts at a $25,000 yearly commitment.

Should I use Grafana Cloud or self-host Grafana?

Grafana Cloud Free is hard to beat for one small project: 10,000 metric series, 50 GB of logs and 3 users at no cost, with 14 days of retention. Self-host when you need more users, longer retention or more series than that, or want your metrics to stay on your own servers. You then also run Prometheus and Loki yourself, which is where most of the upkeep is.

Does self-hosted Grafana support SSO?

The free edition can sign users in with Google, GitHub, GitLab, Okta, Entra ID, generic OAuth (OIDC) and LDAP. SAML and team sync need a Grafana Enterprise license or Grafana Cloud. For OAuth, set GF_SERVER_ROOT_URL to your HTTPS address first, since Grafana builds the callback URL from it.

Can I use Grafana for VPS monitoring?

Grafana is a common choice for watching a VPS, but it needs two helpers: Node Exporter reads CPU, memory, disk and network, and Prometheus stores the numbers. Run them on each server you watch, or point one Prometheus at Node Exporter on several servers. Grafana alerting can then email you or post to Slack when disk or memory runs low.

How do I reset the Grafana admin password?

Run the Grafana CLI inside the container: docker compose exec grafana grafana cli --homepath /usr/share/grafana admin reset-admin-password 'new-password'. Changing GF_SECURITY_ADMIN_PASSWORD and restarting does not work on an existing install, because Grafana only reads that value the first time it starts and then keeps the password in its database.

Grafana is a trademark of Grafana Labs Inc.. SSH Workbench is not affiliated with or endorsed by Grafana Labs Inc..

Deploy Grafana in one click

Install SSH Workbench, connect your server and pick Grafana from the catalog.

Terminal
$ curl -fsSL https://sshworkbench.com/install.sh | bash

Free 7-day trial. No sign-up, no credit card.