Google Cloud

Do you want to offload your WordPress media files to Google Cloud Storage? Then Next3 Offload will provide you with the easiest way to connect with Google Cloud Platform. 

Here’s a step-by-step guide to create a Google Cloud Storage Bucket and generate a JSON credentials file (for service account access):

How to Create a Test Google Cloud Project and JSON Key

 Step 1: Create a Google Cloud Project

  • Go to: https://console.cloud.google.com
  • Click on the project dropdown (top left).
  • Click “New Project”.
  • Name it (e.g., test-storage-project) and click Create.

 Step 2: Enable Google Cloud Storage API

  • In the left sidebar, go to “APIs & Services” → “Library”.
  • Search for “Cloud Storage”.
  • Click it, then click Enable.

 Step 3: Create a Service Account and JSON Key

  1. Go to IAM & Admin → Service Accounts.
  2. Click “Create Service Account”.
  3. Give it a name (e.g., gcs-test-account) and click Create and Continue.
  4. Assign Role → Search for and select:
    • Storage Admin (or at least Storage Object Admin)
  5. Click Done.
  6. Now you’ll see your service account in the list.
    • Click the 3-dot menu → Manage Keys → Add Key → Create New Key
    • Select JSON → Click Create
    • It will download a .json file (this is what your app uses)

 Keep this JSON file secure. Do not share it publicly.

Sample JSON (Structure only, not usable)

{
  "type": "service_account",
  "project_id": "your-project-id",
  "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhki...\n-----END PRIVATE KEY-----\n",
  "client_email": "[email protected]",
  "client_id": "12345678901234567890",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/your-service-account%40your-project-id.iam.gserviceaccount.com"
}

Best Practice

  • Use .env or config files to load this JSON securely in your PHP app.
  • Never push this file to GitHub or any public repo.

Next

Leave a Reply