Building is an optional step. If your Site is dynamic, or you only want to use CloudCannon as a CMS for your Git repository, you don’t need to build. For more information, please read our guide on using CloudCannon in Headless Mode.
A "build" is when CloudCannon converts all your Site files into a single, functional website. Building your Site in CloudCannon enables you to check all your files function well together, preview screenshots of your pages in the Collection browser, view your Site live on a Testing and Custom Domain, and use the Visual Editor for an intuitive editing experience.
When you are ready to set up builds, click the Return to setup button in the Site Navigation. This will take you back to the Summary tab on the Status page.
Click the Open build configuration button to open the Build configuration page in your Site Settings.
Clicking the I don't want to build button will opt you out of building and into Headless Mode. You can turn off Headless Mode at any time on the Details page under your Site Settings. For more information, please read our guide on using CloudCannon in Headless Mode.
To configure your first Site build you must provide the command line options and environment variables required by your Site. Specifically, CloudCannon needs your Install Command, Build Command, and Output Path.
CloudCannon will suggest build commands for you based on your SSG and the contents of your files. You can click on CloudCannon's suggested values to use them in your configuration.
When you are happy with your build commands, click the Update Configuration and Build button.
CloudCannon will attempt to build your Site.
You can monitor the outcome of your first build on the Builds tab of the Status page.
After a successful first build, CloudCannon will build your Site every time it syncs an update from your repository, or when you choose to trigger a build. This ensures your most recent content is always live.
Now's a great time to look at your Site on your Testing Domain. Click the Live site preview button in your Site Navigation. This will open your unique .cloudvent.net address.
If your build fails for any reason, CloudCannon will suggest common solutions to troubleshoot your build on the Summary tab of the Status page. You can also read your build output logs to diagnose your error.
Common Next.js Build Errors
Your build needs to output static files for CloudCannon to work correctly.
If you are using Next.js v13.3.0 and above, you must add output: 'export' to your next.config.js file. Read the Next.js documentation on Static Exports for more information.
For Next.js versions earlier than v13.3.0, you should add next export to your build command instead. For example, the build script in your package.json could be next build && next export.
For assistance configuring your builds, please contact our friendly support team.
Extending your builds#
You can add more functions to your build to collect information from your Site, improve your build time, and more.
For more information on extending your builds, please read our documentation: