---
title: "Create a service account token | Grafana Labs"
description: "Create a Grafana service account with a token for Terraform authentication."
---

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

# Create a service account token

Terraform needs an API credential to authenticate to your Grafana instance. A service account token provides this without using your personal login. It’s a dedicated credential for automated tools.

To create a service account token, complete the following steps:

01. Log in to your Grafana instance with an Admin account.
02. Navigate to **Administration &gt; Users and access &gt; Service accounts** in the left-side menu.
03. Click **Add service account**.
04. Enter a name for the service account, for example `terraform-deployer`.
05. Set the role to **Editor** (sufficient for creating and updating dashboards and folders).
06. Click **Create**.
07. On the service account detail page, click **Add service account token**.
08. Enter a token name, for example `terraform-token`.
09. Click **Generate token**.
10. Copy the generated token and store it securely. You will not be able to see it again.

> Warning
> 
> Never commit service account tokens to version control. Store them as environment variables or in a secrets manager.

## What you need for the next steps

Expand table

| Value                     | Example                           | Where it comes from          |
|---------------------------|-----------------------------------|------------------------------|
| **Grafana URL**           | `https://your-stack.grafana.net/` | Your Grafana instance URL    |
| **Service account token** | `glsa_xxxxxxxxxxxx`               | The token you just generated |

Keep both values accessible. You’ll use them to configure the Terraform provider in the next milestone.

In the next milestone, you configure the Grafana Terraform provider with these credentials.
