Gatsby Cloud Docs


Configuration with Gatsby Cloud

Table of Contents

Gatsby Cloud is a product for creating and deploying Gatsby sites fast. Within Gatsby Cloud you can set up your site with custom configuration details.


How do I set a Node.js version for my site?

There are two ways to do this.

  • You can include a .nvmrc file in your project repository.
  • You can set your Node.js version using the NODE_VERSION environment variable inside Gatsby Cloud. The default is NODE_VERSION=12.

Can I use a custom build script?

Right now, Gatsby Cloud runs gatsby build for all site builds.

If you need to run any custom scripts, you can add a preinstall or postinstall script to your package.json and we will run that before or after your packages are installed.

Can I build a site off of a monorepo?

You can! In order to use a monorepo configure your base directory in Gatsby Cloud Site Settings to the directory you want to build.

We support npm, yarn, yarn workspaces and lerna with yarn workspaces or npm.

Can I build multiple sites off the same monorepo?

Yes! This workflow is supported in Gatsby Cloud.

Why did I hit “Out of Memory” errors?

By default, max-old-space-size is set to 1 GB. If you need to increase this, use the NODE_OPTIONS environment variable.

Another possibility is that your site uses very large images. It may be necessary to resize the source images.

What is the minimum version of Gatsby that Gatsby Cloud supports?

Currently, in order to use Gatsby Cloud, your project must be using Gatsby version 2.1.0 or greater.

When Gatsby Cloud asks for access to all repos - does that include repos under other organizations? I don’t want my work repos included.

You can authorize specific organizations to be authorized to access Gatsby Cloud. For more information on permissions see the Gatsby Cloud Permissions page.

How do I set a production domain?

The goal of Preview is for internal team use, so we do not encourage you to set a publicly accessible domain.

For Builds, the domain is controlled by your deploy target, not Gatsby Cloud. To adjust that deploy target visit your CDN of choice.

How can I build my site with the —prefix-paths option?

You can set an environment variable named PREFIX_PATHS to true in Gatsby Cloud and your site will be built with the pathPrefix and/or assetPrefix set in your gatsby-config.js. This requires gatsby-cli version 2.9.0 or higher.

Can I cancel a build?

Not at this time. Builds run in the order they’re triggered. and individual builds cannot be cancelled.

How do I clear the cache?

Builds are cached by branch. If you want to manually clear the cache and trigger a new build you can do so by clicking on the “Trigger build” dropdown button and selecting the “Clear cache and build master branch” option.

© 2020 Gatsby, Inc.