---
title: "Install the Grafana Terraform provider | Grafana Labs"
description: "Set up the Grafana Terraform provider to manage your Grafana Cloud resources."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Install the Grafana Terraform provider

The Grafana Terraform provider enables you to manage Grafana Cloud resources using Terraform configuration files. Installing and configuring this provider is your first step toward managing your observability platform as code.

To install the Grafana Terraform provider, complete the following steps:

1. Create a new directory for your Terraform configuration:
   
   sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```sh
   mkdir grafana-terraform
   cd grafana-terraform
   ```
2. Create a file named `provider.tf` with the following content:
   
   hcl ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```hcl
   terraform {
     required_providers {
       grafana = {
         source  = "grafana/grafana"
         version = "~> 3.0"
       }
     }
   }
   
   provider "grafana" {
     url  = "https://<YOUR_STACK>.grafana.net"
     auth = "<YOUR_SERVICE_ACCOUNT_TOKEN>"
   }
   ```
3. Replace `<YOUR_STACK>` with your Grafana Cloud stack name.
4. Replace `<YOUR_SERVICE_ACCOUNT_TOKEN>` with your service account token that starts with `glsa_`.
5. Initialize Terraform to download the provider:
   
   sh ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```sh
   terraform init
   ```

The output confirms Terraform has downloaded and initialized the Grafana provider successfully.

In the next milestone, you’ll configure SAML authentication with external group synchronization.
