We have two possibilities to store our files locally or to transfer them to Google Cloud Storage. By default the images and files are stored locally. If you want to transfer them you must follow the steps below.
Creating Storage Bucket
Open the Cloud Storage browser in the Google Cloud Console.
Click Create bucket to start with creation.
3. Enter the bucket Information and click Continue to complete each step and at the end click Create.
Specify a name based on bucket name requirements (you will need this name in our backend)
Choose a default storage for your data (we suggest the Standard one)
Select an access control (fine-grained is a suggestion)
Advanced Settings is important so click at Encryption the first one Google-managed key.
4. Click Done.
Generate Encryption Key
To access the images or files transferred to bucket must generate an Encryption Key
Go to IAM & admin > Service Accounts
Click Create Service Account to create the service account.
Give your Service Account a name and click Create.
After that you should set permissions to account created, click Storage as a role and set Storage Object admin and then click Continue.
On the final page click Create Key, the key type must be JSON.
The Encyption Key will be downloaded and is important to make the connection with our backend, you must save it.
Make the storage public to Internet
Go to Storage browser and select the bucket that you created.
Click the settings of this bucket and then Edit Bucket Permission.
Click Add Member button to make it public for All Users
4. Select allUsers and role as Storage Object Admin (to store, view and edit files and images transferred)
5. Click Done and storage is now public to internet.
Integrate Google Cloud Storage in our backend.
Go to Advanced Settings
At Google Cloud Storage click the checkbox to transfer files to Google Cloud
You have two options to store locally or to Google Cloud (if you choose Google Cloud you can’t change it later because all the files are now tranferred)
At Google Managed Key field > Copy the text of the file you downloaded > Paste it
At Project ID field > Go to Storage browser > Copy only project id (you can find it at you URL after project= )
At Bucket Name > Go to Storage browser > Copy the name of the bucket you created and paste it
All the fields are completed click Submit.