Storing Files on Google Cloud Storage (GCS)

If you’re using containers for deployment (including Docker and Heroku) you’ll want to avoid storing files in the container’s volatile filesystem. This integration allows you to delegate storing such files to Google Cloud Storage (GCS) service.

Base configuration

Set an environment variable to path of the json file.
The OAuth 2 credentials to use for the connection. If unset, falls back to the default inferred from the environment (i.e. GOOGLE_APPLICATION_CREDENTIALS)

Serving media files with a GCS bucket

If you want to store and serve media files, set the following environment variable to use GCS as media bucket:

The GCS bucket name to use for media files.


The media files are every data uploaded through the dashboard (product images, category images, etc.)

Serving static files with a GCS bucket

By default static files (such as CSS and JS files required to display your pages) will be served by the application server.

If you intend to use GCS for your static files as well, set an additional environment variable:

The GCS bucket name to use for static files.


You will need to configure your GCS bucket to allow cross origin requests for some files to be properly served (SVG files, Javascript files, etc.). For that, you have to set below instructions in your GCS Bucket’s permissions tab under the CORS section.

<?xml version="1.0" encoding="UTF-8"?>