Skip to content

Instant Sites and custom domains

This guide walks through the full Instant Sites flow in Cosine Cloud: enable Instant Sites for a project, give it a stable production URL, and connect a custom domain through Cloudflare.

Use this when you want a project to have:

  • a built-in Cosine production URL, such as my-site.cosine.site
  • an optional custom production hostname, such as app.example.com

Make sure you have:

  • a project already created in Cosine Cloud
  • a static site build you can deploy with Instant Sites
  • access to the Cloudflare account that manages the domain you want to use
  • permission to create a Cloudflare API token for that zone

If you have not deployed an Instant Site before, review the CLI flow first:

Instant Sites uses two layers of naming:

  1. Production subdomain — the built-in Cosine URL for the project
  2. Production custom domain — your own hostname, configured through Cloudflare

The custom domain follows whichever deployment is currently promoted to production.

Step 1: Enable Instant Sites for the project

Section titled “Step 1: Enable Instant Sites for the project”
  1. Open the project in Cosine Cloud.
  2. Go to Settings.
  3. Open the Deployments tab.
  4. Turn on Enable Instant Sites.

This allows the project to receive Instant Sites deployments.

Still in Settings → Deployments:

  1. Find Production subdomain.
  2. Enter the subdomain you want Cosine to use.
  3. Save the change.

For example, if you enter docs-team, your built-in production URL becomes:

docs-team.cosine.site

Use this URL if you want a Cosine-managed production hostname without bringing your own domain.

Deploy the built site from the CLI:

Terminal window
cos deploy dist

Or deploy and promote in one step:

Terminal window
cos deploy --promote dist

If you want the deployment to become the project’s live production site, make sure it is promoted to production. The custom domain will only point at the deployment currently marked as production.

In Cloudflare:

  1. Open My Profile → API Tokens.
  2. Create a token that has access to the zone you want to use.
  3. Grant at least:
    • Zone: Read
    • DNS: Edit or DNS: Write
  4. Restrict the token to the specific zone if possible.
  5. Copy the token value.

You only need to connect this token once per team in Cosine.

Back in Cosine Cloud, in Settings → Deployments:

  1. In the Custom domain section, paste the Cloudflare API token.
  2. Click Connect Cloudflare.

After the token is saved, Cosine can list the Cloudflare zones available to that token.

Still in Settings → Deployments:

  1. In Production custom domain, enter the full hostname you want to use, such as app.example.com.
  2. In Cloudflare zone, choose the parent zone that owns that hostname.
    • For app.example.com, choose example.com.
  3. Decide whether to leave Use Cloudflare proxy (O2O) enabled.
    • Leave it on if you want the hostname proxied through Cloudflare.
    • Turn it off only if you specifically need DNS-only routing.
  4. Click Add custom domain or Update custom domain.

Cosine then asks Cloudflare to create or update the required CNAME and start hostname validation.

After saving the custom domain, watch the status fields in the same Deployments screen:

  • Status shows the custom hostname validation state
  • SSL status shows certificate provisioning progress

When validation completes, the domain becomes live and serves the deployment currently promoted to production.

Cosine expects the custom hostname to resolve to the managed CNAME target shown in the Deployments UI, for example:

customers.cosine.show

If Cosine has permission to manage the selected Cloudflare zone, it creates or updates this CNAME for you. If validation remains pending, check in Cloudflare that the hostname record exists and points at the target shown in the dashboard.

Pick the parent zone, not the full hostname.

  • Correct: choose example.com for app.example.com
  • Incorrect: try to find app.example.com as its own zone

Using a token without the right permissions

Section titled “Using a token without the right permissions”

If Cosine cannot list zones or update DNS, the token usually does not have the required permissions. Recreate it with zone read and DNS edit/write access.

Expecting the custom domain to follow preview deployments

Section titled “Expecting the custom domain to follow preview deployments”

The custom domain follows the project’s production deployment, not every preview deployment. Promote the desired deployment first if the domain is still serving an older version.

In Settings → Deployments, you can also:

  • click Refresh validation to ask Cloudflare to retry validation
  • click Remove custom domain to remove the hostname from the project