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.
- 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.
- Create an API token with the permission Account → Cloudflare Pages → Edit. Create Token on Cloudflare opens the page.
- 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.
| Field | What to enter |
|---|---|
| API Token | The token from step 2. It is stored in the Keychain only. |
| Account | Choose Load account & projects and pick from the list. Or type the Account ID, a 32-character code from the Workers & Pages overview. |
| Project | Pick 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
- A deployment can hold up to 20,000 files on Cloudflare’s free plan, and no single file may be larger than 25 MiB. A long video or a long audio recording can pass that, so check before you build a podcast on it.
- A project made for direct upload can’t later be switched to deploy from a Git repository. That doesn’t affect Selfish, which never uses one.
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.