Pre-configure your site before creation on CloudCannon

Last modified: June 1st, 2023

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.

  "ssg": "nextjs",
  "build_configuration": {
    "preserved_paths": "",
    "environment_variables": [],
    "install_command": "",
    "build_command": "",
    "output_path": "out"

Open in a new tab