> For the complete documentation index, see [llms.txt](https://docs.rairprotocol.org/rairprotocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rairprotocol.org/rairprotocol/integrations/core-technologies/guides/gcp-cloud-storage.md).

# GCP Cloud Storage

Profile images and Videos are stored in GCP Buckets.Configuration steps required :

* Creation of Buckets
* Service Account Creation
* Grant Access to  Service Account on Buckets
* Updating environment variables in .env file

### Creation of Buckets

<details>

<summary>Navigate to Google Cloud Storage - Buckets</summary>

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2FD2UVyx2pk5LOmZjsgHsP%2FScreenshot%20from%202024-05-08%2014-56-42.png?alt=media&amp;token=894f1caf-7a96-420d-b8b1-2d3a6d52d52e" alt="" data-size="original">

</details>

<details>

<summary>Create Bucket</summary>

Click on CREATE Button

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2FCoBDrz1v6bGIOBlpOAaF%2FScreenshot%20from%202024-05-08%2015-02-38.png?alt=media&amp;token=b72e08b3-b7a3-4044-946e-e00ffef95ec0" alt="" data-size="original">

Follow defaults and Provide "Public to internet " access by Granting "Storage Object Creator" Role to user "allUsers"

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2Fm12gvqqW5xq12Xr3aK5y%2FScreenshot%20from%202024-05-08%2015-10-21.png?alt=media&amp;token=bd030a1a-1fd7-49cb-a5b1-ade81783c82d" alt="" data-size="original">

</details>

Two Buckets needs to be created - one for Storing videos and other for storing Profile images

### Service Account Creation

<details>

<summary>Navigate to IAM &#x26; Admin - Service Accounts</summary>

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2F5dJ4UoQug9b5JX3soYZV%2FScreenshot%20from%202024-05-08%2015-15-41.png?alt=media&amp;token=8d4a6430-6487-4947-8c45-f9de7fccdd67" alt="" data-size="original">

</details>

<details>

<summary>Create Service Account</summary>

Click on CREATE SERVICE ACCOUNT Button

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2FYxbLriVg8GMkGLLN70vm%2FScreenshot%20from%202024-05-08%2015-19-24.png?alt=media&amp;token=25ce6ea3-f9c5-4197-a48f-cdae3cd98226" alt="" data-size="original">

Follow the defaults and create account

</details>

<details>

<summary>Create Key</summary>

For the Service Account, create key and download it for updating it in .env file

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2F490MIYZM9Ats91OGUxtZ%2FScreenshot%20from%202024-05-08%2015-24-33.png?alt=media&amp;token=a40490d6-9e7a-4ca0-9555-1c05c29b74f4" alt="" data-size="original">

</details>

### Grant Access to Service Account on Buckets

<details>

<summary>Navigate to Buckets created in last step</summary>

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2Fg547Iu4G6I7WjZwAz4ca%2FScreenshot%20from%202024-05-08%2015-34-21.png?alt=media&amp;token=b79143d4-d530-4966-b846-2a6add17f91b" alt="" data-size="original">

Select PERMISSIONS tab and then click on GRANT ACCESS

Assign "Storage Object Admin" Role to the Service Account Created in last step

<img src="https://3641609714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5tYv0KixTaiEIz5F9uBB%2Fuploads%2FFyIpdyF44D9umyVd0S3g%2FScreenshot%20from%202024-05-08%2015-38-48.png?alt=media&amp;token=e8ba2a05-1688-405e-9c5c-2653d653c80b" alt="" data-size="original">

</details>

### Updating environment variables

Set following environments variables in .env file

gcp\_image\_bucket\_name=\<Bucket name for storing Profile images>

gcp\_video\_bucket\_name=\<Bucket name for storing Videos>

gcp\_credentials='\<Paste contents of the Key file of Service Account>'
