Publishing docs — all chapters

What Cloudflare Pages is for

Cloudflare Pages serves your site from Cloudflare’s network, with HTTPS, and no server for you to run. Selfish uploads the built site directly, which Cloudflare calls Direct Upload.

As with Netlify, the project has to exist first.

  1. At dash.cloudflare.com → Workers & Pages, create a Pages project and choose direct upload. Open Workers & Pages in Selfish’s Publishing screen takes you there.
  2. Create an API token with the permission Account → Cloudflare Pages → Edit. Create Token on Cloudflare opens the page.
  3. If you would like Selfish to find your account and project for you, give the token Account → Account Settings → Read as well. It is optional.

Then, in Site Settings → Publishing, set Publish Using to Cloudflare Pages.

FieldWhat to enter
API TokenThe token from step 2. It is stored in the Keychain only.
AccountChoose Load account & projects and pick from the list. Or type the Account ID, a 32-character code from the Workers & Pages overview.
ProjectPick the project from the list, or type its Project Name exactly, for example my-site.

A token with only the Pages permission works perfectly well. Enter the account ID and project name by hand, and skip the Load button.

What a publish does

Each publish creates a new production deployment on your *.pages.dev address. Files that haven’t changed are skipped, so repeat publishes are fast, and anything you removed from your site goes with the old deployment.

Selfish writes a _redirects file when posts have old addresses, so those are proper redirects on Cloudflare Pages. Your themed 404.html is shown for bad links without being asked.

Limits worth knowing

Your own domain

In the Pages project, open Custom domains and set the domain up there first. For a domain itself, such as example.com, its DNS has to be on Cloudflare. A subdomain such as www.example.com can point at your pages.dev address from any DNS provider. Selfish’s Publishing screen shows the record and checks it. See Custom domains.

Problems? See Troubleshooting.