Pre-configure your site before creation on CloudCannon

Last modified: November 14th, 2023

Working with a specific static site generator?
Customize CloudCannon's documentation to suit your SSG.

Great! We'll show you documentation relevant to .
You can change this any time using the dropdown in the navigation bar.

Normally when you add your site files to CloudCannon, you will be asked to fill in various configuration details before the site builds for the first time.

If you're working with a template or a site that might be added to CloudCannon multiple times with the same build configuration, you might prefer to specify these details in the code.

Initial settings file#

You can add a /.cloudcannon/initial-site-settings.json file to the root of your site. When CloudCannon syncs and builds the site for the first time, the configuration details from this file will be used. You won't be asked to specify build configuration manually.

If you are creating a site by branching from a project, site settings will be copied from the branched site, and the initial settings file will not be used.

/.cloudcannon/initial-site-settings.json
copied
{
  "ssg": "nextjs",
  "build_configuration": {
    "preserved_paths": "",
    "environment_variables": [],
    "install_command": "",
    "build_command": "",
    "output_path": "out"
  }
}
Open in a new tab