← Getting started
Cloudflare · API token · Custom domain

Cloudflare setup, step by step

CloudSite publishes sites through your own Cloudflare account. This guide covers the three things you need: hosting the domain on Cloudflare, creating a least-privilege API token, and connecting the domain to your site.

Open Cloudflare API tokens

1. Host your domain on Cloudflare

  1. 01In the Cloudflare dashboard choose Add a site, enter your domain (for example yourbrand.com) and select the Free plan.
  2. 02Cloudflare shows two nameservers. At your domain registrar, replace the current nameservers with those two values.
  3. 03Wait until Cloudflare marks the zone as Active. This can take a few minutes or up to 24 hours while DNS propagates.
  4. 04Review the DNS records Cloudflare imported. Remove conflicting A, AAAA or CNAME records for hostnames you plan to connect to CloudSite.

2. Create an API token

Use a custom token with only the permissions CloudSite needs. Do not use your Global API Key, and do not grant account-wide edit permissions.

ResourcePermissionLevelWhy
AccountCloudflare PagesEditCreate Pages projects and deployments, upload files, add or remove custom domains.
ZoneDNSEditCreate and update the CNAME record that points your domain to the Pages project.
ZoneZoneReadList your domains so CloudSite can find the correct zone.
AccountAccount SettingsReadOptional. Lets CloudSite list your accounts to fill in the Account ID automatically.

Under Zone Resources, choose All zones so new domains work without editing the token, or limit it to a specific zone for tighter access. Create the token and copy it immediately — Cloudflare shows it only once. Never commit the token to Git or paste it into a public chat.

3. Find your Account ID

The Account ID is the 32-character hex string in the dashboard URL:

https://dash.cloudflare.com/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6/home

You can also find it at the bottom of the Workers & Pages overview. An API token starting with cfut_ is not an Account ID.

4. Connect CloudSite

  1. 01Sign in to CloudSite, open Settings → Cloudflare and paste the API token and Account ID.
  2. 02Click Verify. CloudSite lists your Pages projects to confirm the credentials work.
  3. 03Open a site, deploy it, then add your domain under Domains. CloudSite creates the CNAME record automatically and requests the certificate.
  4. 04Visit https://yourbrand.com to confirm the site loads over HTTPS.

Troubleshooting

“Invalid API Token” or 403 errors
Check that the token has Pages:Edit, DNS:Edit and Zone:Read. Also make sure the token is scoped to the correct account and, if you limited zones, to the domain you are connecting.
“Could not route to /accounts/...”
The Account ID is wrong or the token cannot access that account. Copy the 32-character hex Account ID from the Cloudflare dashboard URL, not the token value.
The domain does not resolve after binding
Confirm the domain's nameservers point to Cloudflare and that no conflicting A, AAAA or CNAME record exists for the same hostname. DNS changes can take a few minutes.
HTTPS is not active yet
Cloudflare issues the certificate after DNS resolves. In SSL/TLS settings use Full (strict) once the certificate is active. Give it a few minutes the first time.

Need the full Chinese walkthrough with screenshots? Open the detailed Chinese guide.