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
Before you start
Section titled “Before you start”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:
What gets configured
Section titled “What gets configured”Instant Sites uses two layers of naming:
- Production subdomain — the built-in Cosine URL for the project
- 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”- Open the project in Cosine Cloud.
- Go to Settings.
- Open the Deployments tab.
- Turn on Enable Instant Sites.
This allows the project to receive Instant Sites deployments.
Step 2: Set the production subdomain
Section titled “Step 2: Set the production subdomain”Still in Settings → Deployments:
- Find Production subdomain.
- Enter the subdomain you want Cosine to use.
- Save the change.
For example, if you enter docs-team, your built-in production URL becomes:
docs-team.cosine.siteUse this URL if you want a Cosine-managed production hostname without bringing your own domain.
Step 3: Deploy the site
Section titled “Step 3: Deploy the site”Deploy the built site from the CLI:
cos deploy distOr deploy and promote in one step:
cos deploy --promote distIf 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.
Step 4: Create a Cloudflare API token
Section titled “Step 4: Create a Cloudflare API token”In Cloudflare:
- Open My Profile → API Tokens.
- Create a token that has access to the zone you want to use.
- Grant at least:
- Zone: Read
- DNS: Edit or DNS: Write
- Restrict the token to the specific zone if possible.
- Copy the token value.
You only need to connect this token once per team in Cosine.
Step 5: Connect Cloudflare in Cosine
Section titled “Step 5: Connect Cloudflare in Cosine”Back in Cosine Cloud, in Settings → Deployments:
- In the Custom domain section, paste the Cloudflare API token.
- Click Connect Cloudflare.
After the token is saved, Cosine can list the Cloudflare zones available to that token.
Step 6: Add the production custom domain
Section titled “Step 6: Add the production custom domain”Still in Settings → Deployments:
- In Production custom domain, enter the full hostname you want to use, such as
app.example.com. - In Cloudflare zone, choose the parent zone that owns that hostname.
- For
app.example.com, chooseexample.com.
- For
- 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.
- Click Add custom domain or Update custom domain.
Cosine then asks Cloudflare to create or update the required CNAME and start hostname validation.
Step 7: Wait for validation and SSL
Section titled “Step 7: Wait for validation and SSL”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.
How DNS should look
Section titled “How DNS should look”Cosine expects the custom hostname to resolve to the managed CNAME target shown in the Deployments UI, for example:
customers.cosine.showIf 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.
Common mistakes
Section titled “Common mistakes”Choosing the wrong zone
Section titled “Choosing the wrong zone”Pick the parent zone, not the full hostname.
- Correct: choose
example.comforapp.example.com - Incorrect: try to find
app.example.comas 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.
Refresh or remove a domain
Section titled “Refresh or remove a domain”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