# Store your tfstate on GitLab

You are already using GitLab for your project and you need a simple way to store and share your `tfstate`? Use your GitLab repo as an HTTP Backend!

Get your GitLab project ID : **Settings → General → Project ID**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728044772437/d4cd3909-8dbb-4483-9405-ac76c94bad02.png align="center")

Then we need to create a user access token or a project token, depending on your gitlab instance. **Settings → Access Token → Add new Token**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728044959056/5683654d-85dc-4697-9a55-2114ca453f91.png align="center")

The Token needs to have at least the **Maintainer** role and the **api** scope

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1728045110811/2aeda651-42cc-410b-aaea-5648d79ba519.png align="center")

Finally, specify your Project ID and Token information in your `provider.tf` file

Example for a Project ID `6576578493`

```bash
  backend "http" {
    address        = "https://gitlab.com/api/v4/projects/6576578493/terraform/state/tfstate"
    lock_address   = "https://gitlab.com/api/v4/projects/6576578493/terraform/state/tfstate/lock"
    unlock_address = "https://gitlab.com/api/v4/projects/6576578493/terraform/state/tfstate/lock"
    lock_method    = "POST"
    unlock_method  = "DELETE"
    username       = "tfstate_access"
    password       = "glpat-VMB1DHzAssssswZSTySSxe6a"
  }
```
